public class UserRegistryMessageHandler extends Object implements MessageHandler, ApplicationListener<BrokerAvailabilityEvent>
MultiServerUserRegistry
.Constructor and Description |
---|
UserRegistryMessageHandler(SimpUserRegistry userRegistry,
SimpMessagingTemplate brokerTemplate,
String broadcastDestination,
TaskScheduler scheduler) |
Modifier and Type | Method and Description |
---|---|
String |
getBroadcastDestination()
Return the destination for broadcasting user registry information to.
|
long |
getRegistryExpirationPeriod()
Return the configured registry expiration period.
|
void |
handleMessage(Message<?> message)
Handle the given message.
|
void |
onApplicationEvent(BrokerAvailabilityEvent event)
Handle an application event.
|
void |
setRegistryExpirationPeriod(long expirationPeriod)
Configure how long before a remote registry snapshot expires.
|
public UserRegistryMessageHandler(SimpUserRegistry userRegistry, SimpMessagingTemplate brokerTemplate, String broadcastDestination, TaskScheduler scheduler)
public String getBroadcastDestination()
public void setRegistryExpirationPeriod(long expirationPeriod)
By default this is set to 20000 (20 seconds).
expirationPeriod
- the expiration period in millisecondspublic long getRegistryExpirationPeriod()
public void onApplicationEvent(BrokerAvailabilityEvent event)
ApplicationListener
onApplicationEvent
in interface ApplicationListener<BrokerAvailabilityEvent>
event
- the event to respond topublic void handleMessage(Message<?> message) throws MessagingException
MessageHandler
handleMessage
in interface MessageHandler
message
- the message to be handledMessagingException