0 Replies Latest reply on May 24, 2002 1:06 PM by Sudha K Varadarajan

    Why can't we republish/re-enqueue messages

    Sudha K Varadarajan Newbie

      In SpyTopicPublisher and SpyQueueSender, the publish/send methods assign a new messageID to the message, overwriting any existing message id. However, acknowledgement logic in AcknowledgementRequest.equals uses the messageID to compare messages. Hence, if a received message is republished into the message queue, it will never be removed from the unacknowledgedMessages list in BasicQueue, leading to memory leaks and other problems. The same behaviour will be seen if on receiving a message, a subscriber sets the JMS MessageID (which is not a common case, but is allowed by the implementation).

      The AcknowledgementRequest.equals should probably use some other id on the message which will not change when a message is republished into the message queue. This will enable using the message bus seamlessly for setting up process/message flows.