These are chat archives for spring-cloud/spring-cloud

20th
Jun 2017
Jonathan Fuerth
@jfuerth
Jun 20 2017 18:13
Hey all, question about Spring Cloud Stream (we're binding to RabbitMQ) .. when we create a source and sink for the same channel in the same app, it behaves strangely. Working demo of the issue is at https://github.com/jfuerth/stream-demo
to elaborate on "strangely:" we start getting exceptions in the sending app with Dispatcher has no subscribers for channel 'unknown.channel.name' and only every second message makes it to the remote app that's also subscribed to the channel
would love to know if we're using it wrong (probably so) :) -- what we're trying to accomplish is to fire an event when some business action happens, for example, a new user has been added to the system. We have logic across several Spring Boot microservices that want to react to such events but it all falls apart for us when we try to consume these events within the service that's producing them (as well as other remote services that are also subscribed to the same channel)
Jonathan Fuerth
@jfuerth
Jun 20 2017 18:18
@mbogoevici any chance you could point us in the right direction?
Jonathan Fuerth
@jfuerth
Jun 20 2017 18:24
also maybe worth mentioning: the demo apps on GitHub were meant to mirror the setup we have in our real apps, and we think they're using the same APIs in the same way, but the actual behaviour is not identical in the demo as in our real apps. For one thing, we were getting Jackson deserialization errors in the sending app when it was subscribed to its own events. This isn't happening in demo-app-a; instead we get the no subscribers issue.
Jonathan Fuerth
@jfuerth
Jun 20 2017 18:51
Ok, so for now we have worked around the issue by using the ApplicationEventPublisher system for local events (https://spring.io/blog/2015/02/11/better-application-events-in-spring-framework-4-2)
we publish the event both to spring-cloud-stream (for remote services) and ApplicationEventPublisher (for the local service) and we have removed the local sink for spring-cloud-stream