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

Marco Bungart updated CAMEL-19010:
----------------------------------
    Description: 
When we beind 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:
 * 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}}
 * 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}}

---

Remark: this holds also true when a repository is set as 
{{inProgressRepository(....)}}

  was:
When we beind an idempotent repository to a file component:

{{from(}}
{{    file("in")}}
{{        .noop(true)}}
{{        .idempotent(true)}}
{{        .idempotentRepository(idempotentRepository)}}
{{        .idempotentKey("${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:
 * 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}}
 * 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}}
 * {{{}{}}}{{{}{}}}


> file component: confirm not called on idempotentRepository
> ----------------------------------------------------------
>
>                 Key: CAMEL-19010
>                 URL: https://issues.apache.org/jira/browse/CAMEL-19010
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-file
>    Affects Versions: 3.20.1
>            Reporter: Marco Bungart
>            Priority: Major
>
> When we beind 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:
>  * 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}}
>  * 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}}
> ---
> Remark: this holds also true when a repository is set as 
> {{inProgressRepository(....)}}



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

Reply via email to