azure-service-bus-java
azure-service-bus-java copied to clipboard
add support for batch handler to MessageAndSessionPump
Actual Behavior
MessageAndSessionPump does not support a batch interface
Expected Behavior
MessageAndSessionPump should support a batch handler.
The underlying MessageReceiver has a receiveBatch
method that could be used to relay a batch of messages to a batch handler.
Our use case requires inspection of a database entity for each message received. Doing this per-message is not viable so we need to batch the call. Since the message is ack'd on return from the handler, we need a handler which accepts a collection of messages which are all ack'd on return. We can do this by using the more basic MessageReceiver but then we lose all functionality the pump gives us.
This issue suggests a specific solution (add batch support to MessageAndSessionPump) but really we just need support for a batch callback, however it's implemented.