public class RotatingServerAdvice extends AbstractMessageSourceAdvice
| 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.
|
invokepublic 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)
MessageSourceMutatorsource - the message source.public Message<?> afterReceive(Message<?> result, MessageSource<?> source)
MessageSourceMutatortrigger. The message can also be replaced with a new one.result - the received message.source - the message source.