spring-integration-mqtt inbound & outbound client #9686
-
Hello, I wonder in what situation 2 methods are used, separating and not separating |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
Sorry, we don’t develop here final products, so cannot imaging real use-cases. The choice of such an API is just for flexibility where you might have only one or another channel adapter . And even if you have both, that does not mean that they have to be against the same client. Other brokers might not let more than one client per IP address. That’s why we g go ave introduced that |
Beta Was this translation helpful? Give feedback.
-
Thank you for your kind explanation.
In other words, the problem in the current code is that the subscribers to the message channel are currently mqttOutboundHandler and mqttInboundHandler, and the channel is using round robin to select one subscriber in a loop-indexed fashion to deliver messages only to that subscriber. that's correct? So the solution is to separate the message channels that the two handlers are subscribed to, and that will solve the problem.
Isn't this handled by the code above?
|
Beta Was this translation helpful? Give feedback.
-
The MQTT Gateway is used by the service logic to publish messages to the MQTT Broker.
i dont understand this sentence. Like the example code in the spring integration mqtt official documentation(https://docs.spring.io/spring-integration/reference/mqtt.html#mqtt-outbound), where I created a mqtt message channel, created a Gateway interface, took the defaultRequestChannel to be the same as the message channel I created, and connected to @serviceactivator(inputChannel = “messageChannel”) in the mqttOutboundHandle, what's wrong with my mqttOutboundHandler settings? I thought the problem is caused by the inputChannel being shared by InboundHandler and OutboundHandler, but... |
Beta Was this translation helpful? Give feedback.
-
that is only test. This was simply to test whether we needed to separate the message channels. That should be sufficient explanation. I think my questions have been answered so far with your answers and that link, thank you. |
Beta Was this translation helpful? Give feedback.
Yes, i meant how that gateway is used in your logic.
You change either this channel, or the one for inbound part.
Still not clear why you have made a choice just for one channel for everything…
See Spring Integration docs for the purpose of channels : https://docs.spring.io/spring-integration/reference/overview.html#overview-components-channel