Hi Willem,
the entry point to my route should be a listener on a queue. I imaginged
to achieve this either by using the jms component or the cxf component.
The client will calling my route will set the reply-to property of the
jms message. So I guess this property will have to be forwarded through
the whole route so when the exchange arrives back at the start the
component will know where to send the reply.
Does the jms or cxf component support the reply-to property and will it
be forwarded through the whole route?
I want to publish my services with local transport as they should not be
reachable directly from the outside. The only access point should be the
camel route. This will of course be reachable from the outside.
So I guess using the local tranport for the cxf endpoints should be ok
as far as I know.
Best regards,
Christian
Willem Jiang schrieb:
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.
Willem
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