Created
July 11, 2015 14:40
-
-
Save tjsnell/f9f5492a955bb80b9309 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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