spring batch with AMQP Listener -
i want utilize spring batch rabbitmq listener
when message received, first step called , repeat treatment after each message reciption
this listener : public class mymessagelistener implements messagelistener {
@override public void onmessage(message msg) { string messagebody= new string(msg.getbody()); logger.info("listener received message {}", messagebody); gson gson = new gson(); //call spring batch step generate study //todo }
}
you can utilize spring batch integration , joblaunchinggateway
launch job each message.
however, if want multiple messages comprise "batch", should utilize rabbittemplate
within itemreader
receive()
messages want processed batch (instead of listener).
spring spring-batch spring-rabbit
No comments:
Post a Comment