[ 
https://issues.apache.org/jira/browse/CAMEL-24942?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-24942.
---------------------------------
    Fix Version/s: 4.23.0
       Resolution: Fixed

The fix is merged on main, so it is in Camel 4.23.0:
* d1d660f1befb CAMEL-24942: camel-seda - Use assertMockEndpointsSatisfied in 
the new test
* d876d4b6e887 CAMEL-24942: camel-seda - multicast to all consumers of a queue 
when multipleConsumers endpoints use different options
* d65dffa6796e CAMEL-24942: camel-seda - Move the upgrade guide section next to 
the other camel-seda entries

Resolving, as the ticket was not updated when the PR was merged.

_Claude Code on behalf of Claus Ibsen_

> camel-seda - multipleConsumers=true silently load-balances instead of 
> broadcasting when the consumer URIs differ in any other option
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-24942
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24942
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-seda
>            Reporter: shashank
>            Priority: Minor
>             Fix For: 4.23.0
>
>
> With {{multipleConsumers=true}} every consumer should get a copy of each 
> message. The option doc says "When enabled, this option should be specified 
> on every consumer endpoint". Pub/sub only works when all subscriber routes 
> use exactly the same endpoint URI:
> * The queue is shared by name: {{SedaComponent.getQueueKey()}} drops the 
> query string.
> * Each distinct URI is a separate {{SedaEndpoint}} with its own consumer set 
> and multicast processor.
> * A consumer thread multicasts a polled message only to the consumers of its 
> own endpoint ({{SedaConsumer.sendToConsumers}} uses 
> {{getEndpoint().getConsumers()}} / 
> {{getEndpoint().getConsumerMulticastProcessor()}}).
> As a result, subscribers on different endpoints compete for the messages.
> Reproduced against 4.23.0-SNAPSHOT, 10 messages sent to {{seda:news}}:
> {noformat}
> A: seda:news?multipleConsumers=true                     B: 
> seda:news?multipleConsumers=true                         -> A 10, B 10
> A: seda:news?multipleConsumers=true                     B: 
> seda:news?multipleConsumers=true&concurrentConsumers=2   -> A 2,  B 8
> A: seda:news?multipleConsumers=true                     B: 
> seda:news?multipleConsumers=true&pollTimeout=500         -> A 7,  B 3
> {noformat}
> There is no error or warning. Adding a harmless option such as 
> {{concurrentConsumers}} to one subscriber is enough to lose the broadcast. 
> CAMEL-6451 already rejects consumers that mix {{multipleConsumers=true}} and 
> {{false}} on one queue, but not this case.
> Proposed fix, one of:
> # Multicast over the consumers of all endpoints that share the 
> {{QueueReference}}. The reference already tracks its endpoints 
> ({{QueueReference.hasConsumers()}} iterates them).
> # Fail at start-up, like the CAMEL-6451 check in 
> {{SedaEndpoint.createConsumer}}, when a consumer with 
> {{multipleConsumers=true}} is added to a queue that already has consumers on 
> a different endpoint instance. Also document that all subscribers must use 
> the identical URI.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to