Simplyfied creation of HazelcastMsg from InterceptPublishMessage

This commit is contained in:
andsel
2016-07-22 13:19:16 +02:00
parent 29fd6d03b9
commit 8cc588d766
3 changed files with 15 additions and 19 deletions
@@ -23,8 +23,7 @@ public class HazelcastInterceptHandler extends AbstractInterceptHandler {
public void onPublish(InterceptPublishMessage msg) {
LOG.info("{} publish on {} message: {}", msg.getClientID(), msg.getTopicName(), new String(msg.getPayload().array()));
ITopic<HazelcastMsg> topic = hz.getTopic("moquette");
HazelcastMsg hazelcastMsg = new HazelcastMsg(msg.getClientID(), msg.getTopicName(), msg.getQos().byteValue(),
msg.getPayload().array(), msg.getUsername());
HazelcastMsg hazelcastMsg = new HazelcastMsg(msg);
topic.publish(hazelcastMsg);
}