You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by sha_cxf <Sh...@morganstanley.com> on 2008/06/05 14:17:42 UTC

Simple XML router using CXF

I want to write a xml message router using cxf but I am not very clear about
the internal working of cxf.

A sample scenario that I want to implement is something like this -

There are two services - ADD (hosted on host1:9000 and host1:9001) &
SUBTRACT (hosted on host2:9000 and host2:9001).

The router listening on host3:7777 would decide the target service for the
xml message (not bound to any schema) based on the xml message (using
xquery).

After deciding the target service it would decide on the specific
connection(host*:9000 or host*:9001) in say a roundrobin fashion.Then fire
that message to that service.

Receive a response from the service and pass it to the client.

How can it be done using CXF?

-- 
View this message in context: http://www.nabble.com/Simple-XML-router-using-CXF-tp17668517p17668517.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Simple XML router using CXF

Posted by Willem Jiang <wi...@gmail.com>.
It is not easy to implement your requirement in CXF by hacking the 
interceptors.
Here is an example which support routing the message between the 
endpoints in CXF by xml message's version[1].
It may be helpful to you case.

[1] 
https://svn.apache.org/repos/asf/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/versioning

Willem
sha_cxf wrote:
> Thanks Willem.
>
> But is there any way to implement this in CXF. I have to prepare a prototype
> in CXF alongwith one in CAMEL.
>
> To be precise, any pointers on how to invoke a method on a service when the
> incoming request format is not bound to any schema/format or how can I make
> CXF relate all xml messages (with different schemas) to one particular
> method in the service (say handleMessage).      
>
>
>
>   


Re: Simple XML router using CXF

Posted by Daniel Kulp <dk...@apache.org>.
The only way to do this is to use a jax-ws Provider based endpoint.    
Making it Provider<SOAPMessage> would give you the whole soap message  
that you could then forward onto something else or mangle it or  
whatever.

Dan



On Jun 5, 2008, at 9:56 AM, sha_cxf wrote:

>
> Thanks Willem.
>
> But is there any way to implement this in CXF. I have to prepare a  
> prototype
> in CXF alongwith one in CAMEL.
>
> To be precise, any pointers on how to invoke a method on a service  
> when the
> incoming request format is not bound to any schema/format or how can  
> I make
> CXF relate all xml messages (with different schemas) to one particular
> method in the service (say handleMessage).
>
>
>
> -- 
> View this message in context: http://www.nabble.com/Simple-XML-router-using-CXF-tp17668517p17670450.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>

---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog





Re: Simple XML router using CXF

Posted by sha_cxf <Sh...@morganstanley.com>.
Thanks Willem.

But is there any way to implement this in CXF. I have to prepare a prototype
in CXF alongwith one in CAMEL.

To be precise, any pointers on how to invoke a method on a service when the
incoming request format is not bound to any schema/format or how can I make
CXF relate all xml messages (with different schemas) to one particular
method in the service (say handleMessage).      



-- 
View this message in context: http://www.nabble.com/Simple-XML-router-using-CXF-tp17668517p17670450.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Simple XML router using CXF

Posted by Willem Jiang <wi...@gmail.com>.
Hi

It is easy to implement the such a content base routing by using Camel[1].
And it also provide a way to implement the load balance[2] .

BTW, You could also leverage the Camel's mediation by using the 
CamelTransport[3] in CXF.

[1]http://cwiki.apache.org/CAMEL/
[2]http://cwiki.apache.org/CAMEL/load-balancer.html
[3]http://cwiki.apache.org/CAMEL/camel-transport-for-cxf.html

Willem

sha_cxf wrote:
> I want to write a xml message router using cxf but I am not very clear about
> the internal working of cxf.
>
> A sample scenario that I want to implement is something like this -
>
> There are two services - ADD (hosted on host1:9000 and host1:9001) &
> SUBTRACT (hosted on host2:9000 and host2:9001).
>
> The router listening on host3:7777 would decide the target service for the
> xml message (not bound to any schema) based on the xml message (using
> xquery).
>
> After deciding the target service it would decide on the specific
> connection(host*:9000 or host*:9001) in say a roundrobin fashion.Then fire
> that message to that service.
>
> Receive a response from the service and pass it to the client.
>
> How can it be done using CXF?
>
>   


Re: Simple XML router using CXF

Posted by Glen Mazza <gl...@verizon.net>.
These requirements look like you would benefit from an ESB like Mule or
ServiceMix.  For the proprietary BEA AquaLogic Service Bus, for example,
the tutorials here[1] are very similar to your requirements.

Glen

[1] http://edocs.bea.com/alsb/docs30/tutorial/index.html 

2008-06-05 sha_cxf wrote:
> I want to write a xml message router using cxf but I am not very clear about
> the internal working of cxf.
> 
> A sample scenario that I want to implement is something like this -
> 
> There are two services - ADD (hosted on host1:9000 and host1:9001) &
> SUBTRACT (hosted on host2:9000 and host2:9001).
> 
> The router listening on host3:7777 would decide the target service for the
> xml message (not bound to any schema) based on the xml message (using
> xquery).
> 
> After deciding the target service it would decide on the specific
> connection(host*:9000 or host*:9001) in say a roundrobin fashion.Then fire
> that message to that service.
> 
> Receive a response from the service and pass it to the client.
> 
> How can it be done using CXF?
>