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

   fixes https://github.com/apache/camel-quarkus/issues/8979
   
   Quarkus LangChain4j lets applications define several named embedding stores, 
but Camel routes could not reference them without manually binding each store 
into the registry.
   
   This PR bridges every `EmbeddingStore` CDI bean qualified with 
`@EmbeddingStoreName` into the Camel registry under its qualifier value, so a 
route can simply use `embeddingStore=#products`. Details:
   
   - The scan runs at `RUNTIME_INIT` after ArC's synthetic bean initialization 
(`@Consume(SyntheticBeansRuntimeInitBuildItem.class)`), so stores declared via 
Quarkus LangChain4j configuration (pgvector, redis, ...) are covered.
   - Stores are retained via `UnremovableBeanBuildItem` (a route-only store is 
never injected in Java, so ArC would otherwise remove it) and bound lazily via 
supplier - a store no route references is never instantiated.
   - If the registry already resolves a different `EmbeddingStore` under the 
same name (e.g. a `@Named` bean), that bean keeps winning lookups and a warning 
is logged at startup.
   - Documented in the `langchain4j-embeddingstore` extension page; tested in 
JVM and native mode (the `qualifier-only` test store carries no `@Named`, so it 
is reachable only through the bridge).
   
   <!-- 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