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

Claus Ibsen updated CAMEL-27859:
--------------------------------
    Description: 
Found while improving the option descriptions of camel-quickfix for CAMEL-23832 
(commit 
https://github.com/apache/camel/commit/87cb1d00f3100684280f706391ed79b732999e11,
 pull request https://github.com/apache/camel/pull/31145).
These are separate problems of the component; the descriptions change only 
documents the current behavior.

h4. 1. The settings stream is never closed
{{QuickfixjEngine.loadSettings}} does not close the InputStream from 
ResourceHelper.resolveMandatoryResourceAsInputStream, and 
SessionSettings(InputStream) does not either.
Proposed change: try-with-resources.

h4. 2. The engine initializes twice
The constructor calls initializeEngine() for a non-lazy engine and doInit() 
calls it again on start (for a lazy engine ensureInitialized does the same), so 
the initiator/acceptor are created again and the first are thrown away.
Proposed change: return early in doInit when already initialized.

h4. 3. lazyCreateEngine can be silently ignored
{{QuickfixjComponent.createEndpoint}} removes the lazyCreateEngine parameter 
only when it creates a new engine; for an existing engine the endpoint reports 
a value the engine does not have.
Proposed change: always remove it and warn when it differs from engine.isLazy().

h4. 4. The session qualifier is not matched
{{QuickfixjEndpoint.isMatching(SessionID)}} does not compare 
getSessionQualifier(), so a consumer with sessionID ...:q1 also gets the events 
of sessions with another or no qualifier.
Proposed change: compare the qualifier too.


_Claude Code on behalf of davsclaus_

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

h4. 1. The settings stream is never closed
{{QuickfixjEngine.loadSettings}} does not close the InputStream from 
ResourceHelper.resolveMandatoryResourceAsInputStream, and 
SessionSettings(InputStream) does not either.
Proposed change: try-with-resources.

h4. 2. The engine initializes twice
The constructor calls initializeEngine() for a non-lazy engine and doInit() 
calls it again on start (for a lazy engine ensureInitialized does the same), so 
the initiator/acceptor are created again and the first are thrown away.
Proposed change: return early in doInit when already initialized.

h4. 3. lazyCreateEngine can be silently ignored
{{QuickfixjComponent.createEndpoint}} removes the lazyCreateEngine parameter 
only when it creates a new engine; for an existing engine the endpoint reports 
a value the engine does not have.
Proposed change: always remove it and warn when it differs from engine.isLazy().

h4. 4. The session qualifier is not matched
{{QuickfixjEndpoint.isMatching(SessionID)}} does not compare 
getSessionQualifier(), so a consumer with sessionID ...:q1 also gets the events 
of sessions with another or no qualifier.
Proposed change: compare the qualifier too.


_Claude Code on behalf of davsclaus_


> camel-quickfix: the settings stream is never closed, the engine initializes 
> twice, the session qualifier is not matched
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-27859
>                 URL: https://issues.apache.org/jira/browse/CAMEL-27859
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-quickfix
>            Reporter: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.25.0
>
>
> Found while improving the option descriptions of camel-quickfix for 
> CAMEL-23832 (commit 
> https://github.com/apache/camel/commit/87cb1d00f3100684280f706391ed79b732999e11,
>  pull request https://github.com/apache/camel/pull/31145).
> These are separate problems of the component; the descriptions change only 
> documents the current behavior.
> h4. 1. The settings stream is never closed
> {{QuickfixjEngine.loadSettings}} does not close the InputStream from 
> ResourceHelper.resolveMandatoryResourceAsInputStream, and 
> SessionSettings(InputStream) does not either.
> Proposed change: try-with-resources.
> h4. 2. The engine initializes twice
> The constructor calls initializeEngine() for a non-lazy engine and doInit() 
> calls it again on start (for a lazy engine ensureInitialized does the same), 
> so the initiator/acceptor are created again and the first are thrown away.
> Proposed change: return early in doInit when already initialized.
> h4. 3. lazyCreateEngine can be silently ignored
> {{QuickfixjComponent.createEndpoint}} removes the lazyCreateEngine parameter 
> only when it creates a new engine; for an existing engine the endpoint 
> reports a value the engine does not have.
> Proposed change: always remove it and warn when it differs from 
> engine.isLazy().
> h4. 4. The session qualifier is not matched
> {{QuickfixjEndpoint.isMatching(SessionID)}} does not compare 
> getSessionQualifier(), so a consumer with sessionID ...:q1 also gets the 
> events of sessions with another or no qualifier.
> Proposed change: compare the qualifier too.
> _Claude Code on behalf of davsclaus_



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

Reply via email to