fix(cluster): change HazelcastMsg payload to byte[]
This commit is contained in:
@@ -10,13 +10,13 @@ public class HazelcastMsg implements Serializable{
|
|||||||
private final String clientId;
|
private final String clientId;
|
||||||
private final String userName;
|
private final String userName;
|
||||||
private final byte qos;
|
private final byte qos;
|
||||||
private final String payload;
|
private final byte[] payload;
|
||||||
private final String topic;
|
private final String topic;
|
||||||
|
|
||||||
public HazelcastMsg(String clientId, String topic , byte qos, byte[] payload, String userName) {
|
public HazelcastMsg(String clientId, String topic , byte qos, byte[] payload, String userName) {
|
||||||
this.clientId = clientId;
|
this.clientId = clientId;
|
||||||
this.qos = qos;
|
this.qos = qos;
|
||||||
this.payload = new String(payload);
|
this.payload = payload;
|
||||||
this.userName = userName;
|
this.userName = userName;
|
||||||
this.topic = topic;
|
this.topic = topic;
|
||||||
}
|
}
|
||||||
@@ -30,7 +30,7 @@ public class HazelcastMsg implements Serializable{
|
|||||||
return qos;
|
return qos;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPayload() {
|
public byte[] getPayload() {
|
||||||
return payload;
|
return payload;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class HazelcastListener implements MessageListener<HazelcastMsg> {
|
|||||||
PublishMessage publishMessage = new PublishMessage();
|
PublishMessage publishMessage = new PublishMessage();
|
||||||
publishMessage.setTopicName(msg.getMessageObject().getTopic());
|
publishMessage.setTopicName(msg.getMessageObject().getTopic());
|
||||||
publishMessage.setQos(AbstractMessage.QOSType.valueOf(msg.getMessageObject().getQos()));
|
publishMessage.setQos(AbstractMessage.QOSType.valueOf(msg.getMessageObject().getQos()));
|
||||||
publishMessage.setPayload(ByteBuffer.wrap(msg.getMessageObject().getPayload().getBytes("UTF-8")));
|
publishMessage.setPayload(ByteBuffer.wrap(msg.getMessageObject().getPayload()));
|
||||||
publishMessage.setLocal(false);
|
publishMessage.setLocal(false);
|
||||||
publishMessage.setClientId(msg.getMessageObject().getClientId());
|
publishMessage.setClientId(msg.getMessageObject().getClientId());
|
||||||
server.internalPublish(publishMessage);
|
server.internalPublish(publishMessage);
|
||||||
|
|||||||
Reference in New Issue
Block a user