Announcement Announcement Module
Collapse
No announcement yet.
newline being removed from payload when getting in messages over http gateway Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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.

    Code:
    	
    <http:inbound-gateway id="httpInbound"
    		extract-reply-payload="true" supported-methods="POST" request-channel="enterHttp"
    		reply-channel="exitHttp" />
    
    <jms:message-driven-channel-adapter
    		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.

    http://jira.springframework.org/browse/INT

    Comment


    • #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:

      Code:
      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(TypeConverterDelegate.java:231)
      	at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:107)
      	at org.springframework.beans.SimpleTypeConverter.convertIfNecessary(SimpleTypeConverter.java:47)
      	... 58 more

      Comment


      • #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.

        Comment


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

          Comment


          • #6
            I love the edit button

            Comment

            Working...
            X