Back Forum Reply New

Increase polling frequency when data is returned

I'd like to increase the polling frequency for a poller when the channel adapter returns data.

It is probably easiest to explain with an example:
Say I'm polling a database for new rows using the lt;int-jdbc:inbound-channel-adaptergt;-element. As long as no data is returned, I'd like for the poller to keep it's fixed-delay, however when data is returned I'd like for the delay to be ~0, fetching data as fast as possible.

I guess this could be implemented in a number of ways, perhaps by specifying some sort of backoff policy when no data is returned, or a throttle policy when data is returned? Or a simpler approach with two fixed-delay-elements, one default and one quot;when data is returnedquot;.

There might be a way to do this already, but I haven't found one.

The max-messages-per-poll attribute on a poller does exactly what you want: each time the poller is triggered, it will keep polling (without any delay) for messages until either the maximum number of messages is reached or no more messages are received.


Originally Posted by alexander.willemsenThe max-messages-per-poll attribute on a poller does exactly what you want: each time the poller is triggered, it will keep polling (without any delay) for messages until either the maximum number of messages is reached or no more messages are received.

nice! I had a feeling I had read that somewhere in the documentation, couldn't find it though! thanks!!
¥
Back Forum Reply New