[
https://issues.apache.org/jira/browse/CAMEL-20866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17854755#comment-17854755
]
Raymond commented on CAMEL-20866:
---------------------------------
I suspected that this was as expected, that's why I first asked it on Zulip. I
think this solution is nice though, because sometimes technically this can be
logical, but still can be confusing from a functional perspective.
> SEDA with exchangepattern InOnly gives sometimes multiple responses
> -------------------------------------------------------------------
>
> Key: CAMEL-20866
> URL: https://issues.apache.org/jira/browse/CAMEL-20866
> Project: Camel
> Issue Type: Bug
> Components: camel-seda
> Affects Versions: 4.6.0
> Reporter: Raymond
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 4.7.0
>
> Attachments: main-xml.zip
>
>
> I have Camel 4.6 running on Java 21
> When I use the following curl:
> {code:java}
> curl -X POST --header "Content-Type: text/plain" --data 'x'
> http://localhost:9001/test{code}
> To test the following route:
> {code:java}
> <routes id="camel" xmlns="http://camel.apache.org/schema/spring">
> <route id="1">
> <from uri="jetty:http://0.0.0.0:9001/test"/>
> <to uri="seda:2?exchangePattern=InOut"/>
> </route>
> <route id="2">
> <from uri="seda:2"/>
> <setBody>
> <constant>Y</constant>
> </setBody>
> </route>
> </routes>{code}
> This works as expected and the result is Y.
> Now I changed the exchangepattern from 'InOut' to 'InOnly':
> {code:java}
> <routes id="camel" xmlns="http://camel.apache.org/schema/spring">
> <route id="1">
> <from uri="jetty:http://0.0.0.0:9001/test"/>
> <to uri="seda:2?exchangePattern=InOnly"/>
> </route>
> <route id="2">
> <from uri="seda:2"/>
> <setBody>
> <constant>Y</constant>
> </setBody>
> </route>
> </routes>{code}
> When I call this flow with curl multiple times, I sometimes get the result:
> X
> And the other time:
> XX
> So the result is returned twice or even more times. I would expect only to
> get the output X (which for example works this way when I use ActiveMQ).
> It may take more than 10 times before you can see the double responses, but
> this behavior can be easier reproduced by adding more SEDA endpoints:
> {code:java}
> <routes id="camel" xmlns="http://camel.apache.org/schema/spring"> <route
> id="1"> <from uri="jetty:http://0.0.0.0:9001/test"/> <to
> uri="seda:2?exchangePattern=InOnly"/> </route> <route id="2"> <from
> uri="seda:2"/> <to uri="seda:3"/> </route> <route id="3"> <from
> uri="seda:3"/> <to uri="seda:4"/> </route> <route id="4"> <from
> uri="seda:4"/> <to uri="seda:5"/> </route> <route id="5"> <from
> uri="seda:5"/> <setBody> <constant>Y</constant> </setBody>
> </route></routes>{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)