org.apache.camel
Interface ProducerTemplate

All Superinterfaces:
Service
All Known Implementing Classes:
DefaultProducerTemplate

public interface ProducerTemplate
extends Service

Template (named like Spring's TransactionTemplate & JmsTemplate et al) for working with Camel and sending Message instances in an Exchange to an Endpoint.

Important: Read the javadoc of each method carefully to ensure the behavior of the method is understood. Some methods is for InOnly, others for InOut MEP. And some methods throws CamelExecutionException while others stores any thrown exception on the returned Exchange.

All the methods which sends a message may throw FailedToCreateProducerException in case the Producer could not be created. Or a NoSuchEndpointException if the endpoint could not be resolved. There may be other related exceptions being thrown which occurs before the Producer has started sending the message.

All the sendBody or requestBody methods will return the content according to this strategy:


Before using the template it must be started. And when you are done using the template, make sure to Service.stop() the template.

Important note on usage: See this FAQ entry before using.

Version:

Method Summary
 Future<Exchange> asyncCallback(Endpoint endpoint, Exchange exchange, Synchronization onCompletion)
          Sends an asynchronous exchange to the given endpoint.
 Future<Exchange> asyncCallback(Endpoint endpoint, Processor processor, Synchronization onCompletion)
          Sends an asynchronous exchange to the given endpoint using a supplied processor.
 Future<Exchange> asyncCallback(String endpointUri, Exchange exchange, Synchronization onCompletion)
          Sends an asynchronous exchange to the given endpoint.
 Future<Exchange> asyncCallback(String endpointUri, Processor processor, Synchronization onCompletion)
          Sends an asynchronous exchange to the given endpoint using a supplied processor.
 Future<Object> asyncCallbackRequestBody(Endpoint endpoint, Object body, Synchronization onCompletion)
          Sends an asynchronous body to the given endpoint.
 Future<Object> asyncCallbackRequestBody(String endpointUri, Object body, Synchronization onCompletion)
          Sends an asynchronous body to the given endpoint.
 Future<Object> asyncCallbackSendBody(Endpoint endpoint, Object body, Synchronization onCompletion)
          Sends an asynchronous body to the given endpoint.
 Future<Object> asyncCallbackSendBody(String endpointUri, Object body, Synchronization onCompletion)
          Sends an asynchronous body to the given endpoint.
 Future<Object> asyncRequestBody(Endpoint endpoint, Object body)
          Sends an asynchronous body to the given endpoint.
<T> Future<T>
asyncRequestBody(Endpoint endpoint, Object body, Class<T> type)
          Sends an asynchronous body to the given endpoint.
 Future<Object> asyncRequestBody(String endpointUri, Object body)
          Sends an asynchronous body to the given endpoint.
<T> Future<T>
asyncRequestBody(String endpointUri, Object body, Class<T> type)
          Sends an asynchronous body to the given endpoint.
 Future<Object> asyncRequestBodyAndHeader(Endpoint endpoint, Object body, String header, Object headerValue)
          Sends an asynchronous body to the given endpoint.
<T> Future<T>
asyncRequestBodyAndHeader(Endpoint endpoint, Object body, String header, Object headerValue, Class<T> type)
          Sends an asynchronous body to the given endpoint.
 Future<Object> asyncRequestBodyAndHeader(String endpointUri, Object body, String header, Object headerValue)
          Sends an asynchronous body to the given endpoint.
<T> Future<T>
asyncRequestBodyAndHeader(String endpointUri, Object body, String header, Object headerValue, Class<T> type)
          Sends an asynchronous body to the given endpoint.
 Future<Object> asyncRequestBodyAndHeaders(Endpoint endpoint, Object body, Map<String,Object> headers)
          Sends an asynchronous body to the given endpoint.
<T> Future<T>
asyncRequestBodyAndHeaders(Endpoint endpoint, Object body, Map<String,Object> headers, Class<T> type)
          Sends an asynchronous body to the given endpoint.
 Future<Object> asyncRequestBodyAndHeaders(String endpointUri, Object body, Map<String,Object> headers)
          Sends an asynchronous body to the given endpoint.
<T> Future<T>
asyncRequestBodyAndHeaders(String endpointUri, Object body, Map<String,Object> headers, Class<T> type)
          Sends an asynchronous body to the given endpoint.
 Future<Exchange> asyncSend(Endpoint endpoint, Exchange exchange)
          Sends an asynchronous exchange to the given endpoint.
 Future<Exchange> asyncSend(Endpoint endpoint, Processor processor)
          Sends an asynchronous exchange to the given endpoint.
 Future<Exchange> asyncSend(String endpointUri, Exchange exchange)
          Sends an asynchronous exchange to the given endpoint.
 Future<Exchange> asyncSend(String endpointUri, Processor processor)
          Sends an asynchronous exchange to the given endpoint.
 Future<Object> asyncSendBody(Endpoint endpoint, Object body)
          Sends an asynchronous body to the given endpoint.
 Future<Object> asyncSendBody(String endpointUri, Object body)
          Sends an asynchronous body to the given endpoint.
<T> T
extractFutureBody(Future<Object> future, Class<T> type)
          Gets the response body from the future handle, will wait until the response is ready.
<T> T
extractFutureBody(Future<Object> future, long timeout, TimeUnit unit, Class<T> type)
          Gets the response body from the future handle, will wait at most the given time for the response to be ready.
 int getCurrentCacheSize()
          Gets an approximated size of the current cached resources in the backing cache pools.
 Endpoint getDefaultEndpoint()
          Get the default endpoint to use if none is specified
 int getMaximumCacheSize()
          Gets the maximum cache size used in the backing cache pools.
 Exchange request(Endpoint endpoint, Processor processor)
          Sends an exchange to an endpoint using a supplied processor Uses an ExchangePattern.InOut message exchange pattern.
 Exchange request(String endpointUri, Processor processor)
          Sends an exchange to an endpoint using a supplied processor Uses an ExchangePattern.InOut message exchange pattern.
 Object requestBody(Endpoint endpoint, Object body)
          Send the body to an endpoint returning any result output body.
<T> T
requestBody(Endpoint endpoint, Object body, Class<T> type)
          Send the body to an endpoint returning any result output body.
 Object requestBody(Object body)
          Sends the body to the default endpoint and returns the result content Uses an ExchangePattern.InOut message exchange pattern.
<T> T
requestBody(Object body, Class<T> type)
          Sends the body to the default endpoint and returns the result content Uses an ExchangePattern.InOut message exchange pattern.
 Object requestBody(String endpointUri, Object body)
          Send the body to an endpoint returning any result output body.
<T> T
requestBody(String endpointUri, Object body, Class<T> type)
          Send the body to an endpoint returning any result output body.
 Object requestBodyAndHeader(Endpoint endpoint, Object body, String header, Object headerValue)
          Send the body to an endpoint returning any result output body.
<T> T
requestBodyAndHeader(Endpoint endpoint, Object body, String header, Object headerValue, Class<T> type)
          Send the body to an endpoint returning any result output body.
 Object requestBodyAndHeader(Object body, String header, Object headerValue)
          Sends the body to the default endpoint and returns the result content Uses an ExchangePattern.InOut message exchange pattern.
 Object requestBodyAndHeader(String endpointUri, Object body, String header, Object headerValue)
          Send the body to an endpoint returning any result output body.
<T> T
requestBodyAndHeader(String endpointUri, Object body, String header, Object headerValue, Class<T> type)
          Send the body to an endpoint returning any result output body.
 Object requestBodyAndHeaders(Endpoint endpoint, Object body, Map<String,Object> headers)
          Sends the body to an endpoint with the specified headers and header values.
<T> T
requestBodyAndHeaders(Endpoint endpoint, Object body, Map<String,Object> headers, Class<T> type)
          Sends the body to an endpoint with the specified headers and header values.
 Object requestBodyAndHeaders(Object body, Map<String,Object> headers)
          Sends the body to the default endpoint and returns the result content Uses an ExchangePattern.InOut message exchange pattern.
 Object requestBodyAndHeaders(String endpointUri, Object body, Map<String,Object> headers)
          Sends the body to an endpoint with the specified headers and header values.
<T> T
requestBodyAndHeaders(String endpointUri, Object body, Map<String,Object> headers, Class<T> type)
          Sends the body to an endpoint with the specified headers and header values.
 Exchange send(Endpoint endpoint, Exchange exchange)
          Sends the exchange to the given endpoint

Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException().

 Exchange send(Endpoint endpoint, ExchangePattern pattern, Processor processor)
          Sends an exchange to an endpoint using a supplied processor

Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException().

 Exchange send(Endpoint endpoint, Processor processor)
          Sends an exchange to an endpoint using a supplied processor

Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException().

 Exchange send(Exchange exchange)
          Sends the exchange to the default endpoint

Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException().
 Exchange send(Processor processor)
          Sends an exchange to the default endpoint using a supplied processor

Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException().
 Exchange send(String endpointUri, Exchange exchange)
          Sends the exchange to the given endpoint

Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException().

 Exchange send(String endpointUri, ExchangePattern pattern, Processor processor)
          Sends an exchange to an endpoint using a supplied processor

Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException().

 Exchange send(String endpointUri, Processor processor)
          Sends an exchange to an endpoint using a supplied processor

Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException().

 Object sendBody(Endpoint endpoint, ExchangePattern pattern, Object body)
          Send the body to an endpoint with the given ExchangePattern returning any result output body

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

 void sendBody(Endpoint endpoint, Object body)
          Send the body to an endpoint

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

 void sendBody(Object body)
          Sends the body to the default endpoint

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

 Object sendBody(String endpointUri, ExchangePattern pattern, Object body)
          Send the body to an endpoint returning any result output body

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

 void sendBody(String endpointUri, Object body)
          Send the body to an endpoint

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

 Object sendBodyAndHeader(Endpoint endpoint, ExchangePattern pattern, Object body, String header, Object headerValue)
          Sends the body to an endpoint with a specified header and header value

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

 void sendBodyAndHeader(Endpoint endpoint, Object body, String header, Object headerValue)
          Sends the body to an endpoint with a specified header and header value

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

 void sendBodyAndHeader(Object body, String header, Object headerValue)
          Sends the body to the default endpoint with a specified header and header value

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

 Object sendBodyAndHeader(String endpoint, ExchangePattern pattern, Object body, String header, Object headerValue)
          Sends the body to an endpoint with a specified header and header value

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

 void sendBodyAndHeader(String endpointUri, Object body, String header, Object headerValue)
          Sends the body to an endpoint with a specified header and header value

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

 Object sendBodyAndHeaders(Endpoint endpoint, ExchangePattern pattern, Object body, Map<String,Object> headers)
          Sends the body to an endpoint with the specified headers and header values

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

 void sendBodyAndHeaders(Endpoint endpoint, Object body, Map<String,Object> headers)
          Sends the body to an endpoint with the specified headers and header values

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

 void sendBodyAndHeaders(Object body, Map<String,Object> headers)
          Sends the body to the default endpoint with the specified headers and header values

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

 Object sendBodyAndHeaders(String endpointUri, ExchangePattern pattern, Object body, Map<String,Object> headers)
          Sends the body to an endpoint with the specified headers and header values

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

 void sendBodyAndHeaders(String endpointUri, Object body, Map<String,Object> headers)
          Sends the body to an endpoint with the specified headers and header values

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

 Object sendBodyAndProperty(Endpoint endpoint, ExchangePattern pattern, Object body, String property, Object propertyValue)
          Sends the body to an endpoint with a specified property and property value

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

 void sendBodyAndProperty(Endpoint endpoint, Object body, String property, Object propertyValue)
          Sends the body to an endpoint with a specified property and property value

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

 void sendBodyAndProperty(Object body, String property, Object propertyValue)
          Sends the body to the default endpoint with a specified property and property value

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

 Object sendBodyAndProperty(String endpoint, ExchangePattern pattern, Object body, String property, Object propertyValue)
          Sends the body to an endpoint with a specified property and property value

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

 void sendBodyAndProperty(String endpointUri, Object body, String property, Object propertyValue)
          Sends the body to an endpoint with a specified property and property value

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

 void setDefaultEndpoint(Endpoint defaultEndpoint)
          Sets the default endpoint to use if none is specified
 void setDefaultEndpointUri(String endpointUri)
          Sets the default endpoint uri to use if none is specified
 void setExecutorService(ExecutorService executorService)
          Sets a custom executor service to use for async messaging.
 void setMaximumCacheSize(int maximumCacheSize)
          Sets a custom maximum cache size to use in the backing cache pools.
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Method Detail

getMaximumCacheSize

int getMaximumCacheSize()
Gets the maximum cache size used in the backing cache pools.

Returns:
the maximum cache size

setMaximumCacheSize

void setMaximumCacheSize(int maximumCacheSize)
Sets a custom maximum cache size to use in the backing cache pools.

Parameters:
maximumCacheSize - the custom maximum cache size

getCurrentCacheSize

int getCurrentCacheSize()
Gets an approximated size of the current cached resources in the backing cache pools.

Returns:
the size of current cached resources

getDefaultEndpoint

Endpoint getDefaultEndpoint()
Get the default endpoint to use if none is specified

Returns:
the default endpoint instance

setDefaultEndpoint

void setDefaultEndpoint(Endpoint defaultEndpoint)
Sets the default endpoint to use if none is specified

Parameters:
defaultEndpoint - the default endpoint instance

setDefaultEndpointUri

void setDefaultEndpointUri(String endpointUri)
Sets the default endpoint uri to use if none is specified

Parameters:
endpointUri - the default endpoint uri

send

Exchange send(Exchange exchange)
Sends the exchange to the default endpoint

Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException().

Parameters:
exchange - the exchange to send
Returns:
the returned exchange

send

Exchange send(Processor processor)
Sends an exchange to the default endpoint using a supplied processor

Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException().

Parameters:
processor - the transformer used to populate the new exchange Processor to populate the exchange
Returns:
the returned exchange

sendBody

void sendBody(Object body)
              throws CamelExecutionException
Sends the body to the default endpoint

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
body - the payload to send
Throws:
CamelExecutionException - if the processing of the exchange failed

sendBodyAndHeader

void sendBodyAndHeader(Object body,
                       String header,
                       Object headerValue)
                       throws CamelExecutionException
Sends the body to the default endpoint with a specified header and header value

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
body - the payload to send
header - the header name
headerValue - the header value
Throws:
CamelExecutionException - if the processing of the exchange failed

sendBodyAndProperty

void sendBodyAndProperty(Object body,
                         String property,
                         Object propertyValue)
                         throws CamelExecutionException
Sends the body to the default endpoint with a specified property and property value

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
body - the payload to send
property - the property name
propertyValue - the property value
Throws:
CamelExecutionException - if the processing of the exchange failed

sendBodyAndHeaders

void sendBodyAndHeaders(Object body,
                        Map<String,Object> headers)
                        throws CamelExecutionException
Sends the body to the default endpoint with the specified headers and header values

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
body - the payload to send
headers - the headers
Throws:
CamelExecutionException - if the processing of the exchange failed

send

Exchange send(String endpointUri,
              Exchange exchange)
Sends the exchange to the given endpoint

Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException().

Parameters:
endpointUri - the endpoint URI to send the exchange to
exchange - the exchange to send
Returns:
the returned exchange
Throws:
CamelExecutionException - if the processing of the exchange failed

send

Exchange send(String endpointUri,
              Processor processor)
Sends an exchange to an endpoint using a supplied processor

Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException().

Parameters:
endpointUri - the endpoint URI to send the exchange to
processor - the transformer used to populate the new exchange Processor to populate the exchange
Returns:
the returned exchange
Throws:
CamelExecutionException - if the processing of the exchange failed

send

Exchange send(String endpointUri,
              ExchangePattern pattern,
              Processor processor)
Sends an exchange to an endpoint using a supplied processor

Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException().

Parameters:
endpointUri - the endpoint URI to send the exchange to
pattern - the message ExchangePattern such as ExchangePattern.InOnly or ExchangePattern.InOut
processor - the transformer used to populate the new exchange Processor to populate the exchange
Returns:
the returned exchange

send

Exchange send(Endpoint endpoint,
              Exchange exchange)
Sends the exchange to the given endpoint

Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException().

Parameters:
endpoint - the endpoint to send the exchange to
exchange - the exchange to send
Returns:
the returned exchange

send

Exchange send(Endpoint endpoint,
              Processor processor)
Sends an exchange to an endpoint using a supplied processor

Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException().

Parameters:
endpoint - the endpoint to send the exchange to
processor - the transformer used to populate the new exchange Processor to populate the exchange
Returns:
the returned exchange

send

Exchange send(Endpoint endpoint,
              ExchangePattern pattern,
              Processor processor)
Sends an exchange to an endpoint using a supplied processor

Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException().

Parameters:
endpoint - the endpoint to send the exchange to
pattern - the message ExchangePattern such as ExchangePattern.InOnly or ExchangePattern.InOut
processor - the transformer used to populate the new exchange Processor to populate the exchange
Returns:
the returned exchange

sendBody

void sendBody(Endpoint endpoint,
              Object body)
              throws CamelExecutionException
Send the body to an endpoint

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpoint - the endpoint to send the exchange to
body - the payload
Throws:
CamelExecutionException - if the processing of the exchange failed

sendBody

void sendBody(String endpointUri,
              Object body)
              throws CamelExecutionException
Send the body to an endpoint

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpointUri - the endpoint URI to send the exchange to
body - the payload
Throws:
CamelExecutionException - if the processing of the exchange failed

sendBody

Object sendBody(Endpoint endpoint,
                ExchangePattern pattern,
                Object body)
                throws CamelExecutionException
Send the body to an endpoint with the given ExchangePattern returning any result output body

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpoint - the endpoint to send the exchange to
body - the payload
pattern - the message ExchangePattern such as ExchangePattern.InOnly or ExchangePattern.InOut
Returns:
the result if ExchangePattern is OUT capable, otherwise null
Throws:
CamelExecutionException - if the processing of the exchange failed

sendBody

Object sendBody(String endpointUri,
                ExchangePattern pattern,
                Object body)
                throws CamelExecutionException
Send the body to an endpoint returning any result output body

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpointUri - the endpoint URI to send the exchange to
pattern - the message ExchangePattern such as ExchangePattern.InOnly or ExchangePattern.InOut
body - the payload
Returns:
the result if ExchangePattern is OUT capable, otherwise null
Throws:
CamelExecutionException - if the processing of the exchange failed

sendBodyAndHeader

void sendBodyAndHeader(String endpointUri,
                       Object body,
                       String header,
                       Object headerValue)
                       throws CamelExecutionException
Sends the body to an endpoint with a specified header and header value

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpointUri - the endpoint URI to send to
body - the payload to send
header - the header name
headerValue - the header value
Throws:
CamelExecutionException - if the processing of the exchange failed

sendBodyAndHeader

void sendBodyAndHeader(Endpoint endpoint,
                       Object body,
                       String header,
                       Object headerValue)
                       throws CamelExecutionException
Sends the body to an endpoint with a specified header and header value

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpoint - the Endpoint to send to
body - the payload to send
header - the header name
headerValue - the header value
Throws:
CamelExecutionException - if the processing of the exchange failed

sendBodyAndHeader

Object sendBodyAndHeader(Endpoint endpoint,
                         ExchangePattern pattern,
                         Object body,
                         String header,
                         Object headerValue)
                         throws CamelExecutionException
Sends the body to an endpoint with a specified header and header value

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpoint - the Endpoint to send to
pattern - the message ExchangePattern such as ExchangePattern.InOnly or ExchangePattern.InOut
body - the payload to send
header - the header name
headerValue - the header value
Returns:
the result if ExchangePattern is OUT capable, otherwise null
Throws:
CamelExecutionException - if the processing of the exchange failed

sendBodyAndHeader

Object sendBodyAndHeader(String endpoint,
                         ExchangePattern pattern,
                         Object body,
                         String header,
                         Object headerValue)
                         throws CamelExecutionException
Sends the body to an endpoint with a specified header and header value

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpoint - the Endpoint URI to send to
pattern - the message ExchangePattern such as ExchangePattern.InOnly or ExchangePattern.InOut
body - the payload to send
header - the header name
headerValue - the header value
Returns:
the result if ExchangePattern is OUT capable, otherwise null
Throws:
CamelExecutionException - if the processing of the exchange failed

sendBodyAndProperty

void sendBodyAndProperty(String endpointUri,
                         Object body,
                         String property,
                         Object propertyValue)
                         throws CamelExecutionException
Sends the body to an endpoint with a specified property and property value

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpointUri - the endpoint URI to send to
body - the payload to send
property - the property name
propertyValue - the property value
Throws:
CamelExecutionException - if the processing of the exchange failed

sendBodyAndProperty

void sendBodyAndProperty(Endpoint endpoint,
                         Object body,
                         String property,
                         Object propertyValue)
                         throws CamelExecutionException
Sends the body to an endpoint with a specified property and property value

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpoint - the Endpoint to send to
body - the payload to send
property - the property name
propertyValue - the property value
Throws:
CamelExecutionException - if the processing of the exchange failed

sendBodyAndProperty

Object sendBodyAndProperty(Endpoint endpoint,
                           ExchangePattern pattern,
                           Object body,
                           String property,
                           Object propertyValue)
                           throws CamelExecutionException
Sends the body to an endpoint with a specified property and property value

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpoint - the Endpoint to send to
pattern - the message ExchangePattern such as ExchangePattern.InOnly or ExchangePattern.InOut
body - the payload to send
property - the property name
propertyValue - the property value
Returns:
the result if ExchangePattern is OUT capable, otherwise null
Throws:
CamelExecutionException - if the processing of the exchange failed

sendBodyAndProperty

Object sendBodyAndProperty(String endpoint,
                           ExchangePattern pattern,
                           Object body,
                           String property,
                           Object propertyValue)
                           throws CamelExecutionException
Sends the body to an endpoint with a specified property and property value

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpoint - the Endpoint URI to send to
pattern - the message ExchangePattern such as ExchangePattern.InOnly or ExchangePattern.InOut
body - the payload to send
property - the property name
propertyValue - the property value
Returns:
the result if ExchangePattern is OUT capable, otherwise null
Throws:
CamelExecutionException - if the processing of the exchange failed

sendBodyAndHeaders

void sendBodyAndHeaders(String endpointUri,
                        Object body,
                        Map<String,Object> headers)
                        throws CamelExecutionException
Sends the body to an endpoint with the specified headers and header values

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpointUri - the endpoint URI to send to
body - the payload to send
headers - headers
Throws:
CamelExecutionException - if the processing of the exchange failed

sendBodyAndHeaders

void sendBodyAndHeaders(Endpoint endpoint,
                        Object body,
                        Map<String,Object> headers)
                        throws CamelExecutionException
Sends the body to an endpoint with the specified headers and header values

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpoint - the endpoint URI to send to
body - the payload to send
headers - headers
Throws:
CamelExecutionException - if the processing of the exchange failed

sendBodyAndHeaders

Object sendBodyAndHeaders(String endpointUri,
                          ExchangePattern pattern,
                          Object body,
                          Map<String,Object> headers)
                          throws CamelExecutionException
Sends the body to an endpoint with the specified headers and header values

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpointUri - the endpoint URI to send to
pattern - the message ExchangePattern such as ExchangePattern.InOnly or ExchangePattern.InOut
body - the payload to send
headers - headers
Returns:
the result if ExchangePattern is OUT capable, otherwise null
Throws:
CamelExecutionException - if the processing of the exchange failed

sendBodyAndHeaders

Object sendBodyAndHeaders(Endpoint endpoint,
                          ExchangePattern pattern,
                          Object body,
                          Map<String,Object> headers)
                          throws CamelExecutionException
Sends the body to an endpoint with the specified headers and header values

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpoint - the endpoint URI to send to
pattern - the message ExchangePattern such as ExchangePattern.InOnly or ExchangePattern.InOut
body - the payload to send
headers - headers
Returns:
the result if ExchangePattern is OUT capable, otherwise null
Throws:
CamelExecutionException - if the processing of the exchange failed

request

Exchange request(Endpoint endpoint,
                 Processor processor)
Sends an exchange to an endpoint using a supplied processor Uses an ExchangePattern.InOut message exchange pattern.

Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException().

Parameters:
endpoint - the Endpoint to send to
processor - the processor which will populate the exchange before sending
Returns:
the result (see class javadoc)

request

Exchange request(String endpointUri,
                 Processor processor)
Sends an exchange to an endpoint using a supplied processor Uses an ExchangePattern.InOut message exchange pattern.

Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException().

Parameters:
endpointUri - the endpoint URI to send to
processor - the processor which will populate the exchange before sending
Returns:
the result (see class javadoc)

requestBody

Object requestBody(Object body)
                   throws CamelExecutionException
Sends the body to the default endpoint and returns the result content Uses an ExchangePattern.InOut message exchange pattern.

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
body - the payload to send
Returns:
the result (see class javadoc)
Throws:
CamelExecutionException - if the processing of the exchange failed

requestBody

<T> T requestBody(Object body,
                  Class<T> type)
              throws CamelExecutionException
Sends the body to the default endpoint and returns the result content Uses an ExchangePattern.InOut message exchange pattern.

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
body - the payload to send
type - the expected response type
Returns:
the result (see class javadoc)
Throws:
CamelExecutionException - if the processing of the exchange failed

requestBody

Object requestBody(Endpoint endpoint,
                   Object body)
                   throws CamelExecutionException
Send the body to an endpoint returning any result output body. Uses an ExchangePattern.InOut message exchange pattern.

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpoint - the Endpoint to send to
body - the payload
Returns:
the result (see class javadoc)
Throws:
CamelExecutionException - if the processing of the exchange failed

requestBody

<T> T requestBody(Endpoint endpoint,
                  Object body,
                  Class<T> type)
              throws CamelExecutionException
Send the body to an endpoint returning any result output body. Uses an ExchangePattern.InOut message exchange pattern.

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpoint - the Endpoint to send to
body - the payload
type - the expected response type
Returns:
the result (see class javadoc)
Throws:
CamelExecutionException - if the processing of the exchange failed

requestBody

Object requestBody(String endpointUri,
                   Object body)
                   throws CamelExecutionException
Send the body to an endpoint returning any result output body. Uses an ExchangePattern.InOut message exchange pattern.

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpointUri - the endpoint URI to send to
body - the payload
Returns:
the result (see class javadoc)
Throws:
CamelExecutionException - if the processing of the exchange failed

requestBody

<T> T requestBody(String endpointUri,
                  Object body,
                  Class<T> type)
              throws CamelExecutionException
Send the body to an endpoint returning any result output body. Uses an ExchangePattern.InOut message exchange pattern.

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpointUri - the endpoint URI to send to
body - the payload
type - the expected response type
Returns:
the result (see class javadoc)
Throws:
CamelExecutionException - if the processing of the exchange failed

requestBodyAndHeader

Object requestBodyAndHeader(Object body,
                            String header,
                            Object headerValue)
                            throws CamelExecutionException
Sends the body to the default endpoint and returns the result content Uses an ExchangePattern.InOut message exchange pattern.

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
body - the payload
header - the header name
headerValue - the header value
Returns:
the result (see class javadoc)
Throws:
CamelExecutionException - if the processing of the exchange failed

requestBodyAndHeader

Object requestBodyAndHeader(Endpoint endpoint,
                            Object body,
                            String header,
                            Object headerValue)
                            throws CamelExecutionException
Send the body to an endpoint returning any result output body. Uses an ExchangePattern.InOut message exchange pattern.

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpoint - the Endpoint to send to
body - the payload
header - the header name
headerValue - the header value
Returns:
the result (see class javadoc)
Throws:
CamelExecutionException - if the processing of the exchange failed

requestBodyAndHeader

<T> T requestBodyAndHeader(Endpoint endpoint,
                           Object body,
                           String header,
                           Object headerValue,
                           Class<T> type)
                       throws CamelExecutionException
Send the body to an endpoint returning any result output body. Uses an ExchangePattern.InOut message exchange pattern.

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpoint - the Endpoint to send to
body - the payload
header - the header name
headerValue - the header value
type - the expected response type
Returns:
the result (see class javadoc)
Throws:
CamelExecutionException - if the processing of the exchange failed

requestBodyAndHeader

Object requestBodyAndHeader(String endpointUri,
                            Object body,
                            String header,
                            Object headerValue)
                            throws CamelExecutionException
Send the body to an endpoint returning any result output body. Uses an ExchangePattern.InOut message exchange pattern.

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpointUri - the endpoint URI to send to
body - the payload
header - the header name
headerValue - the header value
Returns:
the result (see class javadoc)
Throws:
CamelExecutionException - if the processing of the exchange failed

requestBodyAndHeader

<T> T requestBodyAndHeader(String endpointUri,
                           Object body,
                           String header,
                           Object headerValue,
                           Class<T> type)
                       throws CamelExecutionException
Send the body to an endpoint returning any result output body. Uses an ExchangePattern.InOut message exchange pattern.

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpointUri - the endpoint URI to send to
body - the payload
header - the header name
headerValue - the header value
type - the expected response type
Returns:
the result (see class javadoc)
Throws:
CamelExecutionException - if the processing of the exchange failed

requestBodyAndHeaders

Object requestBodyAndHeaders(String endpointUri,
                             Object body,
                             Map<String,Object> headers)
                             throws CamelExecutionException
Sends the body to an endpoint with the specified headers and header values. Uses an ExchangePattern.InOut message exchange pattern.

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpointUri - the endpoint URI to send to
body - the payload to send
headers - headers
Returns:
the result (see class javadoc)
Throws:
CamelExecutionException - if the processing of the exchange failed

requestBodyAndHeaders

<T> T requestBodyAndHeaders(String endpointUri,
                            Object body,
                            Map<String,Object> headers,
                            Class<T> type)
                        throws CamelExecutionException
Sends the body to an endpoint with the specified headers and header values. Uses an ExchangePattern.InOut message exchange pattern.

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpointUri - the endpoint URI to send to
body - the payload to send
headers - headers
type - the expected response type
Returns:
the result (see class javadoc)
Throws:
CamelExecutionException - if the processing of the exchange failed

requestBodyAndHeaders

Object requestBodyAndHeaders(Endpoint endpoint,
                             Object body,
                             Map<String,Object> headers)
                             throws CamelExecutionException
Sends the body to an endpoint with the specified headers and header values. Uses an ExchangePattern.InOut message exchange pattern.

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpoint - the endpoint URI to send to
body - the payload to send
headers - headers
Returns:
the result (see class javadoc)
Throws:
CamelExecutionException - if the processing of the exchange failed

requestBodyAndHeaders

Object requestBodyAndHeaders(Object body,
                             Map<String,Object> headers)
                             throws CamelExecutionException
Sends the body to the default endpoint and returns the result content Uses an ExchangePattern.InOut message exchange pattern.

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
body - the payload to send
headers - headers
Returns:
the result (see class javadoc)
Throws:
CamelExecutionException - if the processing of the exchange failed

requestBodyAndHeaders

<T> T requestBodyAndHeaders(Endpoint endpoint,
                            Object body,
                            Map<String,Object> headers,
                            Class<T> type)
                        throws CamelExecutionException
Sends the body to an endpoint with the specified headers and header values. Uses an ExchangePattern.InOut message exchange pattern.

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
endpoint - the endpoint URI to send to
body - the payload to send
headers - headers
type - the expected response type
Returns:
the result (see class javadoc)
Throws:
CamelExecutionException - if the processing of the exchange failed

setExecutorService

void setExecutorService(ExecutorService executorService)
Sets a custom executor service to use for async messaging.

Parameters:
executorService - the executor service.

asyncSend

Future<Exchange> asyncSend(String endpointUri,
                           Exchange exchange)
Sends an asynchronous exchange to the given endpoint.

Parameters:
endpointUri - the endpoint URI to send the exchange to
exchange - the exchange to send
Returns:
a handle to be used to get the response in the future

asyncSend

Future<Exchange> asyncSend(String endpointUri,
                           Processor processor)
Sends an asynchronous exchange to the given endpoint.

Parameters:
endpointUri - the endpoint URI to send the exchange to
processor - the transformer used to populate the new exchange
Returns:
a handle to be used to get the response in the future

asyncSendBody

Future<Object> asyncSendBody(String endpointUri,
                             Object body)
Sends an asynchronous body to the given endpoint. Uses an ExchangePattern.InOnly message exchange pattern.

Parameters:
endpointUri - the endpoint URI to send the exchange to
body - the body to send
Returns:
a handle to be used to get the response in the future

asyncRequestBody

Future<Object> asyncRequestBody(String endpointUri,
                                Object body)
Sends an asynchronous body to the given endpoint. Uses an ExchangePattern.InOut message exchange pattern.

Parameters:
endpointUri - the endpoint URI to send the exchange to
body - the body to send
Returns:
a handle to be used to get the response in the future

asyncRequestBodyAndHeader

Future<Object> asyncRequestBodyAndHeader(String endpointUri,
                                         Object body,
                                         String header,
                                         Object headerValue)
Sends an asynchronous body to the given endpoint. Uses an ExchangePattern.InOut message exchange pattern.

Parameters:
endpointUri - the endpoint URI to send the exchange to
body - the body to send
header - the header name
headerValue - the header value
Returns:
a handle to be used to get the response in the future

asyncRequestBodyAndHeaders

Future<Object> asyncRequestBodyAndHeaders(String endpointUri,
                                          Object body,
                                          Map<String,Object> headers)
Sends an asynchronous body to the given endpoint. Uses an ExchangePattern.InOut message exchange pattern.

Parameters:
endpointUri - the endpoint URI to send the exchange to
body - the body to send
headers - headers
Returns:
a handle to be used to get the response in the future

asyncRequestBody

<T> Future<T> asyncRequestBody(String endpointUri,
                               Object body,
                               Class<T> type)
Sends an asynchronous body to the given endpoint. Uses an ExchangePattern.InOut message exchange pattern.

Parameters:
endpointUri - the endpoint URI to send the exchange to
body - the body to send
type - the expected response type
Returns:
a handle to be used to get the response in the future

asyncRequestBodyAndHeader

<T> Future<T> asyncRequestBodyAndHeader(String endpointUri,
                                        Object body,
                                        String header,
                                        Object headerValue,
                                        Class<T> type)
Sends an asynchronous body to the given endpoint. Uses an ExchangePattern.InOut message exchange pattern.

Parameters:
endpointUri - the endpoint URI to send the exchange to
body - the body to send
header - the header name
headerValue - the header value
type - the expected response type
Returns:
a handle to be used to get the response in the future

asyncRequestBodyAndHeaders

<T> Future<T> asyncRequestBodyAndHeaders(String endpointUri,
                                         Object body,
                                         Map<String,Object> headers,
                                         Class<T> type)
Sends an asynchronous body to the given endpoint. Uses an ExchangePattern.InOut message exchange pattern.

Parameters:
endpointUri - the endpoint URI to send the exchange to
body - the body to send
headers - headers
type - the expected response type
Returns:
a handle to be used to get the response in the future

asyncSend

Future<Exchange> asyncSend(Endpoint endpoint,
                           Exchange exchange)
Sends an asynchronous exchange to the given endpoint.

Parameters:
endpoint - the endpoint to send the exchange to
exchange - the exchange to send
Returns:
a handle to be used to get the response in the future

asyncSend

Future<Exchange> asyncSend(Endpoint endpoint,
                           Processor processor)
Sends an asynchronous exchange to the given endpoint.

Parameters:
endpoint - the endpoint to send the exchange to
processor - the transformer used to populate the new exchange
Returns:
a handle to be used to get the response in the future

asyncSendBody

Future<Object> asyncSendBody(Endpoint endpoint,
                             Object body)
Sends an asynchronous body to the given endpoint. Uses an ExchangePattern.InOnly message exchange pattern.

Parameters:
endpoint - the endpoint to send the exchange to
body - the body to send
Returns:
a handle to be used to get the response in the future

asyncRequestBody

Future<Object> asyncRequestBody(Endpoint endpoint,
                                Object body)
Sends an asynchronous body to the given endpoint. Uses an ExchangePattern.InOut message exchange pattern.

Parameters:
endpoint - the endpoint to send the exchange to
body - the body to send
Returns:
a handle to be used to get the response in the future

asyncRequestBodyAndHeader

Future<Object> asyncRequestBodyAndHeader(Endpoint endpoint,
                                         Object body,
                                         String header,
                                         Object headerValue)
Sends an asynchronous body to the given endpoint. Uses an ExchangePattern.InOut message exchange pattern.

Parameters:
endpoint - the endpoint to send the exchange to
body - the body to send
header - the header name
headerValue - the header value
Returns:
a handle to be used to get the response in the future

asyncRequestBodyAndHeaders

Future<Object> asyncRequestBodyAndHeaders(Endpoint endpoint,
                                          Object body,
                                          Map<String,Object> headers)
Sends an asynchronous body to the given endpoint. Uses an ExchangePattern.InOut message exchange pattern.

Parameters:
endpoint - the endpoint to send the exchange to
body - the body to send
headers - headers
Returns:
a handle to be used to get the response in the future

asyncRequestBody

<T> Future<T> asyncRequestBody(Endpoint endpoint,
                               Object body,
                               Class<T> type)
Sends an asynchronous body to the given endpoint. Uses an ExchangePattern.InOut message exchange pattern.

Parameters:
endpoint - the endpoint to send the exchange to
body - the body to send
type - the expected response type
Returns:
a handle to be used to get the response in the future

asyncRequestBodyAndHeader

<T> Future<T> asyncRequestBodyAndHeader(Endpoint endpoint,
                                        Object body,
                                        String header,
                                        Object headerValue,
                                        Class<T> type)
Sends an asynchronous body to the given endpoint. Uses an ExchangePattern.InOut message exchange pattern.

Parameters:
endpoint - the endpoint to send the exchange to
body - the body to send
header - the header name
headerValue - the header value
type - the expected response type
Returns:
a handle to be used to get the response in the future

asyncRequestBodyAndHeaders

<T> Future<T> asyncRequestBodyAndHeaders(Endpoint endpoint,
                                         Object body,
                                         Map<String,Object> headers,
                                         Class<T> type)
Sends an asynchronous body to the given endpoint. Uses an ExchangePattern.InOut message exchange pattern.

Parameters:
endpoint - the endpoint to send the exchange to
body - the body to send
headers - headers
type - the expected response type
Returns:
a handle to be used to get the response in the future

extractFutureBody

<T> T extractFutureBody(Future<Object> future,
                        Class<T> type)
                    throws CamelExecutionException
Gets the response body from the future handle, will wait until the response is ready.

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
future - the handle to get the response
type - the expected response type
Returns:
the result (see class javadoc)
Throws:
CamelExecutionException - if the processing of the exchange failed

extractFutureBody

<T> T extractFutureBody(Future<Object> future,
                        long timeout,
                        TimeUnit unit,
                        Class<T> type)
                    throws TimeoutException,
                           CamelExecutionException
Gets the response body from the future handle, will wait at most the given time for the response to be ready.

Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with the caused exception wrapped.

Parameters:
future - the handle to get the response
timeout - the maximum time to wait
unit - the time unit of the timeout argument
type - the expected response type
Returns:
the result (see class javadoc)
Throws:
TimeoutException - if the wait timed out
CamelExecutionException - if the processing of the exchange failed

asyncCallback

Future<Exchange> asyncCallback(String endpointUri,
                               Exchange exchange,
                               Synchronization onCompletion)
Sends an asynchronous exchange to the given endpoint.

Parameters:
endpointUri - the endpoint URI to send the exchange to
exchange - the exchange to send
onCompletion - callback invoked when exchange has been completed
Returns:
a handle to be used to get the response in the future

asyncCallback

Future<Exchange> asyncCallback(Endpoint endpoint,
                               Exchange exchange,
                               Synchronization onCompletion)
Sends an asynchronous exchange to the given endpoint.

Parameters:
endpoint - the endpoint to send the exchange to
exchange - the exchange to send
onCompletion - callback invoked when exchange has been completed
Returns:
a handle to be used to get the response in the future

asyncCallback

Future<Exchange> asyncCallback(String endpointUri,
                               Processor processor,
                               Synchronization onCompletion)
Sends an asynchronous exchange to the given endpoint using a supplied processor.

Parameters:
endpointUri - the endpoint URI to send the exchange to
processor - the transformer used to populate the new exchange Processor to populate the exchange
onCompletion - callback invoked when exchange has been completed
Returns:
a handle to be used to get the response in the future

asyncCallback

Future<Exchange> asyncCallback(Endpoint endpoint,
                               Processor processor,
                               Synchronization onCompletion)
Sends an asynchronous exchange to the given endpoint using a supplied processor.

Parameters:
endpoint - the endpoint to send the exchange to
processor - the transformer used to populate the new exchange Processor to populate the exchange
onCompletion - callback invoked when exchange has been completed
Returns:
a handle to be used to get the response in the future

asyncCallbackSendBody

Future<Object> asyncCallbackSendBody(String endpointUri,
                                     Object body,
                                     Synchronization onCompletion)
Sends an asynchronous body to the given endpoint. Uses an ExchangePattern.InOnly message exchange pattern.

Parameters:
endpointUri - the endpoint URI to send the exchange to
body - the body to send
onCompletion - callback invoked when exchange has been completed
Returns:
a handle to be used to get the response in the future

asyncCallbackSendBody

Future<Object> asyncCallbackSendBody(Endpoint endpoint,
                                     Object body,
                                     Synchronization onCompletion)
Sends an asynchronous body to the given endpoint. Uses an ExchangePattern.InOnly message exchange pattern.

Parameters:
endpoint - the endpoint to send the exchange to
body - the body to send
onCompletion - callback invoked when exchange has been completed
Returns:
a handle to be used to get the response in the future

asyncCallbackRequestBody

Future<Object> asyncCallbackRequestBody(String endpointUri,
                                        Object body,
                                        Synchronization onCompletion)
Sends an asynchronous body to the given endpoint. Uses an ExchangePattern.InOut message exchange pattern.

Parameters:
endpointUri - the endpoint URI to send the exchange to
body - the body to send
onCompletion - callback invoked when exchange has been completed
Returns:
a handle to be used to get the response in the future

asyncCallbackRequestBody

Future<Object> asyncCallbackRequestBody(Endpoint endpoint,
                                        Object body,
                                        Synchronization onCompletion)
Sends an asynchronous body to the given endpoint. Uses an ExchangePattern.InOut message exchange pattern.

Parameters:
endpoint - the endpoint to send the exchange to
body - the body to send
onCompletion - callback invoked when exchange has been completed
Returns:
a handle to be used to get the response in the future


Apache CAMEL