camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <>
Subject Re: SessionSupport for two jetty Endpoint in Osgi.
Date Thu, 28 Apr 2011 09:28:11 GMT
On 4/28/11 10:53 AM, Gabriel D'Halluin wrote:
> Thank you for your answers and explanations.
> There is no particular reason why I would like to share the port.
> Basically they are two parts of the same applications, and I thought
> the less open port we got the better it is.
> For the moment I have just added the session support on both bundle as
> Claus suggested. I haven't really take a look at OSGi web container
> and camel-servlet yet, and I'll definitely check it more closely.
> There is still something I don't understand thought, about the fact it
> works after a refresh of bundle A:
> Bundle A : Session support  Bundle B : No session support
> Start B
> ->  Server created with no session support
> Start A
> ->  Crash, session support is not enabled in the server, it doesn't
> create the endpoints, and i suppose the current server is unchanged.
> refresh A or stop A start A
> ->  Doesn't crash, yet the current server should be still the one
> created in the first place, with no session enabled, isn't it? Does
> the JettyComponent shutdown the server, even if it has been created
> and is still in use by another bundle?

Camel-Jetty component has a static map which hold the reference of the 
jetty server and connector. In this way we can let the different jetty 
consumer share the port across the camel context.

When you refresh the bundle A, the Jetty component will close the server 
as the server connector reference is 0, because the bundle A and bundle 
B share the same port.

So, when you start the bundle A, you will not get that 
IllegalStateException again, but I don't think the bundle B 
JettyConsumer is still touched to the Jetty server.

> Regards,
> Gabriel.

Blog: (English)
Twitter: willemjiang

Connect at CamelOne May 24-26
The Open Source Integration Conference

View raw message