John Oxley
John Oxley

Reputation: 14990

Spring Integration http:inbound-gateway payload type

I have an HTTP inbound gateway

<int-http:inbound-gateway name="/purchase"
    supported-methods="GET" request-channel="purchaseRequest"
    reply-channel="purchaseReply"
    request-payload-type="com.myapp.PurchaseRequest" />

What is the format that I have to call the URL to populate the PurchaseRequest object rather than submit a LinkedMultiValueMap.

Upvotes: 1

Views: 2046

Answers (1)

Gary Russell
Gary Russell

Reputation: 174554

The

request-payload-type

attribute doesn't apply for GET, HEAD and OPTIONS methods.

If you can upgrade to 2.1, and you have an appropriate constructor on your PurchaseRequest object, you could use

payload-expression="new com.myapp.PurchaseRequest(#requestParams['param1'], #requestParams['param2'], ...)"

Upvotes: 2

Related Questions