public abstract class KeyspaceEventMessageListener extends Object implements MessageListener, InitializingBean, DisposableBean
MessageListener implementation for listening to Redis keyspace notifications.| Constructor and Description |
|---|
KeyspaceEventMessageListener(RedisMessageListenerContainer listenerContainer)
Creates new
KeyspaceEventMessageListener. |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
destroy() |
protected abstract void |
doHandleMessage(Message message)
Handle the actual message
|
protected void |
doRegister(RedisMessageListenerContainer container)
Register instance within the container.
|
void |
init()
Initialize the message listener by writing requried redis config for notify-keyspace-events and
registering the listener within the container.
|
void |
onMessage(Message message,
byte[] pattern)
Callback for processing received objects through Redis.
|
void |
setKeyspaceNotificationsConfigParameter(String keyspaceNotificationsConfigParameter)
Set the configuration string to use for notify-keyspace-events.
|
public KeyspaceEventMessageListener(RedisMessageListenerContainer listenerContainer)
KeyspaceEventMessageListener.listenerContainer - must not be null.public void onMessage(Message message, @Nullable byte[] pattern)
MessageListeneronMessage in interface MessageListenermessage - message must not be null.pattern - pattern matching the channel (if specified) - can be null.protected abstract void doHandleMessage(Message message)
message - never null.public void init()
protected void doRegister(RedisMessageListenerContainer container)
container - never null.public void destroy()
throws Exception
destroy in interface DisposableBeanExceptionpublic void setKeyspaceNotificationsConfigParameter(String keyspaceNotificationsConfigParameter)
keyspaceNotificationsConfigParameter - can be null.public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionCopyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.