[
https://issues.apache.org/jira/browse/CAMEL-27896?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18153273#comment-18153273
]
Guillaume Nodet commented on CAMEL-27896:
-----------------------------------------
This issue is being investigated by a coding agent (on behalf of gnodet).
Two confirmed bugs in SedaEndpoint.java:
*Bug 1 (magic value sentinel):* Lines 255 and 720 compare size against
SedaConstants.QUEUE_SIZE (1000) and Integer.MAX_VALUE to detect "not set". An
explicit size=1000 or size=2147483647 is wrongly treated as not set, causing
the component queueSize to override the endpoint intended size for endpoints
created after context start.
*Bug 2 (virtual threads + concurrentConsumers=1):* Lines 736-738 in doInit()
unconditionally reset concurrentConsumers from 1 to 0 when
virtualThreadPerTask=true, making it impossible to explicitly limit to 1
concurrent consumer. No way to distinguish user-set from default.
Fix: add boolean flags (sizeSet, concurrentConsumersSet) to track explicit
values vs defaults.
_Note: This comment was generated by an AI coding agent and requires manual
verification._
> camel-seda: size 1000 or Integer.MAX_VALUE is treated as not set for
> endpoints created after start, concurrentConsumers=1 is impossible with
> virtual threads
> ------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-27896
> URL: https://issues.apache.org/jira/browse/CAMEL-27896
> Project: Camel
> Issue Type: Bug
> Components: camel-seda
> Reporter: Claus Ibsen
> Assignee: Guillaume Nodet
> Priority: Minor
> Fix For: 4.25.0
>
>
> Found while improving the option descriptions of camel-seda for CAMEL-23832
> (pull request https://github.com/apache/camel/pull/31159).
> These are separate problems of the component; the descriptions change only
> documents the current behavior.
> h4. 1. size 1000 or Integer.MAX_VALUE is treated as not set
> {{SedaEndpoint.getQueue()}} and registerQueueIfStale() compare size with 1000
> and Integer.MAX_VALUE to see if it was set. For an endpoint created after the
> CamelContext started (for example by toD), size=1000 with a component
> queueSize=500 gets a queue of 500, and size=2147483647 does not give an
> unbounded queue.
> Proposed change: record whether size was set instead of comparing with magic
> values.
> h4. 2. concurrentConsumers=1 is impossible with virtualThreadPerTask
> {{SedaEndpoint.doInit()}} turns concurrentConsumers 1 into 0 (no limit) when
> virtualThreadPerTask is on, also when 1 was set on purpose.
> Proposed change: apply the 0 default only when the option was not set.
> h4. 3. failIfNoConsumers and discardIfNoConsumers are not checked
> The old docs said only one can be enabled, but nothing checks it;
> SedaProducer.addToQueue lets fail win.
> Proposed change: validate it in doInit, or keep the precedence (the new text
> describes it).
> h4. 4. queueFactory and stub
> queueFactory works per endpoint (SedaComponent.createEndpoint resolves it)
> but has no @UriParam, so it is missing from the catalog and the DSL while the
> doc page uses it. StubComponent.setProperties is a no-op, so stub ignores
> most seda options that stub.json still lists.
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)