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

Claus Ibsen updated CAMEL-19010:
--------------------------------
    Priority: Minor  (was: Major)

> file component: confirm not called on idempotentRepository
> ----------------------------------------------------------
>
>                 Key: CAMEL-19010
>                 URL: https://issues.apache.org/jira/browse/CAMEL-19010
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-file
>    Affects Versions: 3.20.1
>            Reporter: Marco Bungart
>            Priority: Minor
>             Fix For: 4.x
>
>
> When we bind an idempotent repository to a file component:
> {{from(}}
> {{    file("in")}}
> {{        .noop(true)}}
> {{        .idempotent(true)}}
> {{        .idempotentRepository(idempotentRepository)}}
> {{        .idempotentKey("${[file:name|file:///name]}"))}}
> {{    .}}
> {{    .}}
> {{    .}}
> then method {{confirm(...)}} should be called after the exchange has been 
> processed.
> —
> Expected behaviour: method {{confirm(...)}} should be called after the 
> exchange has been processed
> —
> Actual behaviour: method {{confirm(...)}} is not called.
> —
> Reproducer:
>  * Working scenario: bind the idempotency repository "after" the file 
> producer:
>  ** checkout [this {{github.com}} 
> repo|https://github.com/turing85/camel-quarkus-idempotent-consumer]
>  ** start the database: {{cd local-deployment && docker compose up -d && cd 
> ..}}
>  ** start the quarkus application. {{./mvnw quarkus:dev}}
>  ** in a separate terminal, move some file in folder {{in}}
>  ** go to pgadmin4: [http://localhost:8091|http://localhost:8091/] (username: 
> {{{}[email protected]{}}}, password: {{{}pgadmin4{}}})
>  ** on the left side, click on {{{}docker{}}}, then on {{{}postgres{}}}. When 
> prompted for a password for databaes {{{}postgres{}}}, enter {{postgres}}
>  ** click {{{}Databases -> camel -> Schemas -> public -> tables{}}}, 
> right-click {{{}idempotency{}}}, select "show data"
>  ** observe that the entry has the column {{done}} set to {{true}}
>  ** stop the quarkus application
>  ** clear database table {{idempotency}}
>  ** delete folders {{in}} and {{{}out{}}}: {{rm -rf in && rm -rf out}}
>  * Bug scenario:
>  ** switch to branch {{{}repository-on-file-producer{}}}: {{git fetch && git 
> switch repository-on-file-producer}}
>  ** start quarkus application and repeat the test
>  ** go to pgadmin4, observe that a row was created, but {{done}} is not set 
> to {{true}}
> Going further, we can also set a break point in or on [method 
> {{confirm(...)}}|https://github.com/turing85/camel-quarkus-idempotent-consumer/blob/repository-on-file-producer/src/main/java/de/turing85/CustomJdbcMessageIdRepository.java#L103],
>  and it will not be triggered.
> —
> Remark: this holds also true when a repository is set as 
> {{inProgressRepository(...)}}
> —
> FTR: [Relevant zulip 
> chat|https://camel.zulipchat.com/#narrow/stream/257298-camel/topic/camel.20file.20idempotent.20repository.2C.20when.20is.20a.20key.20committed.3F]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to