Created
December 2, 2015 06:09
-
-
Save sreevatsanraman/61591048677655795df9 to your computer and use it in GitHub Desktop.
PathRouting using netty
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
public class AppFabricRestHandler extends NettyRestHandler { | |
.... | |
@Override | |
public void messageReceived(ChannelHandlerContext context, MessageEvent message) throws Exception { | |
HttpRequest request = (HttpRequest) message.getMessage(); | |
HttpMethod method = request.getMethod(); | |
String requestUri = request.getUri(); | |
QueryStringDecoder decoder = new QueryStringDecoder(request.getUri()); | |
String path = decoder.getPath(); | |
if (path.equals("/deploy")) { | |
// Application deploy logic.. | |
return; | |
} | |
if (path.equals("/ping")) { | |
// Respond to ping... | |
return; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment