Announcement Announcement Module
Collapse
No announcement yet.
Custom Trigger for the Poller Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Custom Trigger for the Poller

    Hi,

    The use case I am trying to configure is that I need to trigger the poller only when the service method completes the execution triggered during earlier poll.

    Poller should not read the message while the service method is in execution. The execution time of the service method varies based on the message. So it might not be optimal for this use case to use interval-trigger.

    I am wondering if Spring-Integration allows use of custom triggers. I see the xsd does not have support custom trigger.

    Could you please let me know if I am missing anything or if there is any alternative approach for this use case?

    Thank you

  • #2
    What you are explaining is "event-driven" scenario where upon successful completion of something you want to do something else.
    Why not use event-driven approach with DirectChannels?

    service-activator -> channel

    ... where 'service-activator' is your service and 'channel' is a DirectChannel.

    If your service is not part of the message flow, then you can also use Spring Integration Event adapter where your service (spring bean) would publish ApplicationEvent to Spring Application Context
    Code:
    applicationContext.publishEvent(new ApplicationEvent(){..})
    ... and have Event Inbound Channel Adapter initiate the flow:
    Code:
    <int-event:inbound-channel-adapter channel="input"/>
    In the above as soon as you publish event it will be picked up by the inbound adapter which will construct the message and send it to 'input' channel.

    Comment

    Working...
    X