For microservices to use JMS Messaging on localhost, Docker must be installed and localhost must be connected to an ActiveMQ Server
https://github.com/vromero/activemq-artemis-docker
spring.artemis.user=artemis spring.artemis.password=simetraehcapa
Beer Service is responsible for generating the Beer objects used in the application and stores that Beer object data in a database. Beer Order Service and Beer Inventory make calls to Beer Service to get information about the Beer objects.
Beer object example:
- UUID id = '026cc3c8-3a0c-4083-a05b-e908048c1b08'
- String beer_name = 'Pinball Porter'
- String beer_style = 'PORTER'
- Timestamp created_date = CURRENT_TIMESTAMP
- Timestamp last_modified_date = CURRENT_TIMESTAMP
- Integer min_on_hand = 12
- Integer quantity_to_brew = 200
- BigDecimal price = 12.95
- String upc = '0083783375213'
- Long version = 1
Service Name | Port |
---|---|
Brewery Beer Service | 8080 |
Brewery Beer Order Service | 8081 |
Brewery Beer Inventory Service | 8082 |
- Running the image
There are different methods to run a Docker image, from interactive Docker to Kubernetes and Docker Compose. This documentation will cover only Docker with an interactive terminal mode. You should refer to the appropriate documentation for more information around other execution methods.
To run ActiveMQ with AMQP, JMS and the web console open (if your are running 2.3.0 or later), run the following command:
MAC
docker run -it --rm
-p 8161:8161
-p 61616:61616
vromero/activemq-artemis
WINDOWS docker run -it --rm -p 8161:8161 -p 61616:61616 vromero/activemq-artemis
After a few seconds you'll see in the output a block similar to:
/ \ | | ___ __ __() _____
/ _ | _ \ __|/ _ \ / | |/ __/
/ ___ \ | / |/ / |/| | |_ \
// _| __|| |||/__ /
Apache ActiveMQ Artemis x.x.x
HH:mm:ss,SSS INFO [...] AMQ101000: Starting ActiveMQ Artemis Server
At this point you can open the web server port at 8161 and check the web console using the default username and password of artemis / simetraehcapa.