JiriOndrusek opened a new pull request, #9040:
URL: https://github.com/apache/camel-quarkus/pull/9040

   fixes https://github.com/apache/camel-quarkus/issues/9039
   
   Adds a configurable idempotent repository ("duplicate register") to 
camel-quarkus-langchain4j-ingest — the interim tier before the synchronising 
engine: remember what was ingested across restarts/instances and skip duplicate 
deliveries.
   
     Configuration surface
     - quarkus.camel.langchain4j.ingest.<pipeline>.source.idempotent-repository 
(runtime) — names an IdempotentRepository bean replacing the built-in in-memory 
register (100 000 keys,  per-boot).
     - …source.idempotent-repository-auto-create=true — binds an in-memory 
register under that name unless a bean with the name exists (existing bean 
wins).
     - Builder twins on Source: .idempotentRepository(String), 
.idempotentRepositoryAutoCreate(boolean); the external source.* override guard 
covers both.
   
     Mechanics
     - Three bean definition styles, all resolved the same way: auto-create, 
camel.beans.* (mind Camel's camelCase normalisation of dashed keys), CDI 
producer. Resolution is eager, by name, at route build — a missing bean fails 
startup on both source kinds; CamelContextAware gets the context injected.
     - Directory source: consumer-level idempotentKey = 
${file:absolute.path}:${file:modified}:${file:size} — unchanged files skipped, 
edited files re-ingest (append; old segments remain).
     - Consumer-fed source: idempotentConsumer EIP (eager, removeOnFailure) 
keyed on the validated document id held in an exchange property (expression 
evaluated once); duplicates answered with the new IngestResult.Outcome.SKIPPED 
via a tail processor keyed on Exchange.DUPLICATE_MESSAGE. First write wins per 
id.
   
     Native
     ReflectiveClassBuildItem registers MemoryIdempotentRepository and 
FileIdempotentRepository  (#class: beans are instantiated reflectively); custom 
repository classes need their own registration (documented). Verified with a 
native run.
   
     Docs & tests
     usage.adoc gains a "duplicate register" chapter (definition styles, sizing 
— FileIdempotentRepository correctness is bounded by maxFileStoreSize, not 
cacheSize — no off-switch by design, first-write-wins caveat, link to the 
Idempotent Consumer EIP guide). 4  deployment tests (missing bean on both 
source kinds, auto-create without a name, builder
     override) and 5 integration tests incl. failed-delivery key release and an 
H2-backed JdbcMessageIdRepository via Quarkus Dev Services (no container).
   
     🤖 Generated with Claude Code (https://claude.com/claude-code)
   
   
   <!-- Uncomment and fill this section if your PR is not trivial
   [ ] An issue should be filed for the change unless this is a trivial change 
(fixing a typo or similar). One issue should ideally be fixed by not more than 
one commit and the other way round, each commit should fix just one issue, 
without pulling in other changes.
   [ ] Each commit in the pull request should have a meaningful and properly 
spelled subject line and body. Copying the title of the associated issue is 
typically enough. Please include the issue number in the commit message 
prefixed by #.
   [ ] The pull request description should explain what the pull request does, 
how, and why. If the info is available in the associated issue or some other 
external document, a link is enough.
   [ ] Phrases like Fix #<issueNumber> or Fixes #<issueNumber> will auto-close 
the named issue upon merging the pull request. Using them is typically a good 
idea.
   [ ] Please run mvn process-resources -Pformat (and amend the changes if 
necessary) before sending the pull request.
   [ ] Contributor guide is your good friend: 
https://camel.apache.org/camel-quarkus/latest/contributor-guide.html
   -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to