1

I need to send message with headers through Artemis Queue. How could do it.

Headers:--header 'PAYMENT_RE: PAGO-X' \
--header 'Content-Type: application/json' \
--header 'OPERATION_ID: 72ab0c45-7871-4fdc-9cb7-e8644a87372d' \
--header 'ORDER_ID: 242221347' \





11:41
TRACING_HEADERS=[{\"uber-trace-id\":\"1429c44436cbaaa7%3A1dca2e791ce1724c%3A39ca9cdcbc9f1fa6%3A1\"},{\"uber-trace-id\":\"1429c44436cbaaa7%3Ae97e978f0d2e92e9%3A1dca2e791ce1724c%3A1\"},{\"uber-trace-id\":\"1429c44436cbaaa7%3A3f839f45ce8cf16d%3Ae97e978f0d2e92e9%3A1\"},{\"uber-trace-id\":\"1429c44436cbaaa7%3A7cc993c33466cb90%3A3f839f45ce8cf16d%3A1\"},{\"uber-trace-id\":\"1429c44436cbaaa7%3A4b4368e0660b8363%3A7cc993c33466cb90%3A1\"},{\"uber-trace-id\":\"1429c44436cbaaa7%3Abfd4a636acb617cb%3A4b4368e0660b8363%3A1\"},{\"uber-trace-id\":\"1429c44436cbaaa7%3A888811c524eba2fe%3Abfd4a636acb617cb%3A1\"}]

uber-trace-id=1098c66636cbaaa7%4ec2cb277101430ca2f88bbe9f56a3b8%3Abfd1a636acb618cb%3A1'

Body:
{
   "correlationId":"",
   "refundId":"",
   "captureTraceabilityId":"",
   "captureCode":"",
   "networkId":154644,
   "amount":{
      "currency":"COP",
      "total":10000
   },
   "route":{
      "id":"",
      "type":"DEFAULT"
   },
   "paymentInstrument":{
      
   },
   "partialOperation":false,
   "finalPartialOperation":false
}

Right now I only can send the body, but I don't know how send the headers:

enter image description here

But I don't know how can be the structure to send the headers.

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
Margarita
  • 13
  • 3

1 Answers1

1

It's not clear which version of ActiveMQ Artemis you're using, but when I use version 2.24.0 to send a message with the web console I'm presented with the option of adding headers to the message by clicking the "Add Header" button. Here's a screenshot of what it looks like after I click that button and enter some details:

enter image description here

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
  • is there a way to make it remember my headers? It's really annoying to re-enter all my 5 headers every time I want to send a message – Olivér Raisz Aug 29 '23 at 12:01
  • 1
    No, there is no way for the web console to remember your header keys & values. If you find that using the web console to send messages is tedious then I recommend you investigate an alternative method to send your messages. The message sending functionality in the web console was designed only for very basic & occasional use (e.g. initial testing for new deployments). It doesn't have the features or convenience for complex or regular use. Sending messages is really the job of _messaging_ clients, most of which have a rich, flexible API for all sorts of use-cases. – Justin Bertram Aug 29 '23 at 12:37