fetch specific set of records for each poll without setting the flag in camel

前端 未结 2 564
礼貌的吻别
礼貌的吻别 2021-01-27 08:59

I need to pick all the messages from db and send it for reprocessing.

my main requirement is

  1. i should fetch only certain number of records for each poll a
相关标签:
2条回答
  • 2021-01-27 09:19

    You could use the Batch Consumer as described here - https://camel.apache.org/batch-consumer.html

    0 讨论(0)
  • 2021-01-27 09:28

    Adding a trigger variable such as processedFlag is definitely the simplest way to go. Initially this variable is set to null.

    Procedure:

    1. Select all records where obj.processedFlag is not null.
    2. Process the record.
    3. After processing, set obj.processedFlag to a value ≠ null.
    4. Begin at 1.

    Not using a trigger variable would only produce a fair amount of headaches, I guess.

    0 讨论(0)
提交回复
热议问题