Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-4430

Replace OFBiz HttpClient by org.apache.commons.httpclient.HttpClient

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: Trunk
    • Fix Version/s: 16.11.01
    • Component/s: framework
    • Labels:
      None
    • Sprint:
      Bug Crush Event - 21/2/2015

      Description

      The main problem with current implementation is that it does not handle connections release. You must rely on the SO to release them (timeout).

      Related thread: http://markmail.org/message/qgmdgqqxakio6fja

        Activity

        Hide
        bjfreeman BJ Freeman added a comment -

        My suggestion to use NIO was more for all of Ofbiz.
        I don't see adding another package that has the same basic function as the java.net just for HttpClient.
        So will review the commons package to see what can be down with current httpClient.

        Show
        bjfreeman BJ Freeman added a comment - My suggestion to use NIO was more for all of Ofbiz. I don't see adding another package that has the same basic function as the java.net just for HttpClient. So will review the commons package to see what can be down with current httpClient.
        Hide
        bjfreeman BJ Freeman added a comment -

        Quick review there are two possible solutions with current code.
        1)modify org.ofbiz.base.util.URLConnector to handle the close automatically.
        2)Call org.ofbiz.base.util.URLConnector.close in HttpClient.
        The way Commons does this is when the stream is closed the connector is closed.
        will look at it again shortly to see if I agree with what I just wrote.

        Show
        bjfreeman BJ Freeman added a comment - Quick review there are two possible solutions with current code. 1)modify org.ofbiz.base.util.URLConnector to handle the close automatically. 2)Call org.ofbiz.base.util.URLConnector.close in HttpClient. The way Commons does this is when the stream is closed the connector is closed. will look at it again shortly to see if I agree with what I just wrote.
        Hide
        bjfreeman BJ Freeman added a comment -

        in current httpClient.sendHttpRequest()
        while ((line = post.readLine()) != null) {
        if (Debug.verboseOn() || debug) Debug.log("[HttpClient] : " + line, module);
        buf.append(line);
        if (lineFeed)

        { buf.append("\n"); }

        }
        //have to set org.ofbiz.base.util.URLConnector.close() to protected.
        //add the following line.
        con.close();//sent request got back response so close connection.

        Show
        bjfreeman BJ Freeman added a comment - in current httpClient.sendHttpRequest() while ((line = post.readLine()) != null) { if (Debug.verboseOn() || debug) Debug.log(" [HttpClient] : " + line, module); buf.append(line); if (lineFeed) { buf.append("\n"); } } //have to set org.ofbiz.base.util.URLConnector.close() to protected. //add the following line. con.close();//sent request got back response so close connection.
        Hide
        bjfreeman BJ Freeman added a comment -

        yup that was to easy working on solution

        Show
        bjfreeman BJ Freeman added a comment - yup that was to easy working on solution
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        You mean it's not a working solution or it was so easy to fix?

        Show
        jacques.le.roux Jacques Le Roux added a comment - You mean it's not a working solution or it was so easy to fix?
        Hide
        bjfreeman BJ Freeman added a comment -

        LOL punctuation does make a difference
        Not a working solution. Working on a working solution.

        Show
        bjfreeman BJ Freeman added a comment - LOL punctuation does make a difference Not a working solution. Working on a working solution.
        Hide
        bjfreeman BJ Freeman added a comment -

        Found the Apache HttpClient has been in SVN in 8/2009 last upated by Adrian this year.
        So I will bow out since I have already converted my SVN to nio and my code will not work on the Ofbiz SVN

        Show
        bjfreeman BJ Freeman added a comment - Found the Apache HttpClient has been in SVN in 8/2009 last upated by Adrian this year. So I will bow out since I have already converted my SVN to nio and my code will not work on the Ofbiz SVN
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        I will finally not work on this. People can pick what they prefer but should be warned. I just put a comment on top of the class at r1737695

        Show
        jacques.le.roux Jacques Le Roux added a comment - I will finally not work on this. People can pick what they prefer but should be warned. I just put a comment on top of the class at r1737695

          People

          • Assignee:
            jacques.le.roux Jacques Le Roux
            Reporter:
            jacques.le.roux Jacques Le Roux
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development

                Agile