public class RotatingServerAdvice extends AbstractMessageSourceAdvice implements MessageSourceMutator
| Constructor and Description |
|---|
RotatingServerAdvice(DelegatingSessionFactory<?> factory,
List<RotationPolicy.KeyDirectory> keyDirectories)
Create an instance that rotates to the next server/directory if no message is
received.
|
RotatingServerAdvice(DelegatingSessionFactory<?> factory,
List<RotationPolicy.KeyDirectory> keyDirectories,
boolean fair)
Create an instance that rotates to the next server/directory depending on the fair
argument.
|
RotatingServerAdvice(RotationPolicy rotationPolicy)
Construct an instance that rotates according to the supplied
RotationPolicy. |
| Modifier and Type | Method and Description |
|---|---|
Message<?> |
afterReceive(Message<?> result,
MessageSource<?> source)
Subclasses can take actions based on the result of the poll; e.g.
|
boolean |
beforeReceive(MessageSource<?> source)
Subclasses can decide whether to proceed with this poll.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitafterReceive, beforeReceiveinvokepublic RotatingServerAdvice(DelegatingSessionFactory<?> factory, List<RotationPolicy.KeyDirectory> keyDirectories)
factory - the DelegatingSessionFactory.keyDirectories - a list of RotationPolicy.KeyDirectory.public RotatingServerAdvice(DelegatingSessionFactory<?> factory, List<RotationPolicy.KeyDirectory> keyDirectories, boolean fair)
factory - the DelegatingSessionFactory.keyDirectories - a list of RotationPolicy.KeyDirectory.fair - true to rotate on every poll, false to rotate when no message is received.public RotatingServerAdvice(RotationPolicy rotationPolicy)
RotationPolicy.rotationPolicy - the policy.public boolean beforeReceive(MessageSource<?> source)
MessageSourceMutatorbeforeReceive in interface MessageSourceMutatorsource - the message source.@Nullable public Message<?> afterReceive(@Nullable Message<?> result, MessageSource<?> source)
MessageSourceMutatortrigger. The message can also be replaced with a new one.afterReceive in interface MessageSourceMutatorresult - the received message.source - the message source.