java - HTTP Inbound adapter Differentiate between supported-methods -


i have http inbound adapter defined -

<int-http:inbound-channel-adapter id="httpinboundadapter" channel="receivechannel" name="/inboundadapter.htm" supported-methods="get, post" />  <int:channel id="receivechannel"/>  <int:service-activator input-channel="receivechannel" expression="@sayhello.sayhello(payload)" /> 

i able differentiate between , post request , respond differently them. how can ..?

the message on receivechannel have header http_requestmethod set 'get' or 'post'.

you can use expression="@sayhello.sayhello(payload, headers['http_requestmethod'])", second parameter string.

to avoid hard-coding literal, can use headers[t(org.springframework.integration.http.httpheaders).request_method].

fyi request_url , user_principal populated; and, on adapter/gateway, populate other headers http request parameters or uri variables.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -