MqttPahoMessageDrivenChannelAdapter: Lost connection: Connection lost; retrying

386 views Asked by At

Please can someone why the Patho MQTT v3 Message Driven Adapter is continuously loosing connection when trying to subscribe to an HiveMQ 4.9 topic

Versions :

  • org.springframework.integration:spring-integration-mqtt:5.5.2

  • org.springframework.boot:spring-boot-starter:2.5.3

  • org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5

Here is the config:

@Bean
public MqttPahoClientFactory mqttClientFactory() {
    DefaultMqttPahoClientFactory factory = new DefaultMqttPahoClientFactory();
    MqttConnectOptions options = new MqttConnectOptions();
    options.setServerURIs(new String[] { "tcp://localhost:1883" });
    factory.setConnectionOptions(options);
    return factory;
}

@Bean
public MqttPahoMessageDrivenChannelAdapter inboundAdapter(MqttPahoClientFactory clientFactory) {
    return new MqttPahoMessageDrivenChannelAdapter("MyApp", clientFactory, "MyTopic");
}

Each time the ChannelAdapter issue this error :

2022-10-26 15:22:24.580  INFO 28190 --- [nio-8091-exec-1] o.s.i.endpoint.EventDrivenConsumer       : started org.springframework.integration.endpoint.EventDrivenConsumer@9490cb2
2022-10-26 15:22:24.917 ERROR 28190 --- [TT Rec: MyoApp] .m.i.MqttPahoMessageDrivenChannelAdapter : Lost connection: Connection lost; retrying...
2022-10-26 15:22:35.241 ERROR 28190 --- [TT Rec: MyoApp] o.s.i.m.outbound.MqttPahoMessageHandler  : Lost connection; will attempt reconnect on next request

Please does somebody know the real impact of this situation and what I can do to stop these erros ?

Thanks

0

There are 0 answers