Otavio Rodolfo Piske created CAMEL-18695:
--------------------------------------------
Summary: camel-resume-api: avoid requiring a processor for offset
management
Key: CAMEL-18695
URL: https://issues.apache.org/jira/browse/CAMEL-18695
Project: Camel
Issue Type: Improvement
Components: camel-resume-api
Affects Versions: 3.19.0, 3.18.3
Reporter: Otavio Rodolfo Piske
Assignee: Otavio Rodolfo Piske
Fix For: 3.20.0
Currently, in order to update the offsets, the resume API requires a processor
so that the code can do something like:
{code:java}
File path = exchange.getMessage().getHeader("CamelFilePath", File.class);
exchange.getMessage().setHeader(Exchange.OFFSET,
Resumables.of(path.getParentFile(), path));
{code}
However, it would be easier if the code could do something like:
{code:java}
from("file:{{input.dir}}?noop=true&recursive=true")
.resumable().configuration(resumeStrategyConfigurationBuilder.withResumeCache(cache)).offset().auto().to("file:{{output.dir}}");{code}
In this case, the adapter would take care of handling the offset updates.
Alternatively, for slightly more complex scenarios, it could also allow
something like this:
{code:java}
from("file:{{input.dir}}?noop=true&recursive=true").resumable().configuration(resumeStrategyConfigurationBuilder.withResumeCache(cache)).offset().key(header("AHeaderValue")).value(header("SomeOtherHeader").to("file:{{output.dir}}");{code}
Offset updates via processors could still be possible using the existing way.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)