Claus Ibsen created CAMEL-27628:
-----------------------------------

             Summary: camel-iggy: streamId and stream override, consumersCount, 
partitioning binding, labels
                 Key: CAMEL-27628
                 URL: https://issues.apache.org/jira/browse/CAMEL-27628
             Project: Camel
          Issue Type: Bug
            Reporter: Claus Ibsen
             Fix For: 4.24.0


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

h4. 1. With streamId set, the stream of a CamelIggyStreamOverride header is not 
created
{{IggyEndpoint.initializeTopic(client, topicName, streamName)}} receives the 
stream of the override header. When {{streamId}} is set, the 
{{autoCreateStream}} branch looks up {{StreamId.of(streamId)}} and, if it is 
missing, creates a stream named {{configuration.getStreamName()}}. It ignores 
the {{streamName}} argument. So for a message with a 
{{CamelIggyStreamOverride}} header to a stream that does not exist, no stream 
is created, and the following {{getTopic}}/{{createTopic}} on that stream fails 
the exchange.
Proposed change: use the resolved stream name in both branches, and look up by 
{{streamId}} only for the stream of the endpoint.

h4. 2. streamId is only used for a lookup, the created stream does not get that 
ID
In the same method, a missing stream with ID {{streamId}} leads to 
{{client.streams().createStream(streamName)}}. The Iggy Java client 0.9.0 only 
has {{createStream(String)}}, so the server assigns another ID. The producer 
and the consumer always address the stream by {{streamName}}. 
{{IggyConsumer.doStart()}} and {{doStop()}} also log {{getStreamId()}} as 
"stream", which is {{null}} when only {{streamName}} is set.
Proposed change: decide what {{streamId}} is for (deprecate it, or only use it 
to check an existing stream), and log {{streamName}} in the consumer.

h4. 3. consumersCount does not add consumers
{{IggyEndpoint.createExecutor()}} creates a thread pool of {{consumersCount}} 
threads, but {{IggyConsumer.doStart()}} submits one {{IggyFetchRecords}} task 
only. A value above 1 creates idle threads and does not poll in parallel.
Proposed change: start {{consumersCount}} polling tasks, each with its own 
client in the consumer group, or deprecate the option.

h4. 4. partitioning cannot be set from a String
The option has {{defaultValue = "balanced"}} and type 
{{org.apache.iggy.message.Partitioning}}. There is no type converter from a 
String to {{Partitioning}}, so {{partitioning=balanced}} or a partition ID in 
the URI fails to bind, and only a bean reference works.
Proposed change: add a type converter (for example {{balanced}}, 
{{partitionId:<n>}}, {{messagesKey:<key>}}), or document that a bean reference 
is needed.

h4. 5. password has no security label
In {{IggyConfiguration}}, {{password}} has {{security = "secret"}} but no 
{{label = "security"}}, while {{username}} has both. The option shows up in the 
common group of the docs and tools.
Proposed change: add {{label = "security"}} to {{password}}.

h4. 6. shutdownTimeout is labelled common,consumer
{{shutdownTimeout}} has {{label = "common,consumer"}}, but only 
{{IggyConsumer.doStop()}} reads it; the producer does not.
Proposed change: set {{label = "consumer"}}.

_Claude Code on behalf of davsclaus_



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

Reply via email to