使用 AMQP RabbitMQ 进行 Spring Batch
我想使用 String Batch 从 RabbitMQ / AMQP 获取数据。 我想加载 100 条消息(或者如果 100 条没有出现,则表示超时后出现的消息数),然后将其放入列表中。 我有一个 RabbitMQ 正在运行,我只想从其中获取每 100 个包中的数据并将其集中到列表中。
我读过有关 Spring Batch 的内容,我发现它可以使用 org.springframework.batch.item.file.FlatFileItemReader 从文件(例如 CSV)中读取。 但我不知道如何从兔子队列中读取?或者说有可能吗?
亲切的问候,
拉法尔
I'd like to use String Batch to get the data from RabbitMQ / AMQP.
I want to load 100 messages (or if 100 doesn't come, the number of messsages camed after some timeout) and then put it into the list.
I have a RabbitMQ working, i'd just like to get the data from it in packages per 100 and concentrate it to the list.
I have read about Spring Batch, i found that this can read from files (ex. CSV) using org.springframework.batch.item.file.FlatFileItemReader
.
But I dont know how to read from a Rabbit Queue? Or is it even possible?
Kind Regards,
Rafał
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你看过 Spring-AMQP 吗?
Have you taken a look at Spring-AMQP?
这是 Spring Batch AMQP ItemReader / ItemWriter 实现。
https://dzone.com/articles/batch-使用 spring-batch-and-amqp-easy 进行处理
Here is a Spring Batch AMQP ItemReader / ItemWriter implementation.
https://dzone.com/articles/batch-processing-with-spring-batch-and-amqp-easier