[jira] [Comment Edited] (CXF-8109) Instructions for configuring client programmatically do not survive failover

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Comment Edited] (CXF-8109) Instructions for configuring client programmatically do not survive failover

Andriy Redko (Jira)

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

Andriy Redko edited comment on CXF-8109 at 9/10/19 1:57 AM:
------------------------------------------------------------

Hi [~neeme] ,

Thank you for pointing out the missing details, we would be able to update the documentation accordingly. Is the snippet below something you have mind, and it would have helped you in first place?
{code:java}
    HTTPConduitConfigurer httpConduitConfigurer = new HTTPConduitConfigurer() {
        public void configure(String name, String address, HTTPConduit c) {
            HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
           
            httpClientPolicy.setConnectionTimeout(36000);
            httpClientPolicy.setAllowChunking(false);
            httpClientPolicy.setReceiveTimeout(32000);
             
            c.setClient(httpClientPolicy);
        }
    }

    bus.setExtension(httpConduitConfigurer, HTTPConduitConfigurer.class);
{code}

Thank you.


was (Author: reta):
Hi [~neeme] ,

Thank you for pointing out the missing details, we would be able to update it accordingly. Is the snippet below something you have mind, and it would have helped you in first place?
{code:java}
    HTTPConduitConfigurer httpConduitConfigurer = new HTTPConduitConfigurer() {
        public void configure(String name, String address, HTTPConduit c) {
            HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
           
            httpClientPolicy.setConnectionTimeout(36000);
            httpClientPolicy.setAllowChunking(false);
            httpClientPolicy.setReceiveTimeout(32000);
             
            c.setClient(httpClientPolicy);
        }
    }

    bus.setExtension(httpConduitConfigurer, HTTPConduitConfigurer.class);
{code}

Thank you.

> Instructions for configuring client programmatically do not survive failover
> ----------------------------------------------------------------------------
>
>                 Key: CXF-8109
>                 URL: https://issues.apache.org/jira/browse/CXF-8109
>             Project: CXF
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 3.3.3
>            Reporter: Neeme Praks
>            Priority: Minor
>
> [http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html#ClientHTTPTransport(includingSSLsupport)-Usingjavacode] suggests to configure HttpConduit like this:
> {code:java}
> Client client = ClientProxy.getClient(greeter);
> HTTPConduit http = (HTTPConduit) client.getConduit();
>  
> HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
>  
> httpClientPolicy.setConnectionTimeout(36000);
> httpClientPolicy.setAllowChunking(false);
> httpClientPolicy.setReceiveTimeout(32000);
>  
> http.setClient(httpClientPolicy);
> {code}
> While this works initially, it fails as soon as a failover happens. During failover, existing {{HttpConduit}} is disposed and new one is created. The policy and other settings are not copied from old conduit to new one (we found out the hard way, in production).
> Instead, one should use get hold of {{Bus}} instance (we get it from Spring) and make use of {{HTTPConduitConfigurer}} extension point:
> {code:java}
> bus.setExtension(httpConduitConfigurer, HTTPConduitConfigurer.class);
> {code}
> We use {{JaxWsProxyFactoryBean}} for this (it has {{setBus()}} method), I'm not sure how to modify the sample in the documentation.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)