[
https://issues.apache.org/jira/browse/CAMEL-27211?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Work on CAMEL-27211 started by shashank.
----------------------------------------
> camel-tahu - a tahu-host consumer created again for the same host id (route
> reloaded or added again, another CamelContext) receives no message: the host
> application of the first consumer is reused
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-27211
> URL: https://issues.apache.org/jira/browse/CAMEL-27211
> Project: Camel
> Issue Type: Bug
> Components: camel-tahu
> Reporter: shashank
> Assignee: shashank
> Priority: Major
>
> h3. What happens
> {{TahuHostConsumer}} takes its {{TahuHostApplication}} from a static map
> keyed by the host id, and creates one only for the first consumer of that
> host id in the JVM. That host application gives the Sparkplug messages to the
> methods of the consumer that created it, and connects with the servers and
> credentials of that consumer's endpoint. Nothing removes it from the map.
> Any later consumer of the same host id gets the old host application: a route
> that is reloaded (route reload, {{camel run --dev}}), removed and added
> again, or a route of another CamelContext in the same JVM (for example a
> CamelContext started again, or tests that start several contexts). Its start
> starts the old host application again, which gives every message to the old,
> stopped consumer: the new route receives nothing, and changed {{servers}},
> {{clientId}} or credentials are ignored. A consumer that is stopped and
> started again (same instance) is not affected.
> h3. How to reproduce
> {{TahuHostConsumerHostApplicationTest}} (camel-tahu, no MQTT server): a
> consumer is created, stopped, and created again for the same host id; a
> message given to the host application of the new consumer is routed to the
> processor of the first one.
> h3. Fix
> Each consumer builds its own host application. Two consumers that run at the
> same time with the same host id were not supported before either (the
> messages went to the first consumer only).
> _Filed with Claude Code on behalf of allthingssecurity._
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)