public interface Consumer extends Service, EndpointAware
Endpoint
.
Important: Do not do any initialization in the constructor. Instead use
BaseService.doInit()
or
BaseService.doStart()
.Modifier and Type | Method and Description |
---|---|
Exchange |
createExchange(boolean autoRelease)
Creates an
Exchange that was consumed. |
default AsyncCallback |
defaultConsumerCallback(Exchange exchange,
boolean autoRelease)
The default callback to use with the consumer when calling the processor using asynchronous routing.
|
Processor |
getProcessor()
The processor that will process the
Exchange that was consumed. |
void |
releaseExchange(Exchange exchange,
boolean autoRelease)
Releases the
Exchange when its completed processing and no longer needed. |
getEndpoint
Processor getProcessor()
Exchange
that was consumed.Exchange createExchange(boolean autoRelease)
Exchange
that was consumed.
Important: If the auto release parameter is set to false then the consumer is responsible for
calling the releaseExchange(Exchange, boolean)
when the Exchange
is done being routed. This is
for advanced consumers that need to have this control in their own hands. For normal use-cases then a consumer
can use autoRelease true and then Camel will automatic release the exchange after routing.autoRelease
- whether to auto release the exchange when routing is complete via UnitOfWork
void releaseExchange(Exchange exchange, boolean autoRelease)
Exchange
when its completed processing and no longer needed.exchange
- the exchangeautoRelease
- whether the exchange was created with auto releasedefault AsyncCallback defaultConsumerCallback(Exchange exchange, boolean autoRelease)
ExceptionHandler
to handle any exception on the
exchange and afterwards release the exchange.exchange
- the exchangeautoRelease
- whether the exchange was created with auto releaseApache Camel