Created
June 22, 2020 15:46
-
-
Save spericas/eaa6a04a94babccb16be6425c8343b71 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
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