Activemq is an open-source JMS server that implements the JMS 1.1 Standard. hermesjms is an open-source GUI tool that can connect to many kinds of JMS servers.
However, the configuration methods provided on hermesjms's official website are not detailed, which often puts users in trouble for the first time. This document provides detailed operation steps and a video clip.
1. Install activemq
1. Download activemq:Http://www.activemq.comThe latest version is activemq 4.0 M4;
2, extract the downloaded activemq-4.0-M4.zip, assuming the directory after decompression is E:/activemq;
3. Run activemq. bat in the E:/activemq/bin directory (run the activemq script in Unix/Linux)
By default, activemq runs on port 61616 and the connection string is TCP: // hostname: 61616.
In addition, activemq can also be connected and managed through JMX remote, for example, mc4j console 1.2b9.
When using the JMX remote tool, the connection string is:Service: JMX: RMI: // hostname/JNDI/RMI: // host name: 1099/jmxrmi
Ii. Install hermesjms
1. Download hermesjms:Http://www.hermesjms.com, The latest version is hermes-v1.10_221005;
2. Extract the downloaded hermes-v1.10_221005.zip, assuming the directory is E:/Hermes;
3. Run E:/Hermes/bin/Hermes. BAT to start the main interface of hermesjms;
3. Configure hermesjms
1. Click "options-> Configuration..." on the main interface ...";
2. At the bottom of the window, select "provider ";
3. Right-click the blank area of the window and select "add group ";
4. Enter a name in classpath group name, for example, activemq 4.0 group;
5. Expand the newly added "activemq 4.0" node, right-click "library", and select "add jar (s )";
6. Add the jar files required to connect to activemq. the following files are required:
Activeio-2.1.jar
Activemq-core-4.0-M4.jar
Backport-util-concurrent-2.0_01_pd.jar
Geronimo-spec-jms-1.1-rc4.jar
7. In the pop-up window, select Yes If You Want To automatically "scan ";
8. Click "OK" to close the current window;
9. Right-click the "sessions" node on the left Tree of the main interface and choose "New-> new session ...";
10. After "session:", enter the name of a session, for example, "activemq4.0 ";
11. Under "connection factory", select the activemq 4.0 group just added in the drop-down box on the right of "loader;
12. In the drop-down box on the right of "class", select"Org. Apache. activemq. activemqconnectionfactory";
13. Right-click the table under "class" and "loader" and choose "add property ";
14. Select"Brokerurl", Enter"TCP: // localhost: 61616";
15. Click "OK" to close the current window;
4. send messages to the queue
Use the example provided by activemq to send messages to the queue. To run the example, ant is required.
1. Download ant:Http://ant.apache.org;
2. decompress the downloaded file to a directory, for example, E:/ant1.6.5;
3. Set "java_home" and "ant_home" in the system environment variables (by right-clicking on "My Computer, "attribute"-> "advanced"-> "environment variable"). For example, set java_home to E:/jdk1.4.2 and ant_home to E:/ant1.6.5;
4. Add the "% java_home %/bin" and "% ant_home %/bin" directories to the system's environment variable "path;
5. Open a "command prompt" window and enter the examples directory of activemq: e:/activemq/examples;
6. Enter "ant producer" and press Enter. After the program runs successfully, a message will be sent to the queue of activemq. The queue name is test. Foo;
5. view the message just sent in hermesjms
1. In the tree on the left of the hermesjms main interface, right-click the "activemq4.0" Node just added under "sessions" and choose "New-> Add queue ...";
2. Enter "test. foo" in both name and shortname ";
3. On the tree on the left of the main interface, we can see that a "test. foo" node is added under the "activemq4.0" node;
4. Right-click "test. foo" and choose "Browse ...";
5. In the table on the right of the main interface, you can see 10 messages that were sent to the test. Foo queue by the example program;
6. Remove messages from the queue
1. Open a "command prompt" window to go to the E:/activemq/examples directory;
2. Enter "ant consumer" and press Enter. After the program runs successfully, all messages will be taken from queue test. Foo of activemq;
3. Go back to the main interface of hermesjms and click "Refresh now." on the toolbar to refresh the page;
4. the table on the right of the main interface is empty. The 10 messages displayed just now have been removed.
This article provides video editing, which can be downloaded from this place. Because there is a maximum file size limit, it is divided into two volumes for compression. After downloading the file, place the two files in the same directory and decompress the first file (the second file is automatically decompressed ).