Commit bcb9a180 authored by 赵啸非's avatar 赵啸非

修改消息组件

parent 85a2e835
......@@ -147,6 +147,7 @@ public class TbRabbitMqProducerTemplate<T extends TbQueueMsg> implements TbQueue
private Boolean createTopicIfNotExist(TopicPartitionInfo tpi) {
if (topics.contains(tpi)) {
log.info("contains topc:",tpi.getTopic());
return true;
}
topics.add(tpi);
......
......@@ -73,7 +73,7 @@ public class DeviceMsgComsumerStartedService implements IApplicationStartedServi
PlatformEntity platformEntity = platformService.get(item.getPlatformId());
ProductEntity productEntity = productService.get(item.getProductId());
String exchangeName = platformEntity.getPlatformSn() + Constant.EXCHANGE_SPLIT + productEntity.getProductCode();
return new TopicPartitionInfo(Constant.UPLOAD_TOPIC + item.getDeviceMac(), null, exchangeName);
return new TopicPartitionInfo(Constant.UPLOAD_TOPIC + item.getDeviceCode(), null, exchangeName);
}
).collect(Collectors.toSet());
mainConsumer.subscribe(topicPartitionInfoSet);
......
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