开发者

Does an ActiveMQ consumer need to be open when explicit acking messages?

My application does batch processing by reading messages from ActiveMQ. I read using the async JMS API by implementing MessageListener. But I ACK the messages only when the batch processing succeeds by calling message.acknowldge() [1].

What I ideally want is that till the batch processing is going on I do not receive any messages from the JMS broker. But I have doubt as to whether after closing t开发者_如何学编程he consumer, I would be able to ACK messages that I read earlier and which are being processed.

In other words, does explicit acknowledgment using message.acknowledge() require that the ActiveMQ consumer be open?

[1] http://download.oracle.com/javaee/5/api/javax/jms/Message.html#acknowledge%28%29


The consumer does not need to be open, but the session does. (Behind the scenes, it's the Session.sendAck method that does the work.)

Bruce

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜