|
@@ -81,23 +81,7 @@ public abstract class HexBinaryAcceptanceHandlerAdapter extends AcceptanceInboun
|
|
|
boolean isInitial = Constants.MSG_TERMINAL_REGISTER.equals(msgId);
|
|
|
sendOriginalMsg(dataByteArray, deviceId, isInitial,0);
|
|
|
}
|
|
|
- protected void sendOriginalMsg(byte[] dataByteArray, String deviceId, boolean isInitial) {
|
|
|
- MsgWrapper msgWrapper = new MsgWrapper(deviceId, DatatypeConverter.printHexBinary(dataByteArray), isInitial);
|
|
|
- msgWrapper.setProtocolCode(0);
|
|
|
- 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");
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
|
|
|
protected void sendOriginalMsg(byte[] dataByteArray, String deviceId, boolean isInitial,Integer protocolCode) {
|
|
|
MsgWrapper msgWrapper = new MsgWrapper(deviceId, DatatypeConverter.printHexBinary(dataByteArray), isInitial);
|