Announcement Announcement Module
Collapse
No announcement yet.
Add cookie to http outbound-gateway request Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Add cookie to http outbound-gateway request

    Using spring-integration 1.0.4. We have a service-to-service interaction where the SI is posting data to another web service. This post request must include a cookie value.

    Searching the forum, I did not find a similiar setup and problem. The http namespace does not document anything obvious on how to accomplish this either? Is the solution custom code in an OutboundRequestMapper or perhaps replace the <http:outbound-gateway> with a service activator and use httpclient directly?

    Any advice would be appreciated. Thanks.

  • #2
    It appears that the outbound gateway does not support setting cookies (or additional http headers). I looked at src for SimpleHttpRequestExecutor.java and CommonsHttpRequestExecutor.java and neither provide a mechanism to do something like c.addRequestHeader().

    I was thinking that maybe if the channel message had headers of a certain namespace, that it might automatically apply them to the http connection, thereby setting the http request headers. Does this idea make sense for a future release?

    To solve my immediate need, I am going to scratch the outbound-gateway and write a quick and dirty service-activator to do the job.

    Comment


    • #3
      Do you know when/if you'll be able to upgrade to Spring Integration 2.0?

      Comment


      • #4
        We are fairly invested in Spring 2.5.6, so moving to SI 2.0 (requiring Spring 3.x) maybe be 6 months out. No worries though... question answered.

        Comment


        • #5
          Okay. It might be worth looking at the Spring 3.0 RestTemplate and underlying HTTP client-side library at least to get a few ideas.

          Comment

          Working...
          X