Oh sorry.... I should have added there that this new element will replace the originally proposed "sync" attribute.
Hey Scott... as it turns out, Kevin would also like the static option, so we'll be adding this too. It will look something like the following...<http-gateway....> <asyncResponse status="202" payload="/async-responses/202.xml" /> </http-gateway>
This seem OK?
So both options will be available... the more dynamic version we described above, as well as this static version.
Actually... I implemented this slightly differently so as to allow setting of the contentType and characterEncoding (optional) when a payload is specified...
<asyncResponse statusCode="202"> <payload classpathResource="/readme.txt" contentType="text/plain" characterEncoding="UTF-8" /> </asyncResponse>
Using your workspace/tfennelly/httpg2 code, I've got a small http-gateway prototype up and running. The initial GET comes in through the gateway and triggers another GET on an RSS feed via HttpRouter. The RSS is transformed into HTML using XsltAction, then returned to the client.
It works great but there's one thing I had to write code for that I think may be configurable in jboss-esb.xml. The content-type HTTP header of the RSS feed is different from the content-type header that I need to send back to the client, so I wrote a few lines of code in a custom action to set the content-type header for the final response:
HttpResponse responseInfo = new HttpResponse(200); responseInfo.setContentType("text/html"); responseInfo.setResponse(message); return message;
Right, this isn't possible at the moment, but I see no reason why we can't add support for it. Seems like something others will also run into. I created a JIRA: https://jira.jboss.org/jira/browse/JBESB-2832
BTW... the new http-gateway is now available on trunk.