SimpMessageType, keeps track of subscriptions with the help of a
SubscriptionRegistry, and sends messages to subscribers.
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private Integer | |
| private static final byte[] | |
| private MessageHeaderInitializer | |
| private ScheduledFuture | |
| private long[] | |
| private PathMatcher | |
| private String | |
| private final Map | |
| private SubscriptionRegistry | |
| private TaskScheduler |
| Access | Constructor and Description |
|---|---|
| public | SimpleBrokerMessageHandler(SubscribableChannel
the channel for receiving messages from clients (e.g. WebSocket clients) clientInboundChannel, MessageChannel the channel for sending messages to clients (e.g. WebSocket clients) clientOutboundChannel, SubscribableChannel the channel for the application to send messages to the broker brokerChannel, Collection<String> prefixes to use to filter out messages destinationPrefixes)Create a SimpleBrokerMessageHandler instance with the given message channels and destination prefixes. |
| Modifier and Type | Method and Description |
|---|---|
| public MessageHeaderInitializer | |
| public long[] | |
| public SubscriptionRegistry | |
| public TaskScheduler | |
| private void | |
| protected void | handleMessageInternal(Message<?> message)
Implements abstract org. |
| private void | |
| private void | |
| private Duration | |
| private void | |
| private void | |
| private void | |
| protected void | |
| public void | setCacheLimit(Integer cacheLimit)
When configured, the specified cache limit is passed down to the underlying SubscriptionRegistry, overriding any default there. |
| public void | setHeaderInitializer(MessageHeaderInitializer headerInitializer)
Configure a |
| public void | |
| public void | setPathMatcher(PathMatcher pathMatcher)
When configured, the given PathMatcher is passed down to the underlying SubscriptionRegistry to use for matching destination to subscriptions. |
| public void | setSelectorHeaderName(String
the name to use for a selector header, or selectorHeaderName)null
or blank to disable selector header supportConfigure the name of a header that a subscription message can have for the purpose of filtering messages matched to the subscription. |
| public void | setSubscriptionRegistry(SubscriptionRegistry subscriptionRegistry)
Configure a custom |
| public void | setTaskScheduler(TaskScheduler taskScheduler)
Configure the |
| public void | |
| public void | |
| public String | |
| private void |
| cacheLimit | back to summary |
|---|---|
| private Integer cacheLimit
| |
| EMPTY_PAYLOAD | back to summary |
|---|---|
| private static final byte[] EMPTY_PAYLOAD | |
| headerInitializer | back to summary |
|---|---|
| private MessageHeaderInitializer headerInitializer
| |
| heartbeatFuture | back to summary |
|---|---|
| private ScheduledFuture<?> heartbeatFuture
| |
| heartbeatValue | back to summary |
|---|---|
| private long[] heartbeatValue
| |
| pathMatcher | back to summary |
|---|---|
| private PathMatcher pathMatcher
| |
| selectorHeaderName | back to summary |
|---|---|
| private String selectorHeaderName
| |
| sessions | back to summary |
|---|---|
| private final Map<String, SimpleBrokerMessageHandler. | |
| subscriptionRegistry | back to summary |
|---|---|
| private SubscriptionRegistry subscriptionRegistry | |
| taskScheduler | back to summary |
|---|---|
| private TaskScheduler taskScheduler
| |
| SimpleBrokerMessageHandler | back to summary |
|---|---|
| public SimpleBrokerMessageHandler(SubscribableChannel clientInboundChannel, MessageChannel clientOutboundChannel, SubscribableChannel brokerChannel, Collection<String> destinationPrefixes) Create a SimpleBrokerMessageHandler instance with the given message channels and destination prefixes.
| |
| getHeaderInitializer | back to summary |
|---|---|
| public MessageHeaderInitializer getHeaderInitializer() Return the configured header initializer.
| |
| getHeartbeatValue | back to summary |
|---|---|
| public long[] getHeartbeatValue() The configured value for the heart-beat settings.
| |
| getSubscriptionRegistry | back to summary |
|---|---|
| public SubscriptionRegistry getSubscriptionRegistry() | |
| getTaskScheduler | back to summary |
|---|---|
| public TaskScheduler getTaskScheduler() Return the configured TaskScheduler.
| |
| handleDisconnect | back to summary |
|---|---|
| private void handleDisconnect(String sessionId, Principal user, Message<?> origMessage) | |
| handleMessageInternal | back to summary |
|---|---|
| protected void handleMessageInternal(Message<?> message) Implements abstract org.
| |
| initCacheLimitToUse | back to summary |
|---|---|
| private void initCacheLimitToUse() | |
| initHeaders | back to summary |
|---|---|
| private void initHeaders(SimpMessageHeaderAccessor accessor) | |
| initHeartbeatTaskDelay | back to summary |
|---|---|
| private Duration initHeartbeatTaskDelay() | |
| initPathMatcherToUse | back to summary |
|---|---|
| private void initPathMatcherToUse() | |
| initSelectorHeaderNameToUse | back to summary |
|---|---|
| private void initSelectorHeaderNameToUse() | |
| logMessage | back to summary |
|---|---|
| private void logMessage(Message<?> message) | |
| sendMessageToSubscribers | back to summary |
|---|---|
| protected void sendMessageToSubscribers(String destination, Message<?> message) | |
| setCacheLimit | back to summary |
|---|---|
| public void setCacheLimit(Integer cacheLimit) When configured, the specified cache limit is passed down to the underlying SubscriptionRegistry, overriding any default there. With a standard Setting this property has no effect if the underlying SubscriptionRegistry
is not an instance of | |
| setHeaderInitializer | back to summary |
|---|---|
| public void setHeaderInitializer(MessageHeaderInitializer headerInitializer) Configure a By default this property is not set.
| |
| setHeartbeatValue | back to summary |
|---|---|
| public void setHeartbeatValue(long[] heartbeat) Configure the value for the heart-beat settings. The first number represents how often the server will write or send a heartbeat. The second is how often the client should write. 0 means no heartbeats. By default this is set to "0, 0" unless the
| |
| setPathMatcher | back to summary |
|---|---|
| public void setPathMatcher(PathMatcher pathMatcher) When configured, the given PathMatcher is passed down to the underlying SubscriptionRegistry to use for matching destination to subscriptions. Default is a standard Setting this property has no effect if the underlying SubscriptionRegistry
is not an instance of | |
| setSelectorHeaderName | back to summary |
|---|---|
| public void setSelectorHeaderName(String selectorHeaderName) Configure the name of a header that a subscription message can have for the purpose of filtering messages matched to the subscription. The header value is expected to be a Spring Expression Language (SpEL) boolean expression to be applied to the headers of messages matched to the subscription. For example: headers.foo == 'bar' By default the selector header name is set to Setting this property has no effect if the underlying SubscriptionRegistry
is not an instance of
| |
| setSubscriptionRegistry | back to summary |
|---|---|
| public void setSubscriptionRegistry(SubscriptionRegistry subscriptionRegistry) Configure a custom Note If the custom registry is not an instance of
| |
| setTaskScheduler | back to summary |
|---|---|
| public void setTaskScheduler(TaskScheduler taskScheduler) Configure the By default this is not set.
| |
| startInternal | back to summary |
|---|---|
| public void startInternal() Overrides org.
| |
| stopInternal | back to summary |
|---|---|
| public void stopInternal() Overrides org.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| updateSessionReadTime | back to summary |
|---|---|
| private void updateSessionReadTime(String sessionId) | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| HeartbeatTask | back to summary |
|---|---|
| private HeartbeatTask() | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final MessageChannel | |
| private static final long | |
| private volatile long | |
| private volatile long | |
| private final long | |
| private final String | |
| private final Principal | |
| private final long |
| Access | Constructor and Description |
|---|---|
| public | SessionInfo(String sessionId, Principal user, MessageChannel outboundChannel, long[] clientHeartbeat, long[] serverHeartbeat)
|
| Modifier and Type | Method and Description |
|---|---|
| public MessageChannel | |
| public long | |
| public long | |
| public long | |
| public String | |
| public Principal | |
| public long | |
| public void | |
| public void |
| clientOutboundChannel | back to summary |
|---|---|
| private final MessageChannel clientOutboundChannel | |
| HEARTBEAT_MULTIPLIER | back to summary |
|---|---|
| private static final long HEARTBEAT_MULTIPLIER | |
| lastReadTime | back to summary |
|---|---|
| private volatile long lastReadTime | |
| lastWriteTime | back to summary |
|---|---|
| private volatile long lastWriteTime | |
| readInterval | back to summary |
|---|---|
| private final long readInterval | |
| sessionId | back to summary |
|---|---|
| private final String sessionId | |
| user | back to summary |
|---|---|
| private final Principal user
| |
| writeInterval | back to summary |
|---|---|
| private final long writeInterval | |
| SessionInfo | back to summary |
|---|---|
| public SessionInfo(String sessionId, Principal user, MessageChannel outboundChannel, long[] clientHeartbeat, long[] serverHeartbeat) | |
| getClientOutboundChannel | back to summary |
|---|---|
| public MessageChannel getClientOutboundChannel() | |
| getLastReadTime | back to summary |
|---|---|
| public long getLastReadTime() | |
| getLastWriteTime | back to summary |
|---|---|
| public long getLastWriteTime() | |
| getReadInterval | back to summary |
|---|---|
| public long getReadInterval() | |
| getSessionId | back to summary |
|---|---|
| public String getSessionId() | |
| getUser | back to summary |
|---|---|
public Principal getUser()
| |
| getWriteInterval | back to summary |
|---|---|
| public long getWriteInterval() | |
| setLastReadTime | back to summary |
|---|---|
| public void setLastReadTime(long lastReadTime) | |
| setLastWriteTime | back to summary |
|---|---|
| public void setLastWriteTime(long lastWriteTime) | |