[
https://issues.apache.org/jira/browse/CAMEL-27847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen updated CAMEL-27847:
--------------------------------
Description:
Found while improving the option descriptions of camel-plc4x for CAMEL-23832
(commit
https://github.com/apache/camel/commit/387f7ff0b6ea13b1acc5d8ca1e8ae0ec8dbee737,
pull request https://github.com/apache/camel/pull/31143).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. A failed read is lost and the consumer never reads again
{{Plc4XConsumer.startUnTriggered}} calls request.execute().thenAccept(...) and
drops the returned future; a read that completes exceptionally is lost (no log,
no exception handler), and as the consumer reads only once it never reads
again. There is also no request timeout, unlike the producer and the triggered
consumer.
Proposed change: handle the failure with whenComplete/exceptionally (exception
handler) and add orTimeout(REQUEST_TIMEOUT_MILLIS).
h4. 2. A failed connection does not fail the start
{{Plc4XConsumer.doStart}} and {{Plc4XProducer.doStart}} with
autoReconnect=false catch a connection failure and only call doStop(), so the
route starts; the consumer never reads and the producer fails each exchange.
The triggered consumer fails its start instead.
Proposed change: rethrow, as Plc4XTriggeredConsumer does.
_Claude Code on behalf of davsclaus_
was:
Found while improving the option descriptions of camel-plc4x for CAMEL-23832
(pull request https://github.com/apache/camel/pull/31143).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. A failed read is lost and the consumer never reads again
{{Plc4XConsumer.startUnTriggered}} calls request.execute().thenAccept(...) and
drops the returned future; a read that completes exceptionally is lost (no log,
no exception handler), and as the consumer reads only once it never reads
again. There is also no request timeout, unlike the producer and the triggered
consumer.
Proposed change: handle the failure with whenComplete/exceptionally (exception
handler) and add orTimeout(REQUEST_TIMEOUT_MILLIS).
h4. 2. A failed connection does not fail the start
{{Plc4XConsumer.doStart}} and {{Plc4XProducer.doStart}} with
autoReconnect=false catch a connection failure and only call doStop(), so the
route starts; the consumer never reads and the producer fails each exchange.
The triggered consumer fails its start instead.
Proposed change: rethrow, as Plc4XTriggeredConsumer does.
_Claude Code on behalf of davsclaus_
> camel-plc4x: a failed read of the untriggered consumer is lost, a failed
> connection does not fail the start
> -----------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-27847
> URL: https://issues.apache.org/jira/browse/CAMEL-27847
> Project: Camel
> Issue Type: Bug
> Reporter: Claus Ibsen
> Priority: Minor
> Fix For: 4.25.0
>
>
> Found while improving the option descriptions of camel-plc4x for CAMEL-23832
> (commit
> https://github.com/apache/camel/commit/387f7ff0b6ea13b1acc5d8ca1e8ae0ec8dbee737,
> pull request https://github.com/apache/camel/pull/31143).
> These are separate problems of the component; the descriptions change only
> documents the current behavior.
> h4. 1. A failed read is lost and the consumer never reads again
> {{Plc4XConsumer.startUnTriggered}} calls request.execute().thenAccept(...)
> and drops the returned future; a read that completes exceptionally is lost
> (no log, no exception handler), and as the consumer reads only once it never
> reads again. There is also no request timeout, unlike the producer and the
> triggered consumer.
> Proposed change: handle the failure with whenComplete/exceptionally
> (exception handler) and add orTimeout(REQUEST_TIMEOUT_MILLIS).
> h4. 2. A failed connection does not fail the start
> {{Plc4XConsumer.doStart}} and {{Plc4XProducer.doStart}} with
> autoReconnect=false catch a connection failure and only call doStop(), so the
> route starts; the consumer never reads and the producer fails each exchange.
> The triggered consumer fails its start instead.
> Proposed change: rethrow, as Plc4XTriggeredConsumer does.
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)