Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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