Mar 10th, 2011, 05:50 PM
HTTP Inbound Gateway
I have a couple questions about using the HTTP Inbound Gateway that I can't seem to find documentation on.
Here is my use case:
Web app through REST --> HTTP Inbound Gateway (supports GET, POST, DELETE) --> Filter --> Send to appropriate queue using AMQP
1. How can I route messages based on the HTTP method? I want to route a GET message to a specific filter, a POST to another, and a DELETE to yet another to do validation of the payload and give immediate response to the caller if the message received is incorrect.
2. Expanding on #1, there is no error-channel attribute on the http:inbound-gateway element, so if I throw an exception in the filter because something in the payload is missing, how can I pass back the error to the web app?
3. How do I tell the gateway that the incoming request will be JSON and to convert it? I don't see a way of specifying a HttpMessageConverter in the XML. Do I need to specify a transformer after the gateway or filter? What if it doesn't convert? How do I throw the error back to the web app?
4. What do the request-key, request-mapper, and response-key attributes mean on the int-http:inbound-gateway element and how do you use them?
For reference, I am using this XSD: http://www.springframework.org/schem...ation-http.xsd
If that is incorrect, please let me know....
Last edited by Rexxe; Mar 10th, 2011 at 05:54 PM.
Reason: Added XSD file
Mar 10th, 2011, 05:57 PM
It looks like I'm using the wrong XSD. The Reference Guide should be updated to include new XSD file.