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

camel-undertow - not respect content-type specified by REST DSL produces when body returns null

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.7.1
    • Fix Version/s: 3.8.0
    • Component/s: camel-undertow
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      camel-undertow ignores content-type specified by REST DSL produces ("application/json") and always returns "text/plain" when the exchange body returned from the REST endpoint is null:

          <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
              <restConfiguration bindingMode="auto" component="undertow"
                  contextPath="test" host="localhost" port="8005"/>
              <rest id="rest-0b0215bd-f133-46f8-968c-4fe21ba4af4f" path="demo">
                  <get id="get-1" produces="application/json" uri="/ping">
                      <description>direct:hello</description>
                      <route>
                          <to uri="direct:hello"/>
                      </route>
                  </get>
              </rest>
              <route id="simple-route">
                  <from id="_from1" uri="direct:hello"/>
                  <setBody id="_setBody1">
                      <simple>${null}</simple>
                  </setBody>
                  <log id="route-log" message=">>> ${body}"/>
              </route>
          </camelContext>
      

      This behaviour doesn't align with camel-jetty & REST DSL or bare undertow server.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tadayosi Tadayoshi Sato
                Reporter:
                tadayosi Tadayoshi Sato
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: