[
https://issues.apache.org/jira/browse/CAMEL-24994?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen updated CAMEL-24994:
--------------------------------
Description:
A deep review of the Content Enricher EIPs (enrich / Enricher and pollEnrich /
PollEnricher) found the bug below in both. It was reproduced against
4.23.0-SNAPSHOT.
*The on completions of the resource exchange are lost when the enrich fails.*
The on completions (synchronizations) registered on the resource exchange only
ran when the enrichment succeeded. When the resource failed, or when the
aggregation strategy threw an exception, they never ran.
* pollEnrich from a file: when the aggregation failed, the polled file's on
completion (commit/rollback, and removal from the in-progress repository) did
not run. So the file stayed marked as in progress, and it was not polled again
until the application was restarted.
* enrich: when the enrich failed, the on completion that a producer registers
to release a resource did not run. The http producer, for example, closes the
response stream this way.
When the resource was used (aggregated, or discarded by the aggregation
strategy), its on completions are handed over to run together with the original
exchange. When the resource or the aggregation failed, they now run right away
as failed, so a polled file is rolled back and can be polled again. They are
not handed over on the failure paths, as the exchange may still recover (for
example by redelivery), and a file whose content was never used would then be
committed.
_Claude Code on behalf of Claus Ibsen_
was:
A deep review of the Content Enricher EIPs (enrich / Enricher and pollEnrich /
PollEnricher) found the bug below in both. It was reproduced against
4.23.0-SNAPSHOT.
*The on completions of the resource exchange are lost when the enrich fails.*
The on completions (synchronizations) registered on the resource exchange were
only handed over to the original exchange when the enrichment succeeded. When
the resource failed, when the aggregation strategy threw an exception, or when
it returned null, they were never run.
* pollEnrich from a file: the polled file's on completion (commit/rollback, and
removal from the in-progress repository) did not run when the aggregation
failed. So the file stayed marked as in progress, and it was not polled again
until the application was restarted.
* enrich: the on completion that a producer registers to release a resource did
not run when the enrich failed. The http producer, for example, closes the
response stream this way.
The on completions are now handed over in all cases, so they run with the
original exchange (onFailure when it failed).
_Claude Code on behalf of Claus Ibsen_
> camel-core - Enrich and Poll Enrich EIPs: the resource on completions are
> lost when the enrich fails
> ----------------------------------------------------------------------------------------------------
>
> Key: CAMEL-24994
> URL: https://issues.apache.org/jira/browse/CAMEL-24994
> Project: Camel
> Issue Type: Bug
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Major
>
> A deep review of the Content Enricher EIPs (enrich / Enricher and pollEnrich
> / PollEnricher) found the bug below in both. It was reproduced against
> 4.23.0-SNAPSHOT.
> *The on completions of the resource exchange are lost when the enrich fails.*
> The on completions (synchronizations) registered on the resource exchange
> only ran when the enrichment succeeded. When the resource failed, or when the
> aggregation strategy threw an exception, they never ran.
> * pollEnrich from a file: when the aggregation failed, the polled file's on
> completion (commit/rollback, and removal from the in-progress repository) did
> not run. So the file stayed marked as in progress, and it was not polled
> again until the application was restarted.
> * enrich: when the enrich failed, the on completion that a producer registers
> to release a resource did not run. The http producer, for example, closes the
> response stream this way.
> When the resource was used (aggregated, or discarded by the aggregation
> strategy), its on completions are handed over to run together with the
> original exchange. When the resource or the aggregation failed, they now run
> right away as failed, so a polled file is rolled back and can be polled
> again. They are not handed over on the failure paths, as the exchange may
> still recover (for example by redelivery), and a file whose content was never
> used would then be committed.
> _Claude Code on behalf of Claus Ibsen_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)