Top Description Fields Constructors Methods
org.springframework.messaging.simp.config

public Class SimpleBrokerRegistration

extends AbstractBrokerRegistration
Class Inheritance
Imports
org.springframework.lang.Nullable, org.springframework.messaging.MessageChannel, .SubscribableChannel, org.springframework.messaging.simp.broker.SimpleBrokerMessageHandler, org.springframework.scheduling.TaskScheduler

Registration class for configuring a SimpleBrokerMessageHandler.
Authors
Rossen Stoyanchev, Sam Brannen
Since
4.0

Field Summary

Modifier and TypeField and Description
private long[]
private String
private TaskScheduler

Constructor Summary

AccessConstructor and Description
public
SimpleBrokerRegistration(SubscribableChannel
the inbound channel
clientInboundChannel
,
MessageChannel
the outbound channel
clientOutboundChannel
,
String[]
the destination prefixes
destinationPrefixes
)

Create a new SimpleBrokerRegistration.

Method Summary

Modifier and TypeMethod and Description
protected SimpleBrokerMessageHandler
public SimpleBrokerRegistration
setHeartbeatValue(long[] heartbeat)

Configure the value for the heartbeat settings.

public void
setSelectorHeaderName(String
the name to use for a selector header, or null or blank to disable selector header support
selectorHeaderName
)

Configure the name of a header that a subscription message can have for the purpose of filtering messages matched to the subscription.

public SimpleBrokerRegistration
setTaskScheduler(TaskScheduler taskScheduler)

Configure the org.springframework.scheduling.TaskScheduler to use for providing heartbeat support.

Inherited from org.springframework.messaging.simp.config.AbstractBrokerRegistration:
getClientInboundChannelgetClientOutboundChannelgetDestinationPrefixes

Field Detail

heartbeatback to summary
private long[] heartbeat
Annotations
@Nullable
selectorHeaderNameback to summary
private String selectorHeaderName
Annotations
@Nullable
taskSchedulerback to summary
private TaskScheduler taskScheduler
Annotations
@Nullable

Constructor Detail

SimpleBrokerRegistrationback to summary
public SimpleBrokerRegistration(SubscribableChannel clientInboundChannel, MessageChannel clientOutboundChannel, String[] destinationPrefixes)

Create a new SimpleBrokerRegistration.

Parameters
clientInboundChannel:SubscribableChannel

the inbound channel

clientOutboundChannel:MessageChannel

the outbound channel

destinationPrefixes:String[]

the destination prefixes

Method Detail

getMessageHandlerback to summary
protected SimpleBrokerMessageHandler getMessageHandler(SubscribableChannel brokerChannel)

Implements abstract org.springframework.messaging.simp.config.AbstractBrokerRegistration.getMessageHandler.

Annotations
@Override
setHeartbeatValueback to summary
public SimpleBrokerRegistration setHeartbeatValue(long[] heartbeat)

Configure the value for the heartbeat 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 taskScheduler in which case the default becomes "10000,10000" (in milliseconds).

Since
4.2
setSelectorHeaderNameback 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 null which disables this feature. You can set it to "selector" or a different name to enable support for a selector header.

Parameters
selectorHeaderName:String

the name to use for a selector header, or null or blank to disable selector header support

Since
4.3.17
setTaskSchedulerback to summary
public SimpleBrokerRegistration setTaskScheduler(TaskScheduler taskScheduler)

Configure the org.springframework.scheduling.TaskScheduler to use for providing heartbeat support. Setting this property also sets the heartbeatValue to "10000, 10000".

By default this is not set.

Since
4.2