camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <>
Subject Re: Putting several services on the same queue
Date Mon, 16 Jun 2008 00:26:31 GMT
Hi Christian,

I think camel could help you to do the most content base routing work.
Here are some thing I should point out.
1. You need to specify the reply destination of the jms endpoint or you 
can't get the response message from the cxf endpoint.
2. If you want to publish the cxf service through the local transport , 
your service can only be accessible for the client in the same JVM.

Since I don't know much about osgi, but for the thread of cxf client, it 
dependent on the calling thread, if the jms consumer in the camel 
context is run by a single thread, it's the single thread.


Christian Schneider wrote:
> Hi,
> I am building webservice adapters for a legacy system. The system can 
> be accessed with a java api but is not multi threaded. So my problem is
> that I want to offer several services in one process and still make 
> sure only one service is called at a time. To make this scalable I 
> will then run this process several
> times on the same and different machines.
> I also would like to make management of this system as easy as 
> possible. Ideally I would like this process to be a kind of 
> application server where I can install and deinstall services while it 
> is running.
> Still they should listen on one queue and work single threaded. I 
> imagined doing this with an osgi server. The problem is that probably 
> then each bundle will have it´s own cxf and they are not single 
> threaded anymore.
> I have already asked this question on the cxf list and got an idea on 
> how a solution could look.
> The idea is to publish the services with a local endpoint only. I 
> could the create a route the listens on jms in camel. This route would 
> then figure out what local endpoint the request should go to and 
> invokes it. Then it forwards the reply back to jms. It could find the 
> correct endpoint either by analysing the namespace of the xml or by 
> using ws addressing. The only thing is I do not know exactly how to 
> implement this.
> I think I will have to use the jms component and the cxf component for 
> the ends of the route. But how do I do the routing? I could imagine a 
> content based router that figures out what cxf endpoint to forward to 
> via xpath.
> from("jms:myqueue").choice()
> .when(xpath("//namespace=service1namespace")).to("cxf:mybeanname:myEndpointName") 
> .when(xpath("//namespace=service2namespace")).to("cxf:mybeanname2:myEndpointName2") 
> .otherwise().to("jms:deadletterqueue")
> The xpath expression is not correct. I will have to look up how to do 
> this. Does the rest sound ok to you?
> Will a configuration like this work in osgi where each service is a 
> separate bundle?
> Best regards
> Christian

View raw message