You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Knut-Håvard Aksnes <kh...@gmail.com> on 2013/10/08 17:11:10 UTC
Timeouts in CXFRS
I am using the CXFRS component as producer against a web service.
Some of the requests are fairly heavy to process on the server side, this
unfortunately leads to client failure due to timeouts. What I want is to be
able to add a timeout argument to the invocation, but no such argument is
present according to the documentation in http://camel.apache.org/cxfrs.html
Does there exist a (preferably documented) way of setting this timeout?
--
View this message in context: http://camel.465427.n5.nabble.com/Timeouts-in-CXFRS-tp5741142.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Timeouts in CXFRS
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
I've done a quick test with running a CXF JAX-RS client with CXF Async
HttpConduit outside of Camel and can confirm that the receive timeout
value is correctly observed,
I wonder if this http-conf configuration even visible to the client, I
suspect may be the route definition should be done inside the Spring
context too ?
Can someone please share an example of the route where CXF WS or RS
client depends on CXF HttpConduit Receive timeout property ?
Cheers, Sergey
On 12/10/13 14:31, Nils Andermo wrote:
> I have read the thread you suggest carefully, and still cannot get the
> timeout settings for the cxfrs client to be acknowledged. I am new to Camel,
> so I might very well be missing something obvious :)
>
> This is what I add to my spring config file:
> <beans xmlns:http-conf= "...
> http://cxf.apache.org/transports/http/configuration"
> xsi:schemaLocation="... http://cxf.apache.org/transports/http/configuration
> http://cxf.apache.org/schemas/configuration/http-conf.xsd ">
>
> <http-conf:conduit name="*.http-conduit">
> <http-conf:client AsyncExecuteTimeout="600000" ReceiveTimeout="600000"/>
> </http-conf:conduit>
>
> <camelContext trace="true" id="CamelContext"
> xmlns="http://camel.apache.org/schema/spring">
> <camel:routeBuilder ref="MyRouteBuilder" />
> </camelContext>
>
> And here is my RouteBuilder:
> @Singleton
> @Component
> @Named("MyRouteBuilder")
> public class MyRouteBuilder extends RouteBuilder {
>
> @Override
> public void configure() {
>
> // Code for marshaling, which I don't think is relevant to the question...
>
> from(
>
> "activemq:requestBatchKeys?errorHandlerLoggingLevel=ERROR&errorHandlerLogStackTrace=false")
> .routeId("amq_requestBatchKeys")
> .shutdownRoute(ShutdownRoute.Defer).marshal(batchDataFormat)
> .convertBodyTo(String.class, "UTF-8")
> .setHeader("CamelHttpMethod", simple("POST"))
> .setHeader("Content-Type", simple("application/json"))
> .to("cxfrs://http://${keysRestServer}/licensekey/batch");
>
> }
> }
>
> It works for some requests, but for large requests I get
> org.apache.cxf.interceptor.Fault: Could not send Message.
> and further down the stack trace it says
> Caused by: java.net.SocketTimeoutException: SocketTimeoutException invoking
> http://xx.xx.x.xxx:8080/keys/rest/licensekey/batch: Read timed out
>
> How do you hook up the HTTPConduit configuration to the Camel CXFRS
> component?
>
>
> Charles Moulliard-2 wrote
>> HTTPConduit of CXF must be configured in this case :
>> http://cxf.547215.n5.nabble.com/What-is-the-proper-way-of-setting-client-Timeout-per-Webservice-method-td5727106.html
>>
>> --
>> Charles Moulliard
>> Apache Committer / Architect @RedHat
>> Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Timeouts-in-CXFRS-tp5741142p5741438.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Re: Timeouts in CXFRS
Posted by Nils Andermo <ni...@jeppesen.com>.
Yes, the timeout configuration works when I add the endpoint configuration to
the config file
<cxf:rsClient id="rsKeysBatch"
address="http://${keysRestServer}/licensekey/batch" />
and change my route to
.to("cxfrs://bean://rsKeysBatch")
--
View this message in context: http://camel.465427.n5.nabble.com/Timeouts-in-CXFRS-tp5741142p5742415.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Timeouts in CXFRS
Posted by Raul Kripalani <ra...@evosent.com>.
It looks like you're using the CXF endpoint URI configuration style. Have
you tried switching to the bean configuration style? I use the latter type
of configuration frequently, an it always works.
Regards,
Raúl.
On 12 Oct 2013 15:32, "Nils Andermo" <ni...@jeppesen.com> wrote:
> I have read the thread you suggest carefully, and still cannot get the
> timeout settings for the cxfrs client to be acknowledged. I am new to
> Camel,
> so I might very well be missing something obvious :)
>
> This is what I add to my spring config file:
> <beans xmlns:http-conf= "...
> http://cxf.apache.org/transports/http/configuration"
> xsi:schemaLocation="...
> http://cxf.apache.org/transports/http/configuration
> http://cxf.apache.org/schemas/configuration/http-conf.xsd ">
>
> <http-conf:conduit name="*.http-conduit">
> <http-conf:client AsyncExecuteTimeout="600000"
> ReceiveTimeout="600000"/>
> </http-conf:conduit>
>
> <camelContext trace="true" id="CamelContext"
> xmlns="http://camel.apache.org/schema/spring">
> <camel:routeBuilder ref="MyRouteBuilder" />
> </camelContext>
>
> And here is my RouteBuilder:
> @Singleton
> @Component
> @Named("MyRouteBuilder")
> public class MyRouteBuilder extends RouteBuilder {
>
> @Override
> public void configure() {
>
> // Code for marshaling, which I don't think is relevant to the question...
>
> from(
>
>
> "activemq:requestBatchKeys?errorHandlerLoggingLevel=ERROR&errorHandlerLogStackTrace=false")
> .routeId("amq_requestBatchKeys")
>
> .shutdownRoute(ShutdownRoute.Defer).marshal(batchDataFormat)
> .convertBodyTo(String.class, "UTF-8")
> .setHeader("CamelHttpMethod", simple("POST"))
> .setHeader("Content-Type", simple("application/json"))
> .to("cxfrs://http://${keysRestServer}/licensekey/batch");
>
> }
> }
>
> It works for some requests, but for large requests I get
> org.apache.cxf.interceptor.Fault: Could not send Message.
> and further down the stack trace it says
> Caused by: java.net.SocketTimeoutException: SocketTimeoutException invoking
> http://xx.xx.x.xxx:8080/keys/rest/licensekey/batch: Read timed out
>
> How do you hook up the HTTPConduit configuration to the Camel CXFRS
> component?
>
>
> Charles Moulliard-2 wrote
> > HTTPConduit of CXF must be configured in this case :
> >
> http://cxf.547215.n5.nabble.com/What-is-the-proper-way-of-setting-client-Timeout-per-Webservice-method-td5727106.html
> >
> > --
> > Charles Moulliard
> > Apache Committer / Architect @RedHat
> > Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Timeouts-in-CXFRS-tp5741142p5741438.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Re: Timeouts in CXFRS
Posted by Nils Andermo <ni...@jeppesen.com>.
I have read the thread you suggest carefully, and still cannot get the
timeout settings for the cxfrs client to be acknowledged. I am new to Camel,
so I might very well be missing something obvious :)
This is what I add to my spring config file:
<beans xmlns:http-conf= "...
http://cxf.apache.org/transports/http/configuration"
xsi:schemaLocation="... http://cxf.apache.org/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd ">
<http-conf:conduit name="*.http-conduit">
<http-conf:client AsyncExecuteTimeout="600000" ReceiveTimeout="600000"/>
</http-conf:conduit>
<camelContext trace="true" id="CamelContext"
xmlns="http://camel.apache.org/schema/spring">
<camel:routeBuilder ref="MyRouteBuilder" />
</camelContext>
And here is my RouteBuilder:
@Singleton
@Component
@Named("MyRouteBuilder")
public class MyRouteBuilder extends RouteBuilder {
@Override
public void configure() {
// Code for marshaling, which I don't think is relevant to the question...
from(
"activemq:requestBatchKeys?errorHandlerLoggingLevel=ERROR&errorHandlerLogStackTrace=false")
.routeId("amq_requestBatchKeys")
.shutdownRoute(ShutdownRoute.Defer).marshal(batchDataFormat)
.convertBodyTo(String.class, "UTF-8")
.setHeader("CamelHttpMethod", simple("POST"))
.setHeader("Content-Type", simple("application/json"))
.to("cxfrs://http://${keysRestServer}/licensekey/batch");
}
}
It works for some requests, but for large requests I get
org.apache.cxf.interceptor.Fault: Could not send Message.
and further down the stack trace it says
Caused by: java.net.SocketTimeoutException: SocketTimeoutException invoking
http://xx.xx.x.xxx:8080/keys/rest/licensekey/batch: Read timed out
How do you hook up the HTTPConduit configuration to the Camel CXFRS
component?
Charles Moulliard-2 wrote
> HTTPConduit of CXF must be configured in this case :
> http://cxf.547215.n5.nabble.com/What-is-the-proper-way-of-setting-client-Timeout-per-Webservice-method-td5727106.html
>
> --
> Charles Moulliard
> Apache Committer / Architect @RedHat
> Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
--
View this message in context: http://camel.465427.n5.nabble.com/Timeouts-in-CXFRS-tp5741142p5741438.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Timeouts in CXFRS
Posted by Charles Moulliard <ch...@gmail.com>.
HTTPConduit of CXF must be configured in this case :
http://cxf.547215.n5.nabble.com/What-is-the-proper-way-of-setting-client-Timeout-per-Webservice-method-td5727106.html
On Tue, Oct 8, 2013 at 5:11 PM, Knut-Håvard Aksnes <kh...@gmail.com>wrote:
> I am using the CXFRS component as producer against a web service.
> Some of the requests are fairly heavy to process on the server side, this
> unfortunately leads to client failure due to timeouts. What I want is to be
> able to add a timeout argument to the invocation, but no such argument is
> present according to the documentation in
> http://camel.apache.org/cxfrs.html
> Does there exist a (preferably documented) way of setting this timeout?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Timeouts-in-CXFRS-tp5741142.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog : http://cmoulliard.github.io