Commit 3fee1173 authored by 赵啸非's avatar 赵啸非

修改消息组件

parent ec0c43a6
...@@ -99,7 +99,6 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D ...@@ -99,7 +99,6 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
public void onSuccess(TbQueueMsgMetadata metadata) { public void onSuccess(TbQueueMsgMetadata metadata) {
log.info("队列创建成功,设备编码:{}", entity.getDeviceCode()); log.info("队列创建成功,设备编码:{}", entity.getDeviceCode());
} }
@Override @Override
public void onFailure(Throwable t) { public void onFailure(Throwable t) {
log.error("队列创建失败,设备通道编码:{},{}", entity.getDeviceCode(), t); log.error("队列创建失败,设备通道编码:{},{}", entity.getDeviceCode(), t);
...@@ -111,6 +110,10 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D ...@@ -111,6 +110,10 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
Set<TopicPartitionInfo> partitions = new HashSet<>(); Set<TopicPartitionInfo> partitions = new HashSet<>();
partitions.add(info); partitions.add(info);
consumerService.getMainConsumer().subscribe(partitions); consumerService.getMainConsumer().subscribe(partitions);
//创建下行队列
info = TopicPartitionInfo.builder().exchangeName(exchangeName).topic(Constant.DOWN_TOPIC + entity.getDeviceCode()).build();
messageService.queueDeclare(info, callback);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment