Spring AMQP

org.springframework.amqp.rabbit.retry
Interface NewMessageIdentifier


public interface NewMessageIdentifier

An optimization for stateful retry of message processing. If a message is known to be "new", i.e. never consumed before by this or any other client, then there are potential optimizations for managing the state associated with tracking the processing of a message (e.g. there is no need to check a cache for a hit).

Author:
Dave Syer

Method Summary
 boolean isNew(Message message)
          Query a message to see if it has been seen before.
 

Method Detail

isNew

boolean isNew(Message message)
Query a message to see if it has been seen before. Usually it is only possible to know if it has definitely not been seen before (e.g. through the redelivered flag, which would be used by default). Clients can customize the retry behaviour for failed messages by implementing this method.

Parameters:
message - the message to test
Returns:
true if the message is known to not have been consumed before

Spring AMQP

Copyright © 2011. All Rights Reserved.