Results 1 to 4 of 4

Thread: Serialized object problem with HttpRequestHandlingEndpointSupport

  1. #1
    Join Date
    Aug 2005
    Location
    Halifax, NS, Canada
    Posts
    50

    Default Serialized object problem with HttpRequestHandlingEndpointSupport

    I have wired up an HTTP bridge between two spring integration services as follows. On the sending side (HTTP Client):
    Code:
        <int-http:outbound-channel-adapter id="httpOut"
             url="http://localhost:8080/bridge/gateway"
    	 http-method="POST"
    	 channel="toWebChannel"
    	 extract-payload="false"  />
    In the webapp:

    Code:
        <int-http:inbound-channel-adapter channel="receiveChannel"
              name="/gateway"
              supported-methods="POST"
        />
    The sending has the "extract-payload" property set to false so that the message will be sent serialized, preserving the headers in the message, and more importantly, preserving their case. However, the receiving side does not seem to have an option to specify that the payload is already a serialized message. So it cannot handle this correctly. Note, using a channel adapter because I do not expect a reply.

    The
    Code:
    doHandleRequest
    method of HttpRequestHandlingEndpointSupport calls generatePayloadFromRequestBody, which correctly chooses the SerializingHttpMessageConverter class to convert the HTTP request body into a Message<?>. However, the HttpRequestHandlingEndpointSupport then attempts to construct a new Message using the MessageBuilder with the Message<?> as the payload. That last part fails.

    I can send the messages across without using the SerializingHttpMessageConverter (leave out the extract-payload="false") but then message headers do not preserve their case, since the HTTP Request headers are passed into the header converter un all-lowercase form.
    Don Laidlaw
    Infor Global Solutions

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

    Default

    Could you please open a feature request for this in JIRA? It seems that within HttpRequestHandlingEndpointSupport after deserializing the content of an HTTP request body, we should detect whether that deserialized object is already an instanceof Message.

    Does that make sense?

  3. #3
    Join Date
    Aug 2005
    Location
    Halifax, NS, Canada
    Posts
    50

    Default

    Yes, it does make sense. The Jira issue is INT-2254: https://jira.springsource.org/browse/INT-2254

    It is an improvement issue as requested, but to me it is closer to a bug than an improvement.
    Don Laidlaw
    Infor Global Solutions

  4. #4
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,853

    Default

    Thanks Don. We are going to try to address it in time for RC1 for which we are trying to "freeze" today.

Posting Permissions

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