[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how could I get multiple different ProducerTemplate instances with Auto-Configured Producer Templates

If I use the auto configured ProducerTemplate, how could I get multiple
different ProducerTemplate instances?

for example I need use producer template send different exchanges to
different endpoints
in this case, Do i need different producer template instances? if yes how ?
Auto-Configured Consumer and Producer Templates

Camel auto-configuration provides pre-configured *ConsumerTemplate* and
*ProducerTemplate* instances. You can simply inject them into your
Spring-managed beans:

public class InvoiceProcessor {

  private ProducerTemplate producerTemplate;

  private ConsumerTemplate consumerTemplate;
  public void processNextInvoice() {
    Invoice invoice = consumerTemplate.receiveBody("jms:invoices",