BatchMessageListenerContainer using DMLC and Spring-batch

落花浮王杯 提交于 2019-12-12 02:02:48

问题


I am trying to setup a DMLC so that it picks up a certain amount of messages from a JMS broker (ActiveMQ) within the same transaction and should any error occur, the transaction is rolled back so that all message contained within that transaction end up in DLQ, or better yet, do not leave the broker.

I found an implementation for a BatchMessageListenerContainer using spring-batch under the spring-batch-infrastucture-tests repo (https://github.com/spring-projects/spring-batch/tree/master/spring-batch-infrastructure-tests) however the tests don't really do anything with the message.

Ideally I'd like to adapt so that the messages received in the message listener would somehow be bound to the RepeatContext so that actions done by repeatOperations can be performed on the messages too however the issue is that the method currently being intercepted, receiveAndExecute returns a boolean which is what actually gets passed to the RepeatContext and is available inside the RepeatOperations class. I am a little but uncertain how the whole Repeat**** class package works so is there any simple way to implement such a functionality?

来源:https://stackoverflow.com/questions/28175730/batchmessagelistenercontainer-using-dmlc-and-spring-batch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!