'How to read the from AWS Active MQ queue using curl command

How we can get the messages from AWS Active MQ queue using curl command ?

curl -v -u -XGET username:password 'https://hostname:8162/api/message/lte_ap_kpi_sci?type=queue'

curl -v -XGET http://username:password@hostname:8162/api/message?destination=queue://lte_ap_kpi_sci&json=true&oneShot=true

Used above command but wasn't able to get any messages from queue.

Please find below logs

lte_ap_kpi_sci'
Note: Unnecessary use of -X or --request, GET is already inferred.
*   Trying IP:PORT...
* TCP_NODELAY set
* Connected to hostname
 (IP) port PORT (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: CN=*.mq.region.amazonaws.com
*  start date: Apr 18 00:00:00 2021 GMT
*  expire date: May 17 23:59:59 2022 GMT
*  subjectAltName: host "hostname" matched cert's "*.mq.region.amazonaws.com"
*  issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
*  SSL certificate verify ok.
* Server auth using Basic with user 'admin'
> GET /api/message?destination=queue://lte_ap_kpi_sci HTTP/1.1
> Host: hostname:PORT
> Authorization: Basic token==
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 302 Found
< Date: Wed, 23 Feb 2022 18:51:08 GMT
< X-FRAME-OPTIONS: SAMEORIGIN
< Location: https://hostname:PORT/
< Transfer-Encoding: chunked
< Server: Jetty(9.4.43.v20210629)
<
* Connection #0 to host hostname left intact

Is there any possible way to read the messages from queue using curl command ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source