camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem jiang <willem.ji...@gmail.com>
Subject Re: Releasing CXF-endpoint port on context shutdown
Date Wed, 28 Nov 2012 08:23:28 GMT
We don't shutdown the Jetty engine when the bundle is stop, as we are using CXF bus to manage
the life cycle of the Jetty engine.
If you are using Spring or Blueprint, they can take care of the bus shutdown issue.

But if you create the CamelContext by yourself, you need to manage the bus which camel-cxf
component is used by yourself. 

-- 
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang 
Weibo: willemjiang





On Wednesday, November 28, 2012 at 3:31 PM, Urppa wrote:

> I have a programmatic CamelContext and route configuration inside an
> OSGi-bundle that I deploy on Karaf 2.3.0. There are no Blueprint/Spring
> XML-files, this is all done programmatically because I need some
> programmatic stuff before the route setup.
> 
> The route has a CXF-endpoint offering a SOAP-webservice on port 9000. The
> configuration is activated on my Activators start-method and works just
> fine, i.e. I can get the WSDL and call the WS-methods once the route is
> active after I drop the bundle into the Karafs deploy-folder.
> 
> When I remove the bundle from the Karafs deploy-folder, the bundle is
> stopped properly and on the activator.stop-method I have the
> camelContext-shutdown-call. And looking at the log output, the camelContext
> is shutdown and the route is removed gracefully. Also on port 9000 I start
> getting error from Jetty and can't access the WSDL-anymore, hence my route
> is gone (but note that Jetty is still running on port 9000...).
> 
> So, now port 9000 is still reserved on the Karaf-java process. And if I
> restart the bundle, the same route gets added again and I get some second
> port 9000 (looking at netstat -a) that has connection to my computer on some
> 50xxx port. And if I remove the bundle and then deploy it again, AGAIN the
> port 9000 gets some connection to some 5xxxx port.
> 
> How to gracefully release port 9000 when the CamelContext and route is
> shutdown? I looked at the CxfEndpoint-class, doStop method and it only has a
> comment // noop... Is this the issue, or am I looking at wrong place at the
> code wrt shutdown of the CXF-endpoint?
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Releasing-CXF-endpoint-port-on-context-shutdown-tp5723329.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).




Mime
View raw message