public interface ProducerTemplate extends Service
Message
instances in an Exchange
to an Endpoint
.
CamelExecutionException
while others stores any thrown exception on the returned
Exchange
. ProducerTemplate
is thread safe. 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.
CamelExecutionException
if processing failed during routing with the
caused exception wrappedService.stop()
the template. FluentProducerTemplate
,
ConsumerTemplate
Modifier and Type | Method and Description |
---|---|
CompletableFuture<Exchange> |
asyncCallback(Endpoint endpoint,
Exchange exchange,
Synchronization onCompletion)
Deprecated.
|
CompletableFuture<Exchange> |
asyncCallback(Endpoint endpoint,
Processor processor,
Synchronization onCompletion)
Deprecated.
|
CompletableFuture<Exchange> |
asyncCallback(String endpointUri,
Exchange exchange,
Synchronization onCompletion)
Deprecated.
|
CompletableFuture<Exchange> |
asyncCallback(String endpointUri,
Processor processor,
Synchronization onCompletion)
Deprecated.
|
CompletableFuture<Object> |
asyncCallbackRequestBody(Endpoint endpoint,
Object body,
Synchronization onCompletion)
Deprecated.
|
CompletableFuture<Object> |
asyncCallbackRequestBody(String endpointUri,
Object body,
Synchronization onCompletion)
Deprecated.
|
CompletableFuture<Object> |
asyncCallbackSendBody(Endpoint endpoint,
Object body,
Synchronization onCompletion)
Deprecated.
|
CompletableFuture<Object> |
asyncCallbackSendBody(String endpointUri,
Object body,
Synchronization onCompletion)
Deprecated.
|
CompletableFuture<Object> |
asyncRequestBody(Endpoint endpoint,
Object body)
Sends an asynchronous body to the given endpoint.
|
<T> CompletableFuture<T> |
asyncRequestBody(Endpoint endpoint,
Object body,
Class<T> type)
Sends an asynchronous body to the given endpoint.
|
CompletableFuture<Object> |
asyncRequestBody(String endpointUri,
Object body)
Sends an asynchronous body to the given endpoint.
|
<T> CompletableFuture<T> |
asyncRequestBody(String endpointUri,
Object body,
Class<T> type)
Sends an asynchronous body to the given endpoint.
|
CompletableFuture<Object> |
asyncRequestBodyAndHeader(Endpoint endpoint,
Object body,
String header,
Object headerValue)
Sends an asynchronous body to the given endpoint.
|
<T> CompletableFuture<T> |
asyncRequestBodyAndHeader(Endpoint endpoint,
Object body,
String header,
Object headerValue,
Class<T> type)
Sends an asynchronous body to the given endpoint.
|
CompletableFuture<Object> |
asyncRequestBodyAndHeader(String endpointUri,
Object body,
String header,
Object headerValue)
Sends an asynchronous body to the given endpoint.
|
<T> CompletableFuture<T> |
asyncRequestBodyAndHeader(String endpointUri,
Object body,
String header,
Object headerValue,
Class<T> type)
Sends an asynchronous body to the given endpoint.
|
CompletableFuture<Object> |
asyncRequestBodyAndHeaders(Endpoint endpoint,
Object body,
Map<String,Object> headers)
Sends an asynchronous body to the given endpoint.
|
<T> CompletableFuture<T> |
asyncRequestBodyAndHeaders(Endpoint endpoint,
Object body,
Map<String,Object> headers,
Class<T> type)
Sends an asynchronous body to the given endpoint.
|
CompletableFuture<Object> |
asyncRequestBodyAndHeaders(String endpointUri,
Object body,
Map<String,Object> headers)
Sends an asynchronous body to the given endpoint.
|
<T> CompletableFuture<T> |
asyncRequestBodyAndHeaders(String endpointUri,
Object body,
Map<String,Object> headers,
Class<T> type)
Sends an asynchronous body to the given endpoint.
|
CompletableFuture<Exchange> |
asyncSend(Endpoint endpoint,
Exchange exchange)
Sends an asynchronous exchange to the given endpoint.
|
CompletableFuture<Exchange> |
asyncSend(Endpoint endpoint,
Processor processor)
Sends an asynchronous exchange to the given endpoint.
|
CompletableFuture<Exchange> |
asyncSend(String endpointUri,
Exchange exchange)
Sends an asynchronous exchange to the given endpoint.
|
CompletableFuture<Exchange> |
asyncSend(String endpointUri,
Processor processor)
Sends an asynchronous exchange to the given endpoint.
|
CompletableFuture<Object> |
asyncSendBody(Endpoint endpoint,
Object body)
Sends an asynchronous body to the given endpoint.
|
CompletableFuture<Object> |
asyncSendBody(String endpointUri,
Object body)
Sends an asynchronous body to the given endpoint.
|
void |
cleanUp()
Cleanup the cache (purging stale entries)
|
<T> T |
extractFutureBody(Future<?> future,
Class<T> type)
Gets the response body from the future handle, will wait until the response is ready.
|
<T> T |
extractFutureBody(Future<?> 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.
|
CamelContext |
getCamelContext()
Get the
CamelContext |
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.
|
boolean |
isEventNotifierEnabled()
Whether the
EventNotifier should be used by this ProducerTemplate to send
events about the Exchange being sent. |
boolean |
isThreadedAsyncMode()
Reports if async* methods will dispatch processing from the calling thread (false) or through executor (true).
|
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,
ExchangePattern pattern,
Processor processor,
Processor resultProcessor)
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 |
setEventNotifierEnabled(boolean enabled)
Sets whether the
EventNotifier should be used by this ProducerTemplate to
send events about the Exchange being sent. |
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.
|
void |
setThreadedAsyncMode(boolean useExecutor)
Reports if async* methods will dispatch processing from the calling thread (false) or through executor (true).
|
CamelContext getCamelContext()
CamelContext
int getMaximumCacheSize()
void setMaximumCacheSize(int maximumCacheSize)
maximumCacheSize
- the custom maximum cache sizeint getCurrentCacheSize()
boolean isThreadedAsyncMode()
void setThreadedAsyncMode(boolean useExecutor)
useExecutor
- if async* methods will dispatch processing with the executorEndpoint getDefaultEndpoint()
void setDefaultEndpoint(Endpoint defaultEndpoint)
defaultEndpoint
- the default endpoint instancevoid setDefaultEndpointUri(String endpointUri)
endpointUri
- the default endpoint urivoid setEventNotifierEnabled(boolean enabled)
EventNotifier
should be used by this ProducerTemplate
to
send events about the Exchange
being sent.
By default this is enabled.enabled
- true to enable, false to disable.boolean isEventNotifierEnabled()
EventNotifier
should be used by this ProducerTemplate
to send
events about the Exchange
being sent.void cleanUp()
Exchange send(Exchange exchange)
Exchange.getException()
.exchange
- the exchange to sendExchange send(Processor processor)
Exchange.getException()
.processor
- the transformer used to populate the new exchange Processor
to populate the exchangevoid sendBody(Object body) throws CamelExecutionException
CamelExecutionException
with the caused exception wrapped.body
- the payload to sendCamelExecutionException
- if the processing of the exchange failedvoid sendBodyAndHeader(Object body, String header, Object headerValue) throws CamelExecutionException
CamelExecutionException
with the caused exception wrapped.body
- the payload to sendheader
- the header nameheaderValue
- the header valueCamelExecutionException
- if the processing of the exchange failedvoid sendBodyAndProperty(Object body, String property, Object propertyValue) throws CamelExecutionException
CamelExecutionException
with the caused exception wrapped.body
- the payload to sendproperty
- the property namepropertyValue
- the property valueCamelExecutionException
- if the processing of the exchange failedvoid sendBodyAndHeaders(Object body, Map<String,Object> headers) throws CamelExecutionException
CamelExecutionException
with the caused exception wrapped.body
- the payload to sendheaders
- the headersCamelExecutionException
- if the processing of the exchange failedExchange send(String endpointUri, Exchange exchange)
Exchange.getException()
.endpointUri
- the endpoint URI to send the exchange toexchange
- the exchange to sendCamelExecutionException
- if the processing of the exchange failedExchange send(String endpointUri, Processor processor)
Exchange.getException()
.endpointUri
- the endpoint URI to send the exchange toprocessor
- the transformer used to populate the new exchange Processor
to populate
the exchangeCamelExecutionException
- if the processing of the exchange failedExchange send(String endpointUri, ExchangePattern pattern, Processor processor)
Exchange.getException()
.endpointUri
- the endpoint URI to send the exchange topattern
- the message ExchangePattern
such as ExchangePattern.InOnly
or
ExchangePattern.InOut
processor
- the transformer used to populate the new exchange Processor
to populate the exchangeExchange send(Endpoint endpoint, Exchange exchange)
Exchange.getException()
.endpoint
- the endpoint to send the exchange toexchange
- the exchange to sendExchange send(Endpoint endpoint, Processor processor)
Exchange.getException()
.endpoint
- the endpoint to send the exchange toprocessor
- the transformer used to populate the new exchange Processor
to populate the exchangeExchange send(Endpoint endpoint, ExchangePattern pattern, Processor processor)
Exchange.getException()
.endpoint
- the endpoint to send the exchange topattern
- the message ExchangePattern
such as ExchangePattern.InOnly
or
ExchangePattern.InOut
processor
- the transformer used to populate the new exchange Processor
to populate the exchangeExchange send(Endpoint endpoint, ExchangePattern pattern, Processor processor, Processor resultProcessor)
Exchange.getException()
.endpoint
- the endpoint to send the exchange topattern
- the message ExchangePattern
such as ExchangePattern.InOnly
or
ExchangePattern.InOut
processor
- the transformer used to populate the new exchangeresultProcessor
- a processor to process the exchange when the send is complete. Processor
to
populate the exchangevoid sendBody(Endpoint endpoint, Object body) throws CamelExecutionException
CamelExecutionException
with the caused exception wrapped.endpoint
- the endpoint to send the exchange tobody
- the payloadCamelExecutionException
- if the processing of the exchange failedvoid sendBody(String endpointUri, Object body) throws CamelExecutionException
CamelExecutionException
with the caused exception wrapped.endpointUri
- the endpoint URI to send the exchange tobody
- the payloadCamelExecutionException
- if the processing of the exchange failedObject sendBody(Endpoint endpoint, ExchangePattern pattern, Object body) throws CamelExecutionException
ExchangePattern
returning any result output body CamelExecutionException
with the caused exception wrapped.endpoint
- the endpoint to send the exchange tobody
- the payloadpattern
- the message ExchangePattern
such as ExchangePattern.InOnly
or
ExchangePattern.InOut
ExchangePattern
is OUT capable, otherwise nullCamelExecutionException
- if the processing of the exchange failedObject sendBody(String endpointUri, ExchangePattern pattern, Object body) throws CamelExecutionException
CamelExecutionException
with the caused exception wrapped.endpointUri
- the endpoint URI to send the exchange topattern
- the message ExchangePattern
such as ExchangePattern.InOnly
or
ExchangePattern.InOut
body
- the payloadExchangePattern
is OUT capable, otherwise nullCamelExecutionException
- if the processing of the exchange failedvoid sendBodyAndHeader(String endpointUri, Object body, String header, Object headerValue) throws CamelExecutionException
CamelExecutionException
with the caused exception wrapped.endpointUri
- the endpoint URI to send tobody
- the payload to sendheader
- the header nameheaderValue
- the header valueCamelExecutionException
- if the processing of the exchange failedvoid sendBodyAndHeader(Endpoint endpoint, Object body, String header, Object headerValue) throws CamelExecutionException
CamelExecutionException
with the caused exception wrapped.endpoint
- the Endpoint to send tobody
- the payload to sendheader
- the header nameheaderValue
- the header valueCamelExecutionException
- if the processing of the exchange failedObject sendBodyAndHeader(Endpoint endpoint, ExchangePattern pattern, Object body, String header, Object headerValue) throws CamelExecutionException
CamelExecutionException
with the caused exception wrapped.endpoint
- the Endpoint to send topattern
- the message ExchangePattern
such as ExchangePattern.InOnly
or
ExchangePattern.InOut
body
- the payload to sendheader
- the header nameheaderValue
- the header valueExchangePattern
is OUT capable, otherwise nullCamelExecutionException
- if the processing of the exchange failedObject sendBodyAndHeader(String endpoint, ExchangePattern pattern, Object body, String header, Object headerValue) throws CamelExecutionException
CamelExecutionException
with the caused exception wrapped.endpoint
- the Endpoint URI to send topattern
- the message ExchangePattern
such as ExchangePattern.InOnly
or
ExchangePattern.InOut
body
- the payload to sendheader
- the header nameheaderValue
- the header valueExchangePattern
is OUT capable, otherwise nullCamelExecutionException
- if the processing of the exchange failedvoid sendBodyAndProperty(String endpointUri, Object body, String property, Object propertyValue) throws CamelExecutionException
CamelExecutionException
with the caused exception wrapped.endpointUri
- the endpoint URI to send tobody
- the payload to sendproperty
- the property namepropertyValue
- the property valueCamelExecutionException
- if the processing of the exchange failedvoid sendBodyAndProperty(Endpoint endpoint, Object body, String property, Object propertyValue) throws CamelExecutionException
CamelExecutionException
with the caused exception wrapped.endpoint
- the Endpoint to send tobody
- the payload to sendproperty
- the property namepropertyValue
- the property valueCamelExecutionException
- if the processing of the exchange failedObject sendBodyAndProperty(Endpoint endpoint, ExchangePattern pattern, Object body, String property, Object propertyValue) throws CamelExecutionException
CamelExecutionException
with the caused exception wrapped.endpoint
- the Endpoint to send topattern
- the message ExchangePattern
such as ExchangePattern.InOnly
or
ExchangePattern.InOut
body
- the payload to sendproperty
- the property namepropertyValue
- the property valueExchangePattern
is OUT capable, otherwise nullCamelExecutionException
- if the processing of the exchange failedObject sendBodyAndProperty(String endpoint, ExchangePattern pattern, Object body, String property, Object propertyValue) throws CamelExecutionException
CamelExecutionException
with the caused exception wrapped.endpoint
- the Endpoint URI to send topattern
- the message ExchangePattern
such as ExchangePattern.InOnly
or
ExchangePattern.InOut
body
- the payload to sendproperty
- the property namepropertyValue
- the property valueExchangePattern
is OUT capable, otherwise nullCamelExecutionException
- if the processing of the exchange failedvoid sendBodyAndHeaders(String endpointUri, Object body, Map<String,Object> headers) throws CamelExecutionException
CamelExecutionException
with the caused exception wrapped.endpointUri
- the endpoint URI to send tobody
- the payload to sendheaders
- headersCamelExecutionException
- if the processing of the exchange failedvoid sendBodyAndHeaders(Endpoint endpoint, Object body, Map<String,Object> headers) throws CamelExecutionException
CamelExecutionException
with the caused exception wrapped.endpoint
- the endpoint URI to send tobody
- the payload to sendheaders
- headersCamelExecutionException
- if the processing of the exchange failedObject sendBodyAndHeaders(String endpointUri, ExchangePattern pattern, Object body, Map<String,Object> headers) throws CamelExecutionException
CamelExecutionException
with the caused exception wrapped.endpointUri
- the endpoint URI to send topattern
- the message ExchangePattern
such as ExchangePattern.InOnly
or
ExchangePattern.InOut
body
- the payload to sendheaders
- headersExchangePattern
is OUT capable, otherwise nullCamelExecutionException
- if the processing of the exchange failedObject sendBodyAndHeaders(Endpoint endpoint, ExchangePattern pattern, Object body, Map<String,Object> headers) throws CamelExecutionException
CamelExecutionException
with the caused exception wrapped.endpoint
- the endpoint URI to send topattern
- the message ExchangePattern
such as ExchangePattern.InOnly
or
ExchangePattern.InOut
body
- the payload to sendheaders
- headersExchangePattern
is OUT capable, otherwise nullCamelExecutionException
- if the processing of the exchange failedExchange request(Endpoint endpoint, Processor processor)
ExchangePattern.InOut
message
exchange pattern. Exchange.getException()
.endpoint
- the Endpoint to send toprocessor
- the processor which will populate the exchange before sendingExchange request(String endpointUri, Processor processor)
ExchangePattern.InOut
message
exchange pattern. Exchange.getException()
.endpointUri
- the endpoint URI to send toprocessor
- the processor which will populate the exchange before sendingObject requestBody(Object body) throws CamelExecutionException
ExchangePattern.InOut
message exchange pattern. CamelExecutionException
with the caused exception wrapped.body
- the payload to sendCamelExecutionException
- if the processing of the exchange failed<T> T requestBody(Object body, Class<T> type) throws CamelExecutionException
ExchangePattern.InOut
message exchange pattern. CamelExecutionException
with the caused exception wrapped.body
- the payload to sendtype
- the expected response typeCamelExecutionException
- if the processing of the exchange failedObject requestBody(Endpoint endpoint, Object body) throws CamelExecutionException
ExchangePattern.InOut
message
exchange pattern. CamelExecutionException
with the caused exception wrapped.endpoint
- the Endpoint to send tobody
- the payloadCamelExecutionException
- if the processing of the exchange failed<T> T requestBody(Endpoint endpoint, Object body, Class<T> type) throws CamelExecutionException
ExchangePattern.InOut
message
exchange pattern. CamelExecutionException
with the caused exception wrapped.endpoint
- the Endpoint to send tobody
- the payloadtype
- the expected response typeCamelExecutionException
- if the processing of the exchange failedObject requestBody(String endpointUri, Object body) throws CamelExecutionException
ExchangePattern.InOut
message
exchange pattern. CamelExecutionException
with the caused exception wrapped.endpointUri
- the endpoint URI to send tobody
- the payloadCamelExecutionException
- if the processing of the exchange failed<T> T requestBody(String endpointUri, Object body, Class<T> type) throws CamelExecutionException
ExchangePattern.InOut
message
exchange pattern. CamelExecutionException
with the caused exception wrapped.endpointUri
- the endpoint URI to send tobody
- the payloadtype
- the expected response typeCamelExecutionException
- if the processing of the exchange failedObject requestBodyAndHeader(Object body, String header, Object headerValue) throws CamelExecutionException
ExchangePattern.InOut
message exchange pattern. CamelExecutionException
with the caused exception wrapped.body
- the payloadheader
- the header nameheaderValue
- the header valueCamelExecutionException
- if the processing of the exchange failedObject requestBodyAndHeader(Endpoint endpoint, Object body, String header, Object headerValue) throws CamelExecutionException
ExchangePattern.InOut
message
exchange pattern. CamelExecutionException
with the caused exception wrapped.endpoint
- the Endpoint to send tobody
- the payloadheader
- the header nameheaderValue
- the header valueCamelExecutionException
- if the processing of the exchange failed<T> T requestBodyAndHeader(Endpoint endpoint, Object body, String header, Object headerValue, Class<T> type) throws CamelExecutionException
ExchangePattern.InOut
message
exchange pattern. CamelExecutionException
with the caused exception wrapped.endpoint
- the Endpoint to send tobody
- the payloadheader
- the header nameheaderValue
- the header valuetype
- the expected response typeCamelExecutionException
- if the processing of the exchange failedObject requestBodyAndHeader(String endpointUri, Object body, String header, Object headerValue) throws CamelExecutionException
ExchangePattern.InOut
message
exchange pattern. CamelExecutionException
with the caused exception wrapped.endpointUri
- the endpoint URI to send tobody
- the payloadheader
- the header nameheaderValue
- the header valueCamelExecutionException
- if the processing of the exchange failed<T> T requestBodyAndHeader(String endpointUri, Object body, String header, Object headerValue, Class<T> type) throws CamelExecutionException
ExchangePattern.InOut
message
exchange pattern. CamelExecutionException
with the caused exception wrapped.endpointUri
- the endpoint URI to send tobody
- the payloadheader
- the header nameheaderValue
- the header valuetype
- the expected response typeCamelExecutionException
- if the processing of the exchange failedObject requestBodyAndHeaders(String endpointUri, Object body, Map<String,Object> headers) throws CamelExecutionException
ExchangePattern.InOut
message exchange pattern. CamelExecutionException
with the caused exception wrapped.endpointUri
- the endpoint URI to send tobody
- the payload to sendheaders
- headersCamelExecutionException
- if the processing of the exchange failed<T> T requestBodyAndHeaders(String endpointUri, Object body, Map<String,Object> headers, Class<T> type) throws CamelExecutionException
ExchangePattern.InOut
message exchange pattern. CamelExecutionException
with the caused exception wrapped.endpointUri
- the endpoint URI to send tobody
- the payload to sendheaders
- headerstype
- the expected response typeCamelExecutionException
- if the processing of the exchange failedObject requestBodyAndHeaders(Endpoint endpoint, Object body, Map<String,Object> headers) throws CamelExecutionException
ExchangePattern.InOut
message exchange pattern. CamelExecutionException
with the caused exception wrapped.endpoint
- the endpoint URI to send tobody
- the payload to sendheaders
- headersCamelExecutionException
- if the processing of the exchange failedObject requestBodyAndHeaders(Object body, Map<String,Object> headers) throws CamelExecutionException
ExchangePattern.InOut
message exchange pattern. CamelExecutionException
with the caused exception wrapped.body
- the payload to sendheaders
- headersCamelExecutionException
- if the processing of the exchange failed<T> T requestBodyAndHeaders(Endpoint endpoint, Object body, Map<String,Object> headers, Class<T> type) throws CamelExecutionException
ExchangePattern.InOut
message exchange pattern. CamelExecutionException
with the caused exception wrapped.endpoint
- the endpoint URI to send tobody
- the payload to sendheaders
- headerstype
- the expected response typeCamelExecutionException
- if the processing of the exchange failedvoid setExecutorService(ExecutorService executorService)
executorService
- the executor service.CompletableFuture<Exchange> asyncSend(String endpointUri, Exchange exchange)
endpointUri
- the endpoint URI to send the exchange toexchange
- the exchange to sendCompletableFuture<Exchange> asyncSend(String endpointUri, Processor processor)
endpointUri
- the endpoint URI to send the exchange toprocessor
- the transformer used to populate the new exchangeCompletableFuture<Object> asyncSendBody(String endpointUri, Object body)
ExchangePattern.InOnly
message exchange
pattern.endpointUri
- the endpoint URI to send the exchange tobody
- the body to sendCompletableFuture<Object> asyncRequestBody(String endpointUri, Object body)
ExchangePattern.InOut
message exchange pattern.endpointUri
- the endpoint URI to send the exchange tobody
- the body to sendCompletableFuture<Object> asyncRequestBodyAndHeader(String endpointUri, Object body, String header, Object headerValue)
ExchangePattern.InOut
message exchange pattern.endpointUri
- the endpoint URI to send the exchange tobody
- the body to sendheader
- the header nameheaderValue
- the header valueCompletableFuture<Object> asyncRequestBodyAndHeaders(String endpointUri, Object body, Map<String,Object> headers)
ExchangePattern.InOut
message exchange pattern.endpointUri
- the endpoint URI to send the exchange tobody
- the body to sendheaders
- headers<T> CompletableFuture<T> asyncRequestBody(String endpointUri, Object body, Class<T> type)
ExchangePattern.InOut
message exchange pattern.endpointUri
- the endpoint URI to send the exchange tobody
- the body to sendtype
- the expected response type<T> CompletableFuture<T> asyncRequestBodyAndHeader(String endpointUri, Object body, String header, Object headerValue, Class<T> type)
ExchangePattern.InOut
message exchange pattern.endpointUri
- the endpoint URI to send the exchange tobody
- the body to sendheader
- the header nameheaderValue
- the header valuetype
- the expected response type<T> CompletableFuture<T> asyncRequestBodyAndHeaders(String endpointUri, Object body, Map<String,Object> headers, Class<T> type)
ExchangePattern.InOut
message exchange pattern.endpointUri
- the endpoint URI to send the exchange tobody
- the body to sendheaders
- headerstype
- the expected response typeCompletableFuture<Exchange> asyncSend(Endpoint endpoint, Exchange exchange)
endpoint
- the endpoint to send the exchange toexchange
- the exchange to sendCompletableFuture<Exchange> asyncSend(Endpoint endpoint, Processor processor)
endpoint
- the endpoint to send the exchange toprocessor
- the transformer used to populate the new exchangeCompletableFuture<Object> asyncSendBody(Endpoint endpoint, Object body)
ExchangePattern.InOnly
message exchange
pattern.endpoint
- the endpoint to send the exchange tobody
- the body to sendCompletableFuture<Object> asyncRequestBody(Endpoint endpoint, Object body)
ExchangePattern.InOut
message exchange pattern.endpoint
- the endpoint to send the exchange tobody
- the body to sendCompletableFuture<Object> asyncRequestBodyAndHeader(Endpoint endpoint, Object body, String header, Object headerValue)
ExchangePattern.InOut
message exchange pattern.endpoint
- the endpoint to send the exchange tobody
- the body to sendheader
- the header nameheaderValue
- the header valueCompletableFuture<Object> asyncRequestBodyAndHeaders(Endpoint endpoint, Object body, Map<String,Object> headers)
ExchangePattern.InOut
message exchange pattern.endpoint
- the endpoint to send the exchange tobody
- the body to sendheaders
- headers<T> CompletableFuture<T> asyncRequestBody(Endpoint endpoint, Object body, Class<T> type)
ExchangePattern.InOut
message exchange pattern.endpoint
- the endpoint to send the exchange tobody
- the body to sendtype
- the expected response type<T> CompletableFuture<T> asyncRequestBodyAndHeader(Endpoint endpoint, Object body, String header, Object headerValue, Class<T> type)
ExchangePattern.InOut
message exchange pattern.endpoint
- the endpoint to send the exchange tobody
- the body to sendheader
- the header nameheaderValue
- the header valuetype
- the expected response type<T> CompletableFuture<T> asyncRequestBodyAndHeaders(Endpoint endpoint, Object body, Map<String,Object> headers, Class<T> type)
ExchangePattern.InOut
message exchange pattern.endpoint
- the endpoint to send the exchange tobody
- the body to sendheaders
- headerstype
- the expected response type<T> T extractFutureBody(Future<?> future, Class<T> type) throws CamelExecutionException
CamelExecutionException
with the caused exception wrapped.future
- the handle to get the responsetype
- the expected response typeCamelExecutionException
- if the processing of the exchange failed<T> T extractFutureBody(Future<?> future, long timeout, TimeUnit unit, Class<T> type) throws TimeoutException, CamelExecutionException
CamelExecutionException
with the caused exception wrapped.future
- the handle to get the responsetimeout
- the maximum time to waitunit
- the time unit of the timeout argumenttype
- the expected response typeTimeoutException
- if the wait timed outCamelExecutionException
- if the processing of the exchange failed@Deprecated CompletableFuture<Exchange> asyncCallback(String endpointUri, Exchange exchange, Synchronization onCompletion)
endpointUri
- the endpoint URI to send the exchange toexchange
- the exchange to sendonCompletion
- callback invoked when exchange has been completed@Deprecated CompletableFuture<Exchange> asyncCallback(Endpoint endpoint, Exchange exchange, Synchronization onCompletion)
endpoint
- the endpoint to send the exchange toexchange
- the exchange to sendonCompletion
- callback invoked when exchange has been completed@Deprecated CompletableFuture<Exchange> asyncCallback(String endpointUri, Processor processor, Synchronization onCompletion)
endpointUri
- the endpoint URI to send the exchange toprocessor
- the transformer used to populate the new exchange Processor
to populate the exchangeonCompletion
- callback invoked when exchange has been completed@Deprecated CompletableFuture<Exchange> asyncCallback(Endpoint endpoint, Processor processor, Synchronization onCompletion)
endpoint
- the endpoint to send the exchange toprocessor
- the transformer used to populate the new exchange Processor
to populate the exchangeonCompletion
- callback invoked when exchange has been completed@Deprecated CompletableFuture<Object> asyncCallbackSendBody(String endpointUri, Object body, Synchronization onCompletion)
ExchangePattern.InOnly
message exchange
pattern.endpointUri
- the endpoint URI to send the exchange tobody
- the body to sendonCompletion
- callback invoked when exchange has been completed@Deprecated CompletableFuture<Object> asyncCallbackSendBody(Endpoint endpoint, Object body, Synchronization onCompletion)
ExchangePattern.InOnly
message exchange
pattern.endpoint
- the endpoint to send the exchange tobody
- the body to sendonCompletion
- callback invoked when exchange has been completed@Deprecated CompletableFuture<Object> asyncCallbackRequestBody(String endpointUri, Object body, Synchronization onCompletion)
ExchangePattern.InOut
message exchange pattern.endpointUri
- the endpoint URI to send the exchange tobody
- the body to sendonCompletion
- callback invoked when exchange has been completed@Deprecated CompletableFuture<Object> asyncCallbackRequestBody(Endpoint endpoint, Object body, Synchronization onCompletion)
ExchangePattern.InOut
message exchange pattern.endpoint
- the endpoint to send the exchange tobody
- the body to sendonCompletion
- callback invoked when exchange has been completedApache Camel