Skip to content

Instantly share code, notes, and snippets.

@spericas
Created June 22, 2020 15:46
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save spericas/eaa6a04a94babccb16be6425c8343b71 to your computer and use it in GitHub Desktop.
public class MessageQueueService implements Service {
private final MessageQueue messageQueue = MessageQueue.instance();
@Override
public void update(Routing.Rules routingRules) {
routingRules.post("/board", this::handlePost);
}
private void handlePost(ServerRequest request, ServerResponse response) {
request.content().as(String.class).thenAccept(messageQueue::push);
response.status(204).send();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment