Skip to content

Instantly share code, notes, and snippets.

@johndemic
Created May 22, 2012 02:47
Show Gist options
  • Save johndemic/2766225 to your computer and use it in GitHub Desktop.
Save johndemic/2766225 to your computer and use it in GitHub Desktop.
Synchronously Invoke JMS
@ResponseBody
@RequestMapping(method = RequestMethod.POST)
public Product save(@RequestBody Product product) throws Exception {
MuleMessage response = muleClient.send("jms://products", product, null, 2000);
if (response == null || response.getPayload() instanceof NullPayload) {
throw new InvalidProductResponseException();
} else {
return (Product) response.getPayload();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment