-
Bug
-
Resolution: Unresolved
-
Major
-
3.20.0.GA, 3.27.0.GA
-
None
-
False
-
-
False
-
-
-
-
Moderate
-
0
I have a simple route:
<from uri="direct://start"/>
<choice>
<when>
<xpath saxon="true">/*:test/*:foo/text() = 'bar'</xpath>
<log message="Condition met: foo equals bar"/>
<method ref="someBean" method="processFooBar"/>
</when>
<otherwise>
<log message="Condition not met: foo does not equal bar"/>
</otherwise>
</choice>
The xml input is as follows:
<test><foo>not bar</foo><message>Hello, Camel in Quarkus!</message></test>
The XPath expression was evaluated against the xml input as *false*. So the Bean method "someBean" should not be invoked. However, the camel still prints out:
2025-12-17 11:04:07,531 INFO [xx.xxx.xxx.SomeBean] (executor-thread-1) Inside SomeBean.processFooBar()
Furthermore, when the xml input was evaluated as *true*, the <otherwise> block was still invoked. It seems that the Bean method had completed malfunctioned, and caused camel flow to malfunction too.
Workaround:
Change the Bean method to Bean component should resolve the issue. For instance:
<from uri="direct://start"/>
<choice>
<when>
<xpath saxon="true">/*:test/*:foo/text() = 'bar'</xpath>
<log message="Condition met: foo equals bar"/>
<!--method ref="someBean" method="processFooBar"/-->
<to uri="bean:someBean?method=processFooBar"/>
</when>
<otherwise>
<log message="Condition not met: foo does not equal bar"/>
</otherwise>
</choice>
1.
|
Provide a Fix for Bean method does not work when worked with Choice EIP |
|
To Do | |
Unassigned |
2.
|
Productization Bean method does not work when worked with Choice EIP |
|
New | |
Unassigned |
3.
|
Automate test for Bean method does not work when worked with Choice EIP |
|
New | |
Unassigned |