Results 1 to 2 of 2

Thread: Custom Trigger for the Poller

  1. #1

    Default 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. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •