## Browsing Messages on a Destination

### Overview

You can browse the messges on a selected destination using the browse task and a broker URL, as follows:

activemq-admin browse --amqurl `URL` `DestinationName`

For example, to print the JMS message header, custom message header, and message body of all the messages in the queue 'TEST.FOO' on the localhost broker, type:

activemq-admin browse --amqurl tcp://localhost:61616 TEST.FOO

### Specifying message attributes

You can specify a particular group of message attributes to view using the `-V` flag, as follows:

`-Vheader`

  Shows all the standard JMS message headers.

-`Vcustom`

  Shows all the custom fields added to each JMS message.

-`Vbody`

  Shows the body of the message

For example, to show on the message body of messages in the queue TEST.FOO on localhost, type:

activemq-admin browse --amqurl tcp://localhost:61616 -Vbody TEST.FOO

### Filtering messages

You can filter specific messages using the `--msgsel` option combined with one of the following JMS message headers.

Table 1.1. JMS Headers

Header Name | Header Type
--- | ---
JMSCorrelation ID | string
JMSDelivery Mode | int (1-Non-Persistent, 2-Persistent)
JMSDestination | javax.jms.Destination
JMSExpiration | long
JMSMessageID | String
JMSPriority | int
JMSRedelivered | boolean
JMSReplyTo | javax.jms.Destination
JMSTimestamp | long
JMSType | String

For example, to view a message with an ID ending in "10", type:

activemq-admin browse --amqurl tcp://localhost:61616 --msgsel JMSMessaageID='*:10' TEST.FOO

To view messages with a priority of 3, type:

activemq-admin browse --amqurl tcp://localhost:61616 --msgsel JMSPriority=3 TEST.FOO