[
https://issues.apache.org/jira/browse/CAMEL-24623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18111471#comment-18111471
]
Andrea Cosentino commented on CAMEL-24623:
------------------------------------------
PR opened: https://github.com/apache/camel/pull/26111
_Claude Code on behalf of oscerd_
> camel-infinispan: the QUERY operation silently returns the input when no
> query builder is set
> ---------------------------------------------------------------------------------------------
>
> Key: CAMEL-24623
> URL: https://issues.apache.org/jira/browse/CAMEL-24623
> Project: Camel
> Issue Type: Bug
> Components: camel-infinispan
> Reporter: Andrea Cosentino
> Assignee: Andrea Cosentino
> Priority: Minor
>
> h3. Summary
> The {{QUERY}} operation of the remote producer silently returns the exchange
> unchanged when no query builder is available, instead of failing.
> h3. Detail
> {{InfinispanRemoteProducer.onQuery}} ({{camel-infinispan}}) line 55:
> {code:java}
> final Query<?> query = InfinispanRemoteUtil.buildQuery(getConfiguration(),
> cache, message);
> if (query != null) {
> setResult(message, query.execute().list());
> }
> {code}
> There is no {{else}} branch, and {{InfinispanRemoteUtil.buildQuery}} line 63
> returns {{null}} when no builder is set:
> {code:java}
> return queryBuilder != null ? queryBuilder.build(cache) : null;
> {code}
> A route that runs {{operation=QUERY}} without setting either the
> {{CamelInfinispanQueryBuilder}} header or the {{queryBuilder}} endpoint
> option therefore gets its own input body back as though it were the query
> result - no result, no exception, no log line. The failure is
> indistinguishable from a query that legitimately returned nothing, which
> makes it hard to diagnose.
> The producer should fail with a clear message naming both ways of supplying
> the builder.
> Found by a source audit of {{components/camel-infinispan}} at 10f750a2d61f.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)