|
@@ -99,4 +99,22 @@ public abstract class HexBinaryAcceptanceHandlerAdapter extends AcceptanceInboun
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ protected void sendOriginalMsg(byte[] dataByteArray, String deviceId, boolean isInitial,Integer protocolCode) {
|
|
|
+ MsgWrapper msgWrapper = new MsgWrapper(deviceId, DatatypeConverter.printHexBinary(dataByteArray), isInitial);
|
|
|
+ msgWrapper.setProtocolCode(protocolCode);
|
|
|
+ final Integer key = deviceId.hashCode();
|
|
|
+ kafkaTemplate.send(originalTopic, key, StringUtil.convert2String(msgWrapper))
|
|
|
+ .addCallback(new ListenableFutureCallback<SendResult<Integer, String>>() {
|
|
|
+ @Override
|
|
|
+ public void onFailure(Throwable ex) {
|
|
|
+ logger.error(ex.getMessage(), ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onSuccess(SendResult<Integer, String> result) {
|
|
|
+ logger.info("send original msg success");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
}
|