2

What's exactly the difference between the IdempotentRepository and the InProgressRepository? I have following definitions from the File component page:

  • IdempotentRepository: "Option to use the Idempotent Consumer EIP pattern to let Camel skip already processed files"
  • InProgressRepository: "The in-progress repository is used to account the current in progress files being consumed."

For me these are the same definitions, only slightly differently phrased. They can also both use the same idempotent repository.

So I'm slightly confused, do I need both? Or is the idempotentRepository good enough?

bramdc
  • 580
  • 1
  • 5
  • 21

1 Answers1

5

Before you read below info, make sure you have read and understand the concept of idempotent.


IdempotentRepository - The place used to store the cache of already processed file (i.e. files have been consumed and handled by your route). In use when you check on idempotent feature.

InProgressRepository - The place used to store the cache of current in progress file (i.e. files to be consumed in current batch). Always in use for file consumer.

IMO, one always need InProgressRepository and with default setup (memory based repository) in general. One might need IdempotentRepository if idempotent is required and choose their own setup (file-based, JPA-based, ...) to against app restart.

hk6279
  • 1,881
  • 2
  • 22
  • 32
  • Thats a lot better explained! But still have some questions: Will 2 file components then first check the InProgressRepository to see if the other file component is already consuming the file (ofcourse only if this is a shared repository)? What the purpose then of an idempotent InProgressRepository? – bramdc Nov 17 '20 at 21:27
  • Never change the setting for InProgressRepository, you might need to test it out on your own or search on internet or ask another post. – hk6279 Nov 18 '20 at 11:57