同步操作将从 寒松/camel-spring-boot-examples2 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
An example which shows how to integrate Camel with Kafka offsetRepository(consumer) to use in order to locally store the offset of each partition of the topic
This project consists of the following examples:
Producer triggers with a timer and produces messages to the configured topic partition
Consumer consumes from configured topic by reading the offset value from locally stored file.
This example requires that Kafka Server is up and running.
$ ${KAFKA}/bin/zookeeper-server-start.sh ${KAFKA}/config/zookeeper.properties
$ ${KAFKA}/bin/kafka-server-start.sh ${KAFKA}/config/server.properties
You will need to create following topics before you run the examples.
On windows run
$ ${KAFKA}/bin/kafka-topics.bat --create --zookeeper <zookeeper host ip>:<port> --replication-factor 1 --partitions 1 --topic my-topic
On linux run
$ ${KAFKA}/bin/kafka-topics.sh --create --zookeeper <zookeeper host ip>:<port> --replication-factor 1 --partitions 1 --topic my-topic
Run the consumer first in separate shell
$ mvn spring-boot:run
camel-context.xml file has both kafka-producer and kafka-consumer routes defined to produce/consume messages to topic my-topic.
Press Ctrl-C
to exit.
You can configure the details in the file:
src/main/resources/application.properties
You can enable verbose logging by adjusting the src/main/resources/log4j2.properties
file as documented in the file.
If you hit any problem using Camel or have some feedback, then please let us know.
We also love contributors, so get involved :-)
The Camel riders!
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。