Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-20866

SEDA with exchangepattern InOnly gives sometimes multiple responses

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 4.6.0
    • 4.7.0
    • camel-seda
    • None
    • Unknown

    Description

      I have Camel 4.6 running on Java 21

      When I use the following curl:

      curl -X POST --header "Content-Type: text/plain" --data 'x' http://localhost:9001/test

      To test the following route:

      <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>

      This works as expected and the result is Y.

      Now I changed the exchangepattern from 'InOut' to 'InOnly':

      <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>

      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:

      <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>

      Attachments

        1. main-xml.zip
          16 kB
          Raymond

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              skin27 Raymond
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: