Book Image

Apache Karaf Cookbook

By : Jamie Goodyear, Johan Edstorm, Achim Nierbeck, Heath J Kesler
Book Image

Apache Karaf Cookbook

By: Jamie Goodyear, Johan Edstorm, Achim Nierbeck, Heath J Kesler

Overview of this book

Table of Contents (17 chapters)
Apache Karaf Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Using the JMS browse command


Now that we have an embedded broker and have looked at some of the commands for viewing the broker properties and statistics, let's look at how to interact with the broker using commands. In this recipe, we will look at the command for browsing messages.

Getting ready

In order for us to control the connection factory and send messages to the embedded broker, first we need to get the commands installed using the following JMS feature command, like we did in the previous recipe:

feature:install jms

First, let's create a connection factory for our embedded broker. We do this using the jms:create command.

Tip

Be sure to reference the --help command for required or optional parameters.

How to do it…

The real meat and potatoes of this command is the ability to browse the messages in the queue. An example browse command is as follows:

karaf@root()> jms:browse jms/cookbook cookbookQueue

This allows you to see the message content, persistence (delivery mode), expiration...