0

I would need to use event-driven mechanism. using ApplicationEventPublisher. I would want to set a delay for the message before reach to the endpoint that listening to this event. Is there such a way? found https://docs.spring.io/spring-integration/docs/2.0.0.RC1/reference/html/delayer.html but not sure how it should integrate with ApplicationEventPublisher.

Is there a simple way to use spring to achieve the above?

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118
USer22999299
  • 5,284
  • 9
  • 46
  • 78

1 Answers1

2

In addition to the Delayer, Spring Integration also provides ApplicationEventPublishingMessageHandler to producer an ApplicationEvent to the ApplicationEventPublisher based on the incoming message. This way you really will delay the message (an event) in the <delayer> and then publish an event to the application via <int-event:outbound-channel-adapter>.

Also consider to use as late Spring Integration version as possible: https://projects.spring.io/spring-integration/

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118