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