|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ConsumerTemplate
Template (named like Spring's TransactionTemplate & JmsTemplate
et al) for working with Camel and consuming Message
instances in an
Exchange
from an Endpoint
.
RuntimeCamelException
if consuming of
the Exchange
failed and an Exception occurred. The getCause
method on RuntimeCamelException
returns the wrapper original caused
exception.
All the receiveBody methods will return the content according to this strategy
RuntimeCamelException
as stated aboveService.stop()
the template.
ConsumerTemplate
as well.
Method Summary | ||
---|---|---|
void |
doneUoW(Exchange exchange)
If you have used any of the receive methods which returns a Exchange type
then you need to invoke this method when you are done using the returned Exchange . |
|
CamelContext |
getCamelContext()
Get the CamelContext |
|
int |
getCurrentCacheSize()
Gets an approximated size of the current cached resources in the backing cache pools. |
|
int |
getMaximumCacheSize()
Gets the maximum cache size used. |
|
Exchange |
receive(Endpoint endpoint)
Receives from the endpoint, waiting until there is a response. |
|
Exchange |
receive(Endpoint endpoint,
long timeout)
Receives from the endpoint, waiting until there is a response or the timeout occurs Important: See doneUoW(Exchange) |
|
Exchange |
receive(String endpointUri)
Receives from the endpoint, waiting until there is a response Important: See doneUoW(Exchange) |
|
Exchange |
receive(String endpointUri,
long timeout)
Receives from the endpoint, waiting until there is a response or the timeout occurs Important: See doneUoW(Exchange) |
|
Object |
receiveBody(Endpoint endpoint)
Receives from the endpoint, waiting until there is a response |
|
|
receiveBody(Endpoint endpoint,
Class<T> type)
Receives from the endpoint, waiting until there is a response |
|
Object |
receiveBody(Endpoint endpoint,
long timeout)
Receives from the endpoint, waiting until there is a response or the timeout occurs |
|
|
receiveBody(Endpoint endpoint,
long timeout,
Class<T> type)
Receives from the endpoint, waiting until there is a response or the timeout occurs |
|
Object |
receiveBody(String endpointUri)
Receives from the endpoint, waiting until there is a response |
|
|
receiveBody(String endpointUri,
Class<T> type)
Receives from the endpoint, waiting until there is a response |
|
Object |
receiveBody(String endpointUri,
long timeout)
Receives from the endpoint, waiting until there is a response or the timeout occurs |
|
|
receiveBody(String endpointUri,
long timeout,
Class<T> type)
Receives from the endpoint, waiting until there is a response or the timeout occurs |
|
Object |
receiveBodyNoWait(Endpoint endpoint)
Receives from the endpoint, not waiting for a response if non exists. |
|
|
receiveBodyNoWait(Endpoint endpoint,
Class<T> type)
Receives from the endpoint, not waiting for a response if non exists. |
|
Object |
receiveBodyNoWait(String endpointUri)
Receives from the endpoint, not waiting for a response if non exists. |
|
|
receiveBodyNoWait(String endpointUri,
Class<T> type)
Receives from the endpoint, not waiting for a response if non exists. |
|
Exchange |
receiveNoWait(Endpoint endpoint)
Receives from the endpoint, not waiting for a response if non exists. |
|
Exchange |
receiveNoWait(String endpointUri)
Receives from the endpoint, not waiting for a response if non exists. |
|
void |
setMaximumCacheSize(int maximumCacheSize)
Sets a custom maximum cache size. |
Methods inherited from interface org.apache.camel.Service |
---|
start, stop |
Method Detail |
---|
CamelContext getCamelContext()
CamelContext
int getMaximumCacheSize()
void setMaximumCacheSize(int maximumCacheSize)
maximumCacheSize
- the custom maximum cache sizeint getCurrentCacheSize()
Exchange receive(String endpointUri)
doneUoW(Exchange)
endpointUri
- the endpoint to receive from
Exchange receive(Endpoint endpoint)
doneUoW(Exchange)
endpoint
- the endpoint to receive from
doneUoW(Exchange)
Exchange receive(String endpointUri, long timeout)
doneUoW(Exchange)
endpointUri
- the endpoint to receive fromtimeout
- timeout in millis to wait for a response
doneUoW(Exchange)
Exchange receive(Endpoint endpoint, long timeout)
doneUoW(Exchange)
endpoint
- the endpoint to receive fromtimeout
- timeout in millis to wait for a response
doneUoW(Exchange)
Exchange receiveNoWait(String endpointUri)
doneUoW(Exchange)
endpointUri
- the endpoint to receive from
Exchange receiveNoWait(Endpoint endpoint)
doneUoW(Exchange)
endpoint
- the endpoint to receive from
Object receiveBody(String endpointUri)
endpointUri
- the endpoint to receive from
Object receiveBody(Endpoint endpoint)
endpoint
- the endpoint to receive from
Object receiveBody(String endpointUri, long timeout)
endpointUri
- the endpoint to receive fromtimeout
- timeout in millis to wait for a response
Object receiveBody(Endpoint endpoint, long timeout)
endpoint
- the endpoint to receive fromtimeout
- timeout in millis to wait for a response
Object receiveBodyNoWait(String endpointUri)
endpointUri
- the endpoint to receive from
Object receiveBodyNoWait(Endpoint endpoint)
endpoint
- the endpoint to receive from
<T> T receiveBody(String endpointUri, Class<T> type)
endpointUri
- the endpoint to receive fromtype
- the expected response type
<T> T receiveBody(Endpoint endpoint, Class<T> type)
endpoint
- the endpoint to receive fromtype
- the expected response type
<T> T receiveBody(String endpointUri, long timeout, Class<T> type)
endpointUri
- the endpoint to receive fromtimeout
- timeout in millis to wait for a responsetype
- the expected response type
<T> T receiveBody(Endpoint endpoint, long timeout, Class<T> type)
endpoint
- the endpoint to receive fromtimeout
- timeout in millis to wait for a responsetype
- the expected response type
<T> T receiveBodyNoWait(String endpointUri, Class<T> type)
endpointUri
- the endpoint to receive fromtype
- the expected response type
<T> T receiveBodyNoWait(Endpoint endpoint, Class<T> type)
endpoint
- the endpoint to receive fromtype
- the expected response type
void doneUoW(Exchange exchange)
Exchange
type
then you need to invoke this method when you are done using the returned Exchange
.
This is needed to ensure any Synchronization
works is being executed.
For example if you consumed from a file endpoint, then the consumed file is only moved/delete when
you done the Exchange
.
Note for all the other receive methods which does not return a Exchange
type,
the done has been executed automatic by Camel itself.
exchange
- the exchange
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |