Author: rajdavies
Date: Tue May 1 10:43:49 2007
New Revision: 534168
URL: http://svn.apache.org/viewvc?view=rev&rev=534168
Log:
added sendBody() helper method
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelClient.java
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelClient.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelClient.java?view=diff&rev=534168&r1=534167&r2=534168
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelClient.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelClient.java
Tue May 1 10:43:49 2007
@@ -84,6 +84,22 @@
public E send(Endpoint<E> endpoint, Processor processor) {
return producerCache.send(endpoint, processor);
}
+
+ /**
+ * Send the body to an endpoint
+ * @param endpointUri
+ * @param body = the payload
+ * @return the result
+ */
+ public Object sendBody (String endpointUri,final Object body) {
+ E result = send(endpointUri, new Processor() {
+ public void process(Exchange exchange) {
+ Message in = exchange.getIn();
+ in.setBody(body);
+ }
+ });
+ return result != null ? result.getOut().getBody() : null;
+ }
public Producer<E> getProducer(Endpoint<E> endpoint) {
return producerCache.getProducer(endpoint);