[
https://issues.apache.org/jira/browse/CAMEL-20866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17854658#comment-17854658
]
Claus Ibsen commented on CAMEL-20866:
-------------------------------------
If I convert the payload to a byte[] before seda, then this will not happen
{code:java}
<from uri="jetty:http://0.0.0.0:9001/test"/>
<convertBodyTo type="byte[]"/>
<to uri="seda:2?exchangePattern=InOnly"/>
x1
x2
x3
x4
x5
x6
x7
x8
x9
x10
x11
x12
x13
x14
x15
x16
x17
x18
x19
x20
x21
x22
x23
x24
x25
x26
x27
x28
x29
x30
x31
x32
x33
x34
x35
x36
x37
x38
x39
x40
x41
x42
x43
x44
x45
x46
x47
x48
x49
x50
x51
x52
x53
x54
x55
x56
x57
x58
x59
x60
x61
x62
x63
x64
x65
x66
x67
x68
x69
x70
x71
x72
x73
x74
x75
x76
x77
x78
x79
x80
x81
x82
x83
x84
x85
x86
x87
x88
x89
x90
x91
x92
x93
x94
x95
x96
x97
x98
x99
x100 {code}
> 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
> Priority: Minor
> 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)