Announcement Announcement Module
No announcement yet.
newline being removed from payload when getting in messages over http gateway Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • newline being removed from payload when getting in messages over http gateway

    Hi, I am not sure if I am mistaken somewhere - In my Spring Integration application, I have two inbound gateways defined, one for http and one for jms. I am seeing all the newline characters of the messages being routed through the http gateway being removed, whereas it is retained correctly in the jms gateway.

    <http:inbound-gateway id="httpInbound"
    		extract-reply-payload="true" supported-methods="POST" request-channel="enterHttp"
    		reply-channel="exitHttp" />
    		id="jmsIn" destination="destination" channel="enterJMS" />

  • #2
    Could you attach a test case that shows this behavior to a JIRA issue? We can discuss if it's a problem that needs fixing there.


    • #3
      Thanks iwein, I overreacted, on a second try with a standalone project I did not see this behavior with http inbound gateway, the newlines are being correctly preserved, so it looks like it is something specific I am doing in my first project. I am still checking on what could be causing the newline truncation behavior with my first project. One thing I noticed was that the http request explicitly requires a content-type header of text/xml, otherwise it gives the following error:

      Caused by: java.lang.IllegalArgumentException: Cannot convert value of type [org.springframework.integration.message.GenericMessage] to required type [java.lang.String]: no matching editors or conversion strategy found
      	at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(
      	at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(
      	at org.springframework.beans.SimpleTypeConverter.convertIfNecessary(
      	... 58 more


      • #4
        Yeah, iirc the default is to convert the request to a byte[], because a request is like a box of chocolates* (unless the Content-Type is set).

        *) Forest Gump
        Last edited by iwein; Sep 22nd, 2009, 02:34 PM.


        • #5
          I believe you meant "a box of chocolates"?


          • #6
            I love the edit button