上云api mq 消息 相同的消息会收到两条。
Completed@Bean(name = "adapter")
public MessageProducerSupport mqttInbound() {
MqttClientOptions options = MqttConfiguration.getBasicClientOptions();
MqttPahoMessageDrivenChannelAdapter adapter = new MqttPahoMessageDrivenChannelAdapter(
options.getClientId() + "_consumer_" + System.currentTimeMillis(),
mqttClientFactory, options.getInboundTopic().split(","));
DefaultPahoMessageConverter converter = new DefaultPahoMessageConverter();
// use byte types uniformly
converter.setPayloadAsBytes(true);
adapter.setConverter(converter);
adapter.setQos(0);
adapter.setOutputChannel(inboundChannel);
return adapter;
}
我把qos调整为 0 或者 2,感觉没有生效,osd的消息还是一直是两条
Please sign in to leave a comment.
Comments
1 comment