Package org.springframework.messaging
Interface PollableChannel
- All Superinterfaces:
MessageChannel
public interface PollableChannel extends MessageChannel
AMessageChannel
from which messages may be actively received through polling.- Since:
- 4.0
- Author:
- Mark Fisher
Field Summary
Fields inherited from interface org.springframework.messaging.MessageChannel
INDEFINITE_TIMEOUT
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Message<?>
receive()
Receive a message from this channel, blocking indefinitely if necessary.Message<?>
receive(long timeout)
Receive a message from this channel, blocking until either a message is available or the specified timeout period elapses.Methods inherited from interface org.springframework.messaging.MessageChannel
send, send
Method Detail
receive
@Nullable Message<?> receive()
Receive a message from this channel, blocking indefinitely if necessary.- Returns:
- the next available
Message
ornull
if interrupted
receive
@Nullable Message<?> receive(long timeout)
Receive a message from this channel, blocking until either a message is available or the specified timeout period elapses.- Parameters:
timeout
- the timeout in milliseconds orMessageChannel.INDEFINITE_TIMEOUT
.- Returns:
- the next available
Message
ornull
if the specified timeout period elapses or the message reception is interrupted