Top Description Fields Methods
org.springframework.messaging

public Interface PollableChannel

extends MessageChannel
Known Direct Implementers
org.springframework.messaging.core.GenericMessagingTemplate.TemporaryReplyChannel
Imports
org.springframework.lang.Nullable

A MessageChannel from which messages may be actively received through polling.
Author
Mark Fisher
Since
4.0

Field Summary

Inherited from org.springframework.messaging.MessageChannel:
INDEFINITE_TIMEOUT

Method Summary

Modifier and TypeMethod and Description
public Message<?>

Returns:

the next available Message or null if interrupted
receive
()

Receive a message from this channel, blocking indefinitely if necessary.

public Message<?>

Returns:

the next available Message or null if the specified timeout period elapses or the message reception is interrupted
receive
(long
the timeout in milliseconds or MessageChannel#INDEFINITE_TIMEOUT.
timeout
)

Receive a message from this channel, blocking until either a message is available or the specified timeout period elapses.

Inherited from org.springframework.messaging.MessageChannel:
sendsend

Method Detail

receiveback to summary
public Message<?> receive()

Receive a message from this channel, blocking indefinitely if necessary.

Returns:Message<?>

the next available Message or null if interrupted

Annotations
@Nullable
receiveback to summary
public 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:long

the timeout in milliseconds or MessageChannel#INDEFINITE_TIMEOUT.

Returns:Message<?>

the next available Message or null if the specified timeout period elapses or the message reception is interrupted

Annotations
@Nullable