I am using Spring Cloud Bus (1.2.1.RELEASE, Camden.SR2). I have a custom event (call it CustomEvent
) that I have created and registered via @RemoteApplicationEventScan
as well as a custom AbstractBusEndpoint
implementation to publish the event. I am able to publish events to the bus just fine.
My remote application receives the event and acknowledges (I verified this using the trace
endpoint). I have verified via debugging that the CustomEvent
is published via the ApplicationEventPublisher
provided in BusAutoConfiguration#acceptRemote
. I have a bean with an event handler in my remote application (I have this auto-configured into all of my micro-services):
@Component
public class EventListener {
@EventHandler(CustomEvent.class)
public void handleCustomEvent(CustomEvent event) {
..
}
}
Despite this, the event handler will not receive the event. I traced within the AbstractApplicationEventMulticaster
class and despite my bean being created (verified via beans
endpoint), the listener is not in the list of ApplicationListener
s retrieved by ListenerRetriever
. I do see the BusAutoConfiguration.acceptLocal
listener in this list, but not my custom listener.
This event handler is also registered on the source application (the one I am accessing the bus endpoint from to initiate the event). The custom listener receives the event in this application, but not the remote application.
Essentially, both applications are configured the exact same except one is configured to send the CustomEvent
using an implementation of AbstractBusEndpoint
.
I am out of ideas of where else to look within the Spring code to debug this problem. If anyone has a thread they can lead me on it would be appreciated.