E
- message type@FunctionalInterface public interface MessageListener<E> extends EventListener
ITopic
.
A MessageListener will never be called concurrently (provided that it's not registered twice). So there is no need to synchronize access to the state it reads or writes. Also there is no need to synchronize when publishing to the ITopic, the ITopic is responsible for memory consistency effects. In other words, there is no need to make fields of the MessageListener volatile or access them using synchronized blocks.
Modifier and Type | Method and Description |
---|---|
void |
onMessage(Message<E> message)
Invoked when a message is received for the topic.
|
void onMessage(Message<E> message)
message
- the message that is received for the topicCopyright © 2024 Hazelcast, Inc.. All rights reserved.