Simple example how Spring JMS + ActiveMQ work together to save the cart from one service to another.
docker run -p 8161:8161 -p 61616:61616 --name activemq webcenter/activemq:latest
http://localhost:8161/admin/
Login: admin
Password: admin
Method | Resource | Description |
---|---|---|
POST |
/cart/saveOrder |
Save an order |
Method | Resource | Description |
---|---|---|
GET |
/orders |
Get all orders |
GET |
/orders/{id} |
Get one order |
curl -X POST \
http://localhost:8081/cart/saveOrder \
-H 'Accept: */*' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Length: 537' \
-H 'Content-Type: application/json' \
-H 'Host: localhost:8081' \
-H 'Postman-Token: 09ab565e-42b6-49a4-be12-6a24d0e07040,3284bf6e-b956-4e16-8032-4eeab29eb730' \
-H 'User-Agent: PostmanRuntime/7.19.0' \
-H 'cache-control: no-cache' \
-d '{
"firstName": "Thomas",
"lastName": "White",
"address": "New York street 155.5",
"products": [
{
"productId": 1,
"name": "Iphone X",
"quantity": 1,
"price": 1500
},
{
"productId": 2,
"name": "Cannon X1500",
"quantity": 1,
"price": 5500
}
,
{
"productId": 3,
"name": "Samsung TV",
"quantity": 2,
"price": 4500
}
]
}'s
curl -X GET \
http://localhost:8081/orders \
-H 'Accept: */*' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/json' \
-H 'Host: localhost:8081' \
-H 'Postman-Token: af7de86a-1b9e-44cb-8fab-fb59f75aa22f,df247439-35d8-4544-ac7b-c977571bfd82' \
-H 'User-Agent: PostmanRuntime/7.19.0' \
-H 'cache-control: no-cache'
curl -X GET \
http://localhost:8081/orders/1 \
-H 'Accept: */*' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/json' \
-H 'Host: localhost:8081' \
-H 'Postman-Token: bae64828-286b-47fe-a8b5-480a4395dd49,9abec91b-122e-4f70-a500-701692a8a4ae' \
-H 'User-Agent: PostmanRuntime/7.19.0' \
-H 'cache-control: no-cache'