Appendix C. The producer and consumer templates
Throughout this book, you’ve seen the ProducerTemplate used as an easy way of sending messages to a Camel endpoint. While it was simple to understand in those cases, there are many more options to the ProducerTemplate. There is also an analog for consumers—the ConsumerTemplate, which makes consuming messages easy.
Both of these templates are inspired by the template utility classes in the Spring Framework that simplify access to an API. In Spring, you may have used a JmsTemplate or JdbcTemplate to simplify access to the JMS and JDBC APIs. In the case of Camel, the ProducerTemplate and ConsumerTemplate interfaces allow you to easily work with producers and consumers.
By “easily work,” we mean ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access