Claus Ibsen created CAMEL-27780:
-----------------------------------

             Summary: camel-reactive-streams: the default worker pool runs a 
single thread, and smaller issues
                 Key: CAMEL-27780
                 URL: https://issues.apache.org/jira/browse/CAMEL-27780
             Project: Camel
          Issue Type: Bug
          Components: camel-reactive-streams
            Reporter: Claus Ibsen
             Fix For: 4.25.0


Found while improving the option descriptions of camel-reactive-streams for 
CAMEL-23832 (pull request https://github.com/apache/camel/pull/31132).
These are separate problems of the component; the descriptions change only 
documents the current behavior.

h4. 1. The default worker pool of the built-in engine runs one thread
{{DefaultCamelReactiveStreamsService.doInit}} creates the pool with core 
{{threadPoolMinSize}} (0) and max {{threadPoolMaxSize}} (10) through 
{{ExecutorServiceManager.newThreadPool}}, which uses the default profile's 
bounded queue of 1000. A ThreadPoolExecutor with core 0 and a bounded queue 
runs a single thread until the queue is full, so the onNext delivery to all 
external Subscribers runs on one thread and the max of 10 is rarely reached.
Proposed change: use a SynchronousQueue (maxQueueSize 0) or a minimum size 
equal to the maximum.

h4. 2. JMX attributes
{{ReactiveStreamsEndpoint.setConcurrentConsumers}} carries 
{{@ManagedAttribute}} on the setter, so JMX exposes it write-only. 
{{getExchangesRefillLowWatermark}} says "percentage" but the value is a 
fraction from 0 to 1.

h4. 3. CamelPublisher looks the component up by a fixed name
The {{CamelPublisher}} constructor reads the default backpressure strategy from 
{{context.getComponent("reactive-streams")}}, so a component registered under 
another name is not used, and a default component may be auto-created. Mostly 
masked, as the endpoint strategy overrides it when a producer attaches.


_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to