Skip to content

Trying to post to an MessageGateway from @PostConstruct #9854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Draaksward opened this issue Feb 19, 2025 · 0 comments
Closed

Trying to post to an MessageGateway from @PostConstruct #9854

Draaksward opened this issue Feb 19, 2025 · 0 comments

Comments

@Draaksward
Copy link

First of all, I do realize that this is something I overlooked while I was testing (still learning the ropes), so it is more of an "it would be nice to have". Also, it is a follow-up to a https://stackoverflow.com/questions/79451785/spring-integrations-sending-messages-to-mqtt, where, after finding the issue, I was suggested to open an Issue here.

Expected Behavior
Receive an exception, which explicitly states that the system is in initialization and, therefore, is not ready to receive messages.

Current Behavior
While doing a basic attempt of sending a message to a MQTT topic from "@PostConstruct", the system throws an exception, which states

Caused by: org.springframework.messaging.MessageDeliveryException: Dispatcher has no subscribers for channel 'application.mqttOutboundChannel'.
...
Caused by: org.springframework.integration.MessageDispatchingException: Dispatcher has no subscribers

Context
Started learning Spring Integration. One of the things I wanted to accomplish was to send a message to Mosquitto MQTT topic. I went through the things I could find by Googling (I wish there was more material like "Spring Integration. How to write your first MQTT/Kafka/Something project"... because all material, which is not dated "5+ years ago" was 2 hour youtube video... and a few others), and, as it always is with this kind of things, "missed something essential" not really understanding what is the cause.

@Draaksward Draaksward added status: waiting-for-triage The issue need to be evaluated and its future decided type: enhancement labels Feb 19, 2025
@artembilan artembilan added in: core and removed status: waiting-for-triage The issue need to be evaluated and its future decided labels Feb 19, 2025
@artembilan artembilan added this to the 6.5.0-M3 milestone Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants