类 SimpleBrokerRegistration
- java.lang.Object
- org.springframework.messaging.simp.config.AbstractBrokerRegistration
- org.springframework.messaging.simp.config.SimpleBrokerRegistration
public class SimpleBrokerRegistration extends AbstractBrokerRegistration
Registration class for configuring aSimpleBrokerMessageHandler
.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 SimpleBrokerRegistration(SubscribableChannel inChannel, MessageChannel outChannel, String[] prefixes)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected SimpleBrokerMessageHandler
getMessageHandler(SubscribableChannel brokerChannel)
SimpleBrokerRegistration
setHeartbeatValue(long[] heartbeat)
Configure the value for the heartbeat settings.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.SimpleBrokerRegistration
setTaskScheduler(TaskScheduler taskScheduler)
Configure theTaskScheduler
to use for providing heartbeat support.从类继承的方法 org.springframework.messaging.simp.config.AbstractBrokerRegistration
getClientInboundChannel, getClientOutboundChannel, getDestinationPrefixes
构造器详细资料
SimpleBrokerRegistration
public SimpleBrokerRegistration(SubscribableChannel inChannel, MessageChannel outChannel, String[] prefixes)
方法详细资料
setTaskScheduler
public SimpleBrokerRegistration setTaskScheduler(TaskScheduler taskScheduler)
Configure theTaskScheduler
to use for providing heartbeat support. Setting this property also sets theheartbeatValue
to "10000, 10000".By default this is not set.
- 从以下版本开始:
- 4.2
setHeartbeatValue
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).- 从以下版本开始:
- 4.2
setSelectorHeaderName
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 EL boolean expression to be applied to the headers of messages matched to the subscription.For example:
headers.foo == 'bar'
By default this is set to "selector". You can set it to a different name, or to
null
to turn off support for a selector header.- 参数:
selectorHeaderName
- the name to use for a selector header- 从以下版本开始:
- 4.3.17
getMessageHandler
protected SimpleBrokerMessageHandler getMessageHandler(SubscribableChannel brokerChannel)