Skip to content

Instantly share code, notes, and snippets.

@ajimenezsa
Last active June 27, 2022 10:28
Invalidation Message Listener to delete entities from cache.
@Override
public void onMessage(Message message) {
if (message.getPublishingMember().getUuid() != null &&
message.getPublishingMember().getUuid().equals(hzGlobalInstance.getCluster().getLocalMember().getUuid())) {
//Skip messages of current node.
return;
}
sessionFactoryImplementor.getCache().evict(entityClass, message.getMessageObject());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment