org.apache.camel
Interface ProducerCallback<T>


public interface ProducerCallback<T>

Callback for sending a exchange message to a endpoint using a producer.

Using this callback as a template pattern ensures that Camel handles the resource handling and will start and stop the given producer, to avoid resource leaks.

Version:

Method Summary
 T doInProducer(Producer producer, Exchange exchange, ExchangePattern exchangePattern)
          Performs operation on the given producer to send the given exchange.
 

Method Detail

doInProducer

T doInProducer(Producer producer,
               Exchange exchange,
               ExchangePattern exchangePattern)
               throws Exception
Performs operation on the given producer to send the given exchange.

Parameters:
producer - the producer, is never null
exchange - the exchange, can be null if so then create a new exchange from the producer
exchangePattern - the exchange pattern, can be null
Returns:
the response
Throws:
Exception - if an internal processing error has occurred.


Apache CAMEL