This code doesn’t seem valid either. Where is it even attempting to subscribe? As before, that should happen in or only subsequent to a connected callback.
The connecting, subscribing and callback handling is handled by spring integration.
And with this code I can again connect to my local broker. Maybe I can try to connect to another remote server, but this being the second try with completly different code I dont think what you described earlier is the problem here.
I was thinking that maybe the TTN broker has some kind of different settings or something, but as nobody has pointed this out, it does not seem that way.
Maybe there could be some difference between the Paho client and the mosquitto client?
Given that what you were going before was completely invalid, that’s a strange conclusion.
As before, you don’t seem to be making any attempt to subscribe, so it’s unclear how this could work - even if that were delegated to this integration, you’d still have to inform it what you want…
But still in both cases I could subscribe and receive messages locally.
Subscribing happens in the spring integration. If i didn’t subscribe anywhere i would not be able to receive messages locally.
MqttPahoMessageDrivenChannelAdapter adapter = new MqttPahoMessageDrivenChannelAdapter(config.getClientID(), mqttClientFactory(), config.getTopic());
With this the connection paramethers are given through the client factory and the topic is given.
Also in the example before i was using the synchronous Paho client whichs connect method call is blocking, so I don’t think what you described here is the real problem.