[ 
https://issues.apache.org/jira/browse/CAMEL-17751?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17501762#comment-17501762
 ] 

Vangelis Papanastasatos commented on CAMEL-17751:
-------------------------------------------------

When setting logging level to DEBUG, the following log entries were observed:

*v3.7.2*

{{2022-03-05 17:21:13.429 DEBUG 37992 --- [nio-8080-exec-3] 
o.a.coyote.http11.Http11InputBuffer      : Received [PUT 
/api/lra-participant/complete?Camel-Saga-Compensate=direct://sagaCompensated&Camel-Saga-Complete=direct://sagaCompleted
 HTTP/1.1}}
{{Content-Type: text/plain}}
{{Long-Running-Action: 
http://localhost:50000/lra-coordinator/0_ffffc0a80165_caf4_62236d7c_191}}
{{Long-Running-Action-Recovery: 
http://localhost:50000/lra-coordinator/recoveryhttp%3A%2F%2Flocalhost%3A50000%2Flra-coordinator%2F0_ffffc0a80165_caf4_62236d7c_191/0_ffffc0a80165_caf4_62236d7c_193}}
{{Content-Length: 0}}
{{Host: localhost:8080}}
{{Connection: Keep-Alive}}
{{{}User-Agent: Apache-HttpClient/4.5.12 (Java/11.0.7){}}}{{{}]{}}}
{{2022-03-05 17:21:13.430 DEBUG 37992 --- [nio-8080-exec-3] 
org.apache.tomcat.util.http.Parameters   : Set query string encoding to UTF-8}}
{{2022-03-05 17:21:13.431 DEBUG 37992 --- [nio-8080-exec-3] 
o.a.c.authenticator.AuthenticatorBase    : Security checking request PUT 
/api/lra-participant/complete}}
{{2022-03-05 17:21:13.431 DEBUG 37992 --- [nio-8080-exec-3] 
org.apache.catalina.realm.RealmBase      :   No applicable constraints defined}}
{{2022-03-05 17:21:13.431 DEBUG 37992 --- [nio-8080-exec-3] 
o.a.c.authenticator.AuthenticatorBase    : Not subject to any constraint}}
{{2022-03-05 17:21:13.432 DEBUG 37992 --- [nio-8080-exec-3] 
org.apache.tomcat.util.http.Parameters   : Set encoding to UTF-8}}
{{2022-03-05 17:21:13.433 DEBUG 37992 --- [nio-8080-exec-3] 
org.apache.tomcat.util.http.Parameters   : Decoding query null UTF-8}}
{{2022-03-05 17:21:13.433 DEBUG 37992 --- [nio-8080-exec-3] 
org.apache.tomcat.util.http.Parameters   : Start processing with input 
[Camel-Saga-Compensate=direct://sagaCompensated&Camel-Saga-Complete=direct://sagaCompleted]}}
{{2022-03-05 17:21:13.434 DEBUG 37992 --- [nio-8080-exec-3] 
o.a.camel.processor.FilterProcessor      : *Filter matches: true for exchange: 
Exchange[]*}}

 

{{*v3.14.2*}}

{{2022-03-05 17:50:41.563 DEBUG 43808 --- [nio-8080-exec-3] 
o.a.coyote.http11.Http11InputBuffer      : Received [PUT 
/api/lra-participant/complete?Camel-Saga-Compensate=direct://sagaCompensated&Camel-Saga-Complete=direct://sagaCompleted
 HTTP/1.1}}
{{Content-Type: text/plain}}
{{Long-Running-Action: 
http://localhost:50000/lra-coordinator/0_ffffc0a80165_caf4_62236d7c_1a7}}
{{Long-Running-Action-Recovery: 
http://localhost:50000/lra-coordinator/recoveryhttp%3A%2F%2Flocalhost%3A50000%2Flra-coordinator%2F0_ffffc0a80165_caf4_62236d7c_1a7/0_ffffc0a80165_caf4_62236d7c_1a9}}
{{Content-Length: 0}}
{{Host: localhost:8080}}
{{Connection: Keep-Alive}}
{{{}User-Agent: Apache-HttpClient/4.5.12 (Java/11.0.7){}}}{{{}]{}}}
{{2022-03-05 17:50:41.564 DEBUG 43808 --- [nio-8080-exec-3] 
org.apache.tomcat.util.http.Parameters   : Set query string encoding to UTF-8}}
{{2022-03-05 17:50:41.564 DEBUG 43808 --- [nio-8080-exec-3] 
o.a.c.authenticator.AuthenticatorBase    : Security checking request PUT 
/api/lra-participant/complete}}
{{2022-03-05 17:50:41.565 DEBUG 43808 --- [nio-8080-exec-3] 
org.apache.catalina.realm.RealmBase      :   No applicable constraints defined}}
{{2022-03-05 17:50:41.566 DEBUG 43808 --- [nio-8080-exec-3] 
o.a.c.authenticator.AuthenticatorBase    : Not subject to any constraint}}
{{2022-03-05 17:50:41.567 DEBUG 43808 --- [nio-8080-exec-3] 
org.apache.tomcat.util.http.Parameters   : Set encoding to UTF-8}}
{{2022-03-05 17:50:41.568 DEBUG 43808 --- [nio-8080-exec-3] 
org.apache.tomcat.util.http.Parameters   : Decoding query null UTF-8}}
{{2022-03-05 17:50:41.568 DEBUG 43808 --- [nio-8080-exec-3] 
org.apache.tomcat.util.http.Parameters   : Start processing with input 
[Camel-Saga-Compensate=direct://sagaCompensated&Camel-Saga-Complete=direct://sagaCompleted]}}
{{2022-03-05 17:50:41.568 DEBUG 43808 --- [nio-8080-exec-3] 
o.a.camel.processor.FilterProcessor      : *Filter matches: false for exchange: 
Exchange[]*}}

 

In both of the cases, the predicate that the filter tried to match is

{{header(Camel-Saga-Complete) is not null}}

 

Narayana in both cases sends the following request:

{{PUT 
/api/lra-participant/complete?Camel-Saga-Compensate=direct://sagaCompensated&Camel-Saga-Complete=direct://sagaCompleted}}

 

It seems that the query parameters are not correctly parsed and added as 
headers in the exchange, thus the filter is failing to match. Header 
CamelHttpQuery contains correctly the values.

> LRASagaService does not proceed to completion or compensation routes
> --------------------------------------------------------------------
>
>                 Key: CAMEL-17751
>                 URL: https://issues.apache.org/jira/browse/CAMEL-17751
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 3.14.1
>            Reporter: Vangelis Papanastasatos
>            Priority: Major
>
> When using LRASagaService for a saga, neither the completion or compensation 
> routes are being triggered correctly.
>  
> The last version that the behaviour was correct seems to be v3.7.2
>  
> A project replicating the error can be found in 
> [GitHub|https://github.com/vagpap/camel-lra-example/tree/camel-3.14.1]
> The same project, with working v3.7.2, is located in branch 
> [camel-3.7.2.|https://github.com/vagpap/camel-lra-example/tree/camel-3.14.1]
>  
> Narayana v5.12.x was used as the transaction manager in both versions.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to