AMQP Cloudlet quickstarts
The AMQP cloudlet quickstart can be used as a base for the fat-jar AMQP microservices. If you wanna create a simple backend application capable of exposing AMQP-endpoint and handling the AMQP-based communication, the AMQT cloudlet quickstart is the best way to start your development efforts.
Creating and running the AMQP cloudlet project
In order to create the AMQP cloudlet project execute the following commands:
To start the AMQP cloudlet execute the following command:
You can also build and run it as a Docker image (we love Docker and highly recommend this approach):
AMQP broker
By default AMQP cloudlet quickstart starts embedded ActiveMQ AMQP broker (on 5672 port). If you would like to connect your cloudlet application to the external ActiveMQ broker (instead of starting the embedded one), run the cloudlet with the BROKER_URL
environment variable or system property, for example:
...or...
Sample chat application
The AMQP cloudlet quickstart is in fact a simple chat application. Clients can send the messages to the chat channel by subscribing to the broker and sending the messages to the chat
AMQP queue.
The clients can subscribe to the chat updates by listening on the chat-updates
AMQP topic - whenever the new message has been sent to the chat channel, the clients registered to the chat-updates
will receive the updated chat history.
The quickstart also exposes the simple REST API that can be used to read the chat history using the HTTP GET
request:
Architectural overview
When AMQP cloudlet is started with the embedded ActiveMQ broker, the architecture of the example is the following:
When you connect to the external ActiveMQ broker (using BROKER_URL
option), the architecture of the example becomes more like the following diagram:
Last updated