I was wondering how I prevent or detect duplicate events when I have a configured a Custom MessageSource. I have a custom MessageSource sending events to GCP Pub Sub topics. If I make a call to eventGateway.publish(event) and I have an @EventHandler to consume the event, the handler is called once directly and once when consumed from the custom MessageSource.
How am I supposed to resolve this?