public <T extends PubSubMessage> void subscribe(String name, final PubSubListener<T> listener, Class<T> clazz) {
ITopic<T> topic = hazelcastSub.getTopic(name);
String regId = topic.addMessageListener(new MessageListener<T>() {
@Override
public void onMessage(Message<T> message) {
PubSubMessage msg = message.getMessageObject();
if (!nodeId.equals(msg.getNodeId())) {
listener.onMessage(message.getMessageObject());
}
}
});