shashank created CAMEL-26288:
--------------------------------

             Summary: camel-quickfix - removing one of the routes that consume 
from a quickfix endpoint takes the other routes off the FIX session, so they 
silently receive nothing
                 Key: CAMEL-26288
                 URL: https://issues.apache.org/jira/browse/CAMEL-26288
             Project: Camel
          Issue Type: Bug
          Components: camel-quickfix
            Reporter: shashank
            Assignee: shashank


{{QuickfixjEndpoint}} supports multiple consumers (it delivers each FIX event 
to all of them), and every route that consumes from the same {{quickfix:}} uri 
shares the endpoint. When a route is removed, the core stops the endpoint of 
its consumer ({{RouteService.doShutdown}}), also when other routes still 
consume from it, and {{QuickfixjEndpoint.doStop}} clears the whole list of 
consumers (main 36bebb520a63, lines 251-255). The consumers of the other routes 
are still started, but no longer get any message, logon or other event of the 
session; nothing is logged and nothing fails. Each consumer already removes 
itself from the endpoint when it stops ({{QuickfixjConsumer.doStop}}), so the 
{{clear()}} only affects consumers that are still running.

Example: two routes 
{{from("quickfix:fix.cfg?sessionID=FIX.4.4:ACCEPTOR->INITIATOR")}} (one that 
processes orders, one that records the session events); the second is removed 
(a reload, a route template removed, JMX/controlbus): the first silently stops 
receiving orders until it is restarted.

*Fix*: remove {{QuickfixjEndpoint.doStop}}; the consumers take themselves off 
the endpoint when they stop, as before, and the engine reference count is 
unchanged.

*Tests*: new {{QuickfixjRemoveRouteTest}} (acceptor and initiator sessions over 
the in-JVM VM pipe transport, configured with {{QuickfixjConfiguration}}): 
{{removingOneOfTwoConsumerRoutesKeepsTheOtherReceiving}} fails on main (3 runs: 
{{mock://a Received message count. Expected: <1> but was: <0>}}); 
{{stoppingOneOfTwoConsumerRoutesKeepsTheOtherReceiving}} (stop without remove, 
the endpoint is not stopped) passes on main and with the fix, as a control. 
With the fix camel-quickfix has 45 tests, 0 failures.

*How it was found*: a code sweep for endpoints whose {{doStop}} releases 
something the other routes on the same uri still use, after a random 
lifecycle-sequence harness found the same kind of defect in camel-disruptor.

*Affected*: main, camel-4.22.x, camel-4.18.x and camel-4.14.x (same {{doStop}}; 
read, not run).

_Filed with Claude Code on behalf of allthingssecurity._



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

Reply via email to