Forum Home » Fuse Distributions » Fuse Services Framework

Thread: configuring jetty maxIdleTime and adding connector

 
This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 7 - Last Post: May 25, 2012 3:01 PM Last Post By: watermelonjam
camel

Posts: 43
Registered: 02/02/12
configuring jetty maxIdleTime and adding connector
Posted: Feb 6, 2012 5:12 PM
 
  Click to reply to this thread Reply
I have problem with long running requests - they timeout.
They are serviced by default connector,
how can I change it's timeout?

I tried adding connector to etc/jetty.xml

<Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.nio.BlockingChannelConnector">
<Set name="host"><Property name="jetty.host" /></Set>
<Set name="maxIdleTime">800000</Set>
<Set name="Acceptors">2</Set>
<Set name="statsOn">false</Set>
<Set name="confidentialPort">8443</Set>
<Set name="lowResourcesMaxIdleTime">5000</Set>
</New>
</Arg>
</Call>

It was added to the default connector, but later my requests are serviced by the default connector with timeout 200.000 instead of by my connector.

How can I prevent default connector from being created or configure it's timeout?
(it seems to me that changing it's timeout is impossible, I also can't prevent it from being created and added)

Thanks.

Edited by: camel on Feb 6, 2012 5:14 PM

Edited by: camel on Feb 6, 2012 5:15 PM

Edited by: camel on Feb 6, 2012 5:16 PM

ffang

Posts: 1,320
Registered: 12/24/07
Re: configuring jetty maxIdleTime and adding connector
Posted: Feb 7, 2012 3:04 AM   in response to: camel in response to: camel
 
  Click to reply to this thread Reply
Hi,

Please tell us exact FUSE ESB version you're using, that would be very helpful.

And you actually can specify port number for the connector, something like
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//
DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">

<Configure class="org.mortbay.jetty.Server">

<Call name="addConnector">
<Arg>
<New class="org.mortbay.jetty.nio.SelectChannelConnector">
<Set name="host"><Property name="jetty.host" /></Set>
<Set name="port"><Property name="jetty.port" default="8181"/></Set>
<Set name="maxIdleTime">3000000</Set>
<Set name="Acceptors">2</Set>
<Set name="statsOn">false</Set>
<Set name="confidentialPort">8443</Set>
<Set name="lowResourcesConnections">20000</Set>
<Set name="lowResourcesMaxIdleTime">5000</Set>
</New>
</Arg>
</Call>
</Configure>

This can set maxIdleTime for jetty listening port 8181.

This jetty.xml configuration is applicable for http-osgi service and cxf http-osgi transport which is based on http-osgi service.

Freeman
camel

Posts: 43
Registered: 02/02/12
Re: configuring jetty maxIdleTime and adding connector
Posted: Feb 7, 2012 8:33 AM   in response to: ffang in response to: ffang
 
  Click to reply to this thread Reply
I use apache-servicemix-4.4.1-fuse-01-13

karaf@root> list | grep http
242 Active [ ] [ ] 50 Apache ServiceMix :: Bundles :: commons-httpclient (3.1.0.5)
karaf@root> list | grep cxf
186 Active Created [ ] 50 camel-cxf (2.8.0.fuse-01-13)
187 Active [ ] [ ] 50 camel-cxf-transport (2.8.0.fuse-01-13)
karaf@root> list | grep osgi
86 Active [ ] [ ] 60 spring-osgi-core (1.2.1)
87 Active [ ] [ ] 60 spring-osgi-io (1.2.1)
88 Active [ ] [ ] 60 spring-osgi-annotation (1.2.1)
89 Active [ ] [ ] 60 spring-osgi-extender (1.2.1)
karaf@root>
ffang

Posts: 1,320
Registered: 12/24/07
Re: configuring jetty maxIdleTime and adding connector
Posted: Feb 7, 2012 8:42 AM   in response to: camel in response to: camel
 
  Click to reply to this thread Reply
Hi,

What kind of transport you're using? Is it http-osgi transport?
Could you elaborate your project?

Freeman
camel

Posts: 43
Registered: 02/02/12
Re: configuring jetty maxIdleTime and adding connector
Posted: Feb 7, 2012 9:15 AM   in response to: ffang in response to: ffang
 
  Click to reply to this thread Reply
probably it is http transport, fragments of configuration are here: http://fusesource.com/forums/thread.jspa?threadID=3685&tstart=0

Thanks.
watermelonjam

Posts: 3
Registered: 05/24/12
Re: configuring jetty maxIdleTime and adding connector
Posted: May 24, 2012 6:30 PM   in response to: ffang in response to: ffang
 
  Click to reply to this thread Reply
Hi Freeman.

I'm encountering the same problem with a <jaxws:endpoint> using a similar version of FUSE ESB (4.4.1-fuse-03-06) with the http-osgi transport (address attr is "/Service", not a full URL). I've tried configuring the maxIdleTimeout in etc/jetty.xml and specifying the proper port (8181), but on startup, the message is:

org.ops4j.pax.web.pax-web-jetty - 1.0.3 | Connection on port 8181 cannot be open. Reason: Address already in use

I suspect this config is conflicting with pax-web-jetty startup. I did some digging, and found this outdated documentation on how to use a fragment bundle to configure pax-web-jetty. Is this the correct approach for http-osgi transport on FUSE ESB 4.4.1 and, if so, is there any place I can find the defaults that are already in use for that bundle (e.g. port 8181)? I've looked in the pax-web-jetty bundle, but there's no config properties file in there.

Thanks.
ffang

Posts: 1,320
Registered: 12/24/07
Re: configuring jetty maxIdleTime and adding connector
Posted: May 25, 2012 12:56 AM   in response to: watermelonjam in response to: watermelonjam
 
  Click to reply to this thread Reply
Hi,

It should be maxIdleTime but not maxIdleTimeOut.

So what you should have is
<Set name="port"><Property name="jetty.port" default="8181"/></Set>
<Set name="maxIdleTime">any_time_you_want_in_ms</Set>

Also the message
Connection on port 8181 cannot be open. Reason: Address already in use
is harmless, your maxIdleTime configuration for default SelectChannelConnector already get picked up on port 8181.

And the fragment bundle thing you found is for old pax-web before 0.7.x IIRC, it's not applicable now.

Freeman
watermelonjam

Posts: 3
Registered: 05/24/12
Re: configuring jetty maxIdleTime and adding connector
Posted: May 25, 2012 3:01 PM   in response to: ffang in response to: ffang
 
  Click to reply to this thread Reply
Thanks Freeman, that works well.

Regards,

D.