Results 1 to 6 of 6

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

  1. #1

    Default 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. #2
    Join Date
    May 2007
    Location
    Netherlands
    Posts
    614

    Default

    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

  3. #3

    Default

    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

  4. #4
    Join Date
    May 2007
    Location
    Netherlands
    Posts
    614

    Default

    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 at 01:34 PM.

  5. #5
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    I believe you meant "a box of chocolates"?

  6. #6
    Join Date
    May 2007
    Location
    Netherlands
    Posts
    614

    Default

    I love the edit button

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •