O'Reilly logo

Apache Karaf Cookbook by Heath Kesler, Johan Edstrom, Jamie Goodyear, Achim Nierbeck

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the JMS send command

When debugging or testing code, it is very handy to be able to send messages to a specific queue. This can be done from the command console in Karaf using the JMS subshell.

Getting ready

Make sure that the JMS feature is installed and available. In order to use most of the commands via JMS, we need to have a connection factory created (see the Using the JMS connection factory commands recipe).

How to do it…

First, let's make sure the service is in place using the info command. The connection factory can be referenced either from the specified name cookbook or by the JNDI service name jms/cookbook, as we can see in the following command:

karaf@root()> jms:info jms/cookbook

Property | Value   
-------------------
product | ActiveMQ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required