|
Page Created :
CAMEL :
ProducerTemplate
ProducerTemplate has been created by James Strachan (Oct 01, 2008). Content:ProducerTemplateThe ProducerTemplate interface allows you to send message exchanges to endpoints in a variety of different ways to make it easy to work with Camel Endpoint instances from Java code. It can be configured with a default endpoint if you just want to send lots of messages to the same endpoint; or you can specify an Endpoint or URI The sendBody() method allows you to send any object to an endpoint easily. ProducerTemplate template; // send to default endpoint template.sendBody("<hello>world!</hello>"); // send to a specific queue template.sendBody("activemq:MyQueue", "<hello>world!</hello>"); // send with a body and header template.sendBodyAndHeader("activemq:MyQueue", "CustomerRating", "Gold", "<hello>world!</hello>"); You can also supply an Exchange or a Processor to customize the exchange |
Powered by
Atlassian Confluence
(Version: 2.2.9 Build:#527 Sep 07, 2006)
-
Bug/feature request
Unsubscribe or edit your notifications preferences
Unsubscribe or edit your notifications preferences
