public class SimpleActiveIdleMessageSourceAdvice extends AbstractMessageSourceAdvice
DynamicPeriodicTrigger
Constructor and Description |
---|
SimpleActiveIdleMessageSourceAdvice(DynamicPeriodicTrigger trigger) |
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.
|
void |
setActivePollPeriod(long activePollPeriod)
Set the poll period when messages are returned.
|
void |
setIdlePollPeriod(long idlePollPeriod)
Set the poll period when messages are not returned.
|
invoke
public SimpleActiveIdleMessageSourceAdvice(DynamicPeriodicTrigger trigger)
public void setIdlePollPeriod(long idlePollPeriod)
idlePollPeriod
- the period in milliseconds.public void setActivePollPeriod(long activePollPeriod)
activePollPeriod
- the period in milliseconds.public boolean beforeReceive(MessageSource<?> source)
AbstractMessageSourceAdvice
beforeReceive
in class AbstractMessageSourceAdvice
source
- the message source.public Message<?> afterReceive(Message<?> result, MessageSource<?> source)
AbstractMessageSourceAdvice
trigger
. The message can also be replaced with a new one.afterReceive
in class AbstractMessageSourceAdvice
result
- the received message.source
- the message source.