camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ravi116 <ravi.varan...@countrywide.com>
Subject Re: Example of request reply
Date Wed, 03 Oct 2007 14:55:36 GMT

Hi,
Is the web services example available now as part of snapshot download ? 
I am new to camel and cxf. My simple use case is to publish a message to a
active mq topic and have it route the message to a cxf web service. Here is
the sample code below -

private static String serviceEndpointURI = "cxf://" + SERVICE_ADDRESS + "?"
+ SERVICE_CLASS + "&dataFormat=POJO";
ConnectionFactory connectionFactory = new
ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
        context.addRoutes(new RouteBuilder() {

            public void configure() throws Exception {
                from("test-jms:queue:test.queue").to(serviceEndpointURI);
           }
        });
CamelTemplate template = new CamelTemplate(context);
context.start();
 for (int i = 0; i < 10; i++) {
            template.sendBody("test-jms:queue:test.queue", "Test Message: "
+ i);
 }
Thread.sleep(1000);
context.stop();

Will the code above work ? 
Ravi





willem.jiang wrote:
> 
> Hi ,
> I am working on camel-cxf component which will help you to do some 
> router work between 2 Web Services. My big patch just been applied in 
> the trunk, you can take a look at the unit test of camel-cxf component.
> https://svn.apache.org/repos/asf/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfRouterTest.java
> I will add a Web Service router example some time this week  :)
> 
> Willem.
> xtof wrote:
>> Hello,
>>
>> I'm quite new to Camel, and I'm trying to understand how implementing a
>> gateway between 2 Web Services. It requires to implement a request-reply
>> mechanism but I cannot find any example.
>> Could you help?
>>
>> Thank.
>> Christophe
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Example-of-request-reply-tf4473066s22882.html#a13020650
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message