Skip to content

Instantly share code, notes, and snippets.

@tjsnell
Created July 11, 2015 14:40
Show Gist options
  • Save tjsnell/f9f5492a955bb80b9309 to your computer and use it in GitHub Desktop.
Save tjsnell/f9f5492a955bb80b9309 to your computer and use it in GitHub Desktop.
@Override
public Object onCall(MuleEventContext eventContext) throws Exception {
MuleMessage message = eventContext.getMessage();
String path = message.getInboundProperty("http.request.uri");
path = path.isEmpty() ? "/" : path;
// create a throw away event just for the lookup
MuleEvent event = new DefaultMuleEvent(message,
MessageExchangePattern.REQUEST_RESPONSE,
eventContext.getFlowConstruct());
// Grab the RAML config
AbstractConfiguration config = eventContext.getMuleContext()
.getRegistry().lookupObject(Configuration.class);
Action action = config.getEventAction(event);
System.out.println("Action " + action);
return message.getPayload();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment