Claus Ibsen created CAMEL-27788:
-----------------------------------

             Summary: camel-vertx: vertxOptions disables clustering, host/port 
are not passed to vertxFactory, the component cannot be restarted
                 Key: CAMEL-27788
                 URL: https://issues.apache.org/jira/browse/CAMEL-27788
             Project: Camel
          Issue Type: Bug
          Components: camel-vertx
            Reporter: Claus Ibsen
             Fix For: 4.25.0


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

h4. 1. With vertxOptions set, the component never builds a clustered Vert.x
In {{VertxComponent.doStart}}, host/port are applied and {{clustered}} is set 
only inside {{if (vertxOptions == null)}}. Vert.x 5 VertxOptions has no 
clustered flag, so with vertxOptions set the component always calls 
{{build()}}, and host/port are silently ignored.
Proposed change: decide clustered from host/port also when vertxOptions is set, 
and apply them to a copy ({{new VertxOptions(vertxOptions)}}).

h4. 2. host/port do not reach a custom vertxFactory
With vertxFactory plus host/port, host/port go into a new VertxOptions that the 
builder never receives ({{Vertx.builder().with(vertxOptions)}} only runs 
without vertxFactory). They only switch on {{buildClustered()}}, and the INFO 
log "Creating Clustered Vertx host:port" shows values that are not used.

h4. 3. The component cannot be restarted
{{doStop}} closes the Vert.x it created but does not reset {{vertx}}, 
{{createdVertx}}, {{vertxOptions}} and {{vertxFactory}}. The next {{doStart}} 
reuses the closed instance; with vertx reset, the derived vertxOptions would 
still turn a clustered setup into a non-clustered one.
Proposed change: reset those fields in doStop when the component created the 
Vert.x, and keep the user's options apart from the derived ones.

h4. 4. The request timeout cannot be set
The producer calls {{request(address, body)}} without DeliveryOptions, so InOut 
always uses the 30 s default timeout of DeliveryOptions.


_Claude Code on behalf of davsclaus_



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

Reply via email to