<!--DEBUG:--><!--DEBUG:dc3-united-states-software-in-english-pdf-2--><!--DEBUG:--><!--DEBUG:dc3-united-states-software-in-english-pdf-2--><!--DEBUG-spv-->{"id":1849943,"date":"2021-02-28T09:05:00","date_gmt":"2021-02-28T07:05:00","guid":{"rendered":"http:\/\/nhub.news\/?p=1849943"},"modified":"2021-02-28T12:03:47","modified_gmt":"2021-02-28T10:03:47","slug":"apache-camel-integration-with-kafka","status":"publish","type":"post","link":"http:\/\/nhub.news\/ru\/2021\/02\/apache-camel-integration-with-kafka\/","title":{"rendered":"Apache Camel Integration with Kafka"},"content":{"rendered":"<p style=\"text-align: justify;\"><b>This article covers the integration of Apache Camel with Kafka, from setup to testing, with code blocks and plenty of pictures!<\/b><br \/>\nJoin the DZone community and get the full member experience. This article covers Apache Camel Integration with Kafka. Kafka Setup We will launch Kafka as a docker container. docker-compose.yml From the path of the docker-compose.yml file run the below command and observe that the Kafka cluster is successfully started. A screen like the below opens: Let us create 2 Springboot camel microservices, camel-demo-a and camel-demo-b camel-demo-a will publish the data to Kafka topic which will be consumed by camel-demo-b In the pom.xml of both the microservices, add the below dependency. Configure the Kafka broker URL in the application.properties Configuring the KafkaSenderRoute in camel-demo-a The route is configured to read from the file and publish to Kafka topic: Configuring the KafkaReceiverRoute in camel-demo-b Let us assume that the sender route is publishing a JSON message, which we will unmarshal and do some processing. To the pom.xml of camel-demo-b application, add below dependency: Creating the Model class: The route is configured to consume the message from the Kafka topic, unmarshal using the Jackson JSON library and do some processing. Start camel-demo-a application and place the json file in the input folder: The file will be read and the message will be published on the Kafka topic. Start camel-demo-b application. Observe that the route consumes the message from the Kafka topic, performs json unmarshalling, and further processing. Opinions expressed by DZone contributors are their own.<\/p>\n<script>jQuery(function(){jQuery(\".vc_icon_element-icon\").css(\"top\", \"0px\");});<\/script><script>jQuery(function(){jQuery(\"#td_post_ranks\").css(\"height\", \"10px\");});<\/script><script>jQuery(function(){jQuery(\".td-post-content\").find(\"p\").find(\"img\").hide();});<\/script>","protected":false},"excerpt":{"rendered":"<p>This article covers the integration of Apache Camel with Kafka, from setup to testing, with code blocks and plenty of pictures! Join the DZone community and get the full member experience. This article covers Apache Camel Integration with Kafka. Kafka Setup We will launch Kafka as a docker container. docker-compose.yml From the path of the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1849942,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[93],"tags":[],"_links":{"self":[{"href":"http:\/\/nhub.news\/ru\/wp-json\/wp\/v2\/posts\/1849943"}],"collection":[{"href":"http:\/\/nhub.news\/ru\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/nhub.news\/ru\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/nhub.news\/ru\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/nhub.news\/ru\/wp-json\/wp\/v2\/comments?post=1849943"}],"version-history":[{"count":1,"href":"http:\/\/nhub.news\/ru\/wp-json\/wp\/v2\/posts\/1849943\/revisions"}],"predecessor-version":[{"id":1849944,"href":"http:\/\/nhub.news\/ru\/wp-json\/wp\/v2\/posts\/1849943\/revisions\/1849944"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/nhub.news\/ru\/wp-json\/wp\/v2\/media\/1849942"}],"wp:attachment":[{"href":"http:\/\/nhub.news\/ru\/wp-json\/wp\/v2\/media?parent=1849943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/nhub.news\/ru\/wp-json\/wp\/v2\/categories?post=1849943"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/nhub.news\/ru\/wp-json\/wp\/v2\/tags?post=1849943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}