Queues
Create rest endpoint and push message to RabbitMQ using provided data
Categories:
Push new message to RabbitMq via rest endpoint POST /api/analytics
Create file ./rest/analytics.json
{
"path": "/api/analytics",
"methods": [
"POST"
],
"query": "analytics-push",
"authorized": false
}
Create file ./queries/analytics-push.json
{
"type": "rabbit-publish",
"id": "analytics-push",
"connection": "sample-rabbit-connection",
"queue": "analytics",
"exchange": "",
"body": {
"productId": ":productId",
"campaign": ":campaign",
"campaignProduct": ":productId - :campaign"
},
"headers": {
"testHeaderId": 1234,
"productId": ":productId"
},
"params": [
{
"name": "productId",
"required": true
},
{
"name": "campaign",
"required": true
}
]
}
POST http://localhost:8080/api/analytics with body
{
"productId": "1234",
"campaign": "winter"
}
You will end up with this message on rabbitMq
Last modified April 16, 2024: content fix (a2d9b96)