[jira] [Created] (OFBIZ-4430) Replace OFBiz HttpClient either by org.apache.commons.httpclient.HttpClient or rewrite it using NIO

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (OFBIZ-4430) Replace OFBiz HttpClient either by org.apache.commons.httpclient.HttpClient or rewrite it using NIO

Nicolas Malin (Jira)
Replace OFBiz HttpClient either by org.apache.commons.httpclient.HttpClient or rewrite it using NIO
---------------------------------------------------------------------------------------------------

                 Key: OFBIZ-4430
                 URL: https://issues.apache.org/jira/browse/OFBIZ-4430
             Project: OFBiz
          Issue Type: Improvement
          Components: framework
    Affects Versions: SVN trunk
            Reporter: Jacques Le Roux
             Fix For: SVN trunk


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

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4430) Replace OFBiz HttpClient either by org.apache.commons.httpclient.HttpClient or rewrite it using NIO

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13107984#comment-13107984 ]

BJ Freeman commented on OFBIZ-4430:
-----------------------------------

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.

> Replace OFBiz HttpClient either by org.apache.commons.httpclient.HttpClient or rewrite it using NIO
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4430
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4430
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Jacques Le Roux
>             Fix For: SVN trunk
>
>
> 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

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4430) Replace OFBiz HttpClient either by org.apache.commons.httpclient.HttpClient or rewrite it using NIO

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13108006#comment-13108006 ]

BJ Freeman commented on OFBIZ-4430:
-----------------------------------

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.

> Replace OFBiz HttpClient either by org.apache.commons.httpclient.HttpClient or rewrite it using NIO
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4430
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4430
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Jacques Le Roux
>             Fix For: SVN trunk
>
>
> 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

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4430) Replace OFBiz HttpClient either by org.apache.commons.httpclient.HttpClient or rewrite it using NIO

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13108329#comment-13108329 ]

BJ Freeman commented on OFBIZ-4430:
-----------------------------------

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.


> Replace OFBiz HttpClient either by org.apache.commons.httpclient.HttpClient or rewrite it using NIO
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4430
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4430
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Jacques Le Roux
>             Fix For: SVN trunk
>
>
> 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

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4430) Replace OFBiz HttpClient either by org.apache.commons.httpclient.HttpClient or rewrite it using NIO

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13109034#comment-13109034 ]

BJ Freeman commented on OFBIZ-4430:
-----------------------------------

yup that was to easy working on solution

> Replace OFBiz HttpClient either by org.apache.commons.httpclient.HttpClient or rewrite it using NIO
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4430
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4430
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Jacques Le Roux
>             Fix For: SVN trunk
>
>
> 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

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4430) Replace OFBiz HttpClient either by org.apache.commons.httpclient.HttpClient or rewrite it using NIO

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13109294#comment-13109294 ]

Jacques Le Roux commented on OFBIZ-4430:
----------------------------------------

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

> Replace OFBiz HttpClient either by org.apache.commons.httpclient.HttpClient or rewrite it using NIO
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4430
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4430
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Jacques Le Roux
>             Fix For: SVN trunk
>
>
> 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

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4430) Replace OFBiz HttpClient either by org.apache.commons.httpclient.HttpClient or rewrite it using NIO

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13109640#comment-13109640 ]

BJ Freeman commented on OFBIZ-4430:
-----------------------------------

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

> Replace OFBiz HttpClient either by org.apache.commons.httpclient.HttpClient or rewrite it using NIO
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4430
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4430
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Jacques Le Roux
>             Fix For: SVN trunk
>
>
> 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

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4430) Replace OFBiz HttpClient either by org.apache.commons.httpclient.HttpClient or rewrite it using NIO

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13109817#comment-13109817 ]

BJ Freeman commented on OFBIZ-4430:
-----------------------------------

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

> Replace OFBiz HttpClient either by org.apache.commons.httpclient.HttpClient or rewrite it using NIO
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4430
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4430
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Jacques Le Roux
>             Fix For: SVN trunk
>
>
> 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

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira