Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: [Spring Boot] Added templates information

...

Code Block
xml
xml
camel.springboot.jmxEnabled = false

Auto-configured consumer and producer templates

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

Code Block
languagejava
@Component
public class InvoiceProcessor {

  @Autowired
  private ProducerTemplate producerTemplate;

  @Autowired
  private ConsumerTemplate consumerTemplate;
  public void processNextInvoice() {
    Invoice invoice = consumerTemplate.receiveBody("jms:invoices", Invoice.class);
    ...
    producerTemplate.sendBody("netty-http:http://invoicing.com/received/" + invoice.id());
  }

}

By default consumer and producer templates comes with the endpoint cache sizes equal to 1000. You can change that values via the following Spring properties:

Code Block
xml
xml
camel.springboot.consumerTemplateCacheSize = 100
camel.springboot.producerTemplateCacheSize = 200

 


Include Page
Endpoint See Also
Endpoint See Also