User-defined custom columns

User-defined column allow you to extract business data from your messages and display it as a new column. That column can then be used for sorting or filtering, like any other column. Custom columns make most sense when used with Queue Views because that way you can have one set of custom columns for one (or more) queues, and some other columns for some other queue(s).

Creating column

Use “Add/Remove columns...” from toolbar or from View menu. Then double click on one of items under “User-defined columns” or select and click “Add” button.

Editing column

Double click existing column.

Column source

ActiveMQ: Data is extracted from a message Body. MSMQ: In addition to Body, data can be extracted from message’s Extension or Label.

Column type

You can choose column type to be string, int, or double. It affects how that data gets sorted and filtered.

Sample text

In order to easier set up custom column, you can put sample text and QueueExplorer will immediately display extracted value. By clicking Load sample from current message, that text will be filled from current message, making it easy to test with real data.

XPath column

../_images/XPathColumn.png

Specify XPath expression which would be used to extract data. You can use Sample XML field in order to test your XPath. If anything is matched, it will be displayed in “Selected value” field.

Default namespace in XML

If XML document has a namespace without any prefix, XPath has to use _default prefix.

For example, if XML is:

<books xmlns="http://books.com">
    <book category="cooking">
        <title lang="en">Everyday Italian</title>
        <year>2005</year>
        <price>30.00</price>
    </book>
</books>

Your XPath should be:

/_default:books/_default:book/_default:title

JSON column

../_images/JSONColumn.png

Specify JSONPath expression which would be used to extract data. You can use Sample JSON field in order to test your expression. If anything is matched, it will be displayed in “Selected value” field.

JSONPath syntax

Regex column

../_images/RegexColumn.png

Specify Regex expression which would be used to extract data. You can use Sample text field in order to test your expression. If anything is matched, it will be displayed in “Selected value” field.

Getting just a subset of matched value

If you want to extract just a subset of matched value, you should enclose that part of regex in parentheses. For reference, that’s a “group” functionality of .Net Regex parser. QueueExplorer supports a single group - if a group is detected, it will be used instead of full match.

Example regex for matching US phone number: “(d{3})-d{3}-d{4}”

This regex will extract just area code, because first part is in parentheses “(d{3})”.

.Net column

Pick a field or property from .Net object. This field depends on correctly configured .Net view for that queue - assembly and class names configured. If .Net view is working ok, when you add custom .Net column, QueueExplorer will load .Net object from current message, and allow you to click on a field or property that will be extracted. This field supports .Net objects serialized using BinaryMessageFormatter for MSMQ, and DataContractSerializer for Azure Service Bus.