Book Image

RabbitMQ Essentials

By : David Dossot
Book Image

RabbitMQ Essentials

By: David Dossot

Overview of this book

Table of Contents (17 chapters)

Exposing the authentication service


Your first move towards rolling out the authentication service is to create the definition of the request and response messages used for the authentication service. Since CCM favors JSON as a wire format, you're using the JSON schema to strictly define the schemas of the login request and response messages and the logout request and response messages (these schemas can be found in Appendix, Message Schemas).

With this done, you can now turn to coding and start by creating a new class unsurprisingly named AuthenticationService. It will take care of the communication with RabbitMQ and the dispatch to the internal classes that are actually performing the authentication. Let's look at the first part of the constructor of this class, where we've highlighted the interesting bits:

private static final String INTERNAL_SERVICES_EXCHANGE = "internal-services";
private static final String AUTHENTICATION_SERVICE_QUEUE = "authentication-service";

public AuthenticationService...