1

rabbitmqadmin get queue=test requeue=false print below response

+-------------+----------+---------------+--------------+------------------+-------------+  
| routing_key | exchange | message_count |   payload    | payload_encoding | redelivered |  
+-------------+----------+---------------+--------------+------------------+-------------+  
| test        |          | 0             | hello, world | string           | False       |  
+-------------+----------+---------------+--------------+------------------+-------------+

I want to get header as one more columns and its value.

How I can get it header value in the above table. If not possible in the same table then how to get it in other table. I want to publish my header data also with response data

1 Answer 1

1

Just use --depth.

Example without --depth: rabbitmqadmin get queue=smsc01 requeue=true count=10

Result without headers:

> +-------------+----------+---------------+---------+---------------+------------------+-------------+
> | routing_key | exchange | message_count | payload | payload_bytes | payload_encoding | redelivered |
> +-------------+----------+---------------+---------+---------------+------------------+-------------+
> | empty       | smsc-ex  | 4             | empty1  | 6             | string           | True        |
> | empty       | smsc-ex  | 3             | empty2  | 6             | string           | True        |
> | empty       | smsc-ex  | 2             | empty3  | 6             | string           | True        |
> | empty       | smsc-ex  | 1             | empty3  | 6             | string           | True        |
> | empty       | smsc-ex  | 0             | empty4  | 6             | string           | True        |
> +-------------+----------+---------------+---------+---------------+------------------+-------------+

Example with --depth: rabbitmqadmin get queue=smsc01 requeue=true count=10 --depth=4

Result with headers:

> +-------------+----------+---------------+---------+---------------+------------------+--------------------------+---------------------------+-------------+
> | routing_key | exchange | message_count | payload | payload_bytes | payload_encoding | properties.delivery_mode | properties.headers.msisdn | redelivered |
> +-------------+----------+---------------+---------+---------------+------------------+--------------------------+---------------------------+-------------+
> | empty       | smsc-ex  | 4             | empty1  | 6             | string           | 2                        |                           | True        |
> | empty       | smsc-ex  | 3             | empty2  | 6             | string           | 2                        |                           | True        |
> | empty       | smsc-ex  | 2             | empty3  | 6             | string           | 2                        |                           | True        |
> | empty       | smsc-ex  | 1             | empty3  | 6             | string           | 2                        |                           | True        |
> | empty       | smsc-ex  | 0             | empty4  | 6             | string           | 2                        | 48654987321               | True        |
> +-------------+----------+---------------+---------+---------------+------------------+--------------------------+---------------------------+-------------+
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.