Feb 18th, 2013, 11:43 AM
non-stop batch engine
I have a problem that a lot of ppl write about but in the other direction it seems.
I have a ItemReader that reads items from a RabbitTemplate to get messages from RabbitMQ. Each message should be processed in parallel (but it should only take as many as it can process in one go).
The problem is, that the messages come in bursts, do sometimes the engine can end up going for a long time, but sometimes it stops because there are no messages (ItemReader returns null). I do NOT want it to stop.
Is is possible to make the batch engine just wait until there is something to read, instead of exiting execution when ItemReader returns null?
In case I would go with a Spring Integration approach, and handle message polling from SI, is there a way to invoke/start the spring batch process from beans, and not re-queue or loose the initial message?
Many thanks for any advice,