Reputation: 1082
I have wrote a simple application that sent messages and also receive it in the same application. Now what I want to know is where can I find all the messages sent in HornetQ?
Upvotes: 1
Views: 2042
Reputation: 10004
You can check message delivery to HornetQ in two ways.
Approach 1:
Simplest and easy way, using JConsole, Open JConsole from JDK directory and select hornetQ process from local process(I assume you have hornetq in local machine else you need to enable remote JMX) and select connect and go to MBans as shown in below diagram. and select org.hornetq -> Queue -> JMS -> Your Queue -> Attributes
. Two parameters message count and message added indicate JMS message status(Note here you cannot read messages)
Approach 2:
Hermes JMS, Download Hermes JMS(if you are using windows 7 download 1.15 version from here). Install HermesJMS by executing jar. Once HermesJMS install execute hermes.bat in bin directory(if it does not start you need to edit batch file hermes.bat and add set HERMES_CONFIG={valid accessible directory}
after set HERMES_HOME
).
Now configure Hermes JMS as follows.
Mean time Goto {HermesJMS home directory}\providers create directory HermesJMS and copy following libraries from hornetq\lib directory of hornetq server
hornetq-core-client.jar
hornetq-jms-client.jar
hornetq-logging.jar
jboss-jms-api.jar
jnp-client.jar
netty.jar
save and restart the HermesJMS application
Connection Factory sections
binding = ConnectionFactory
initialContextFactory = org.jnp.interfaces.NamingContextFactory
providerURL = jnp://localhost:1099
urlPkgPrefixes = org.jnp.interfaces:org.jboss.naming
Save the settings with name
NOTE HoentQ does not store the message once read from your listener, Hence if you need to see the message in HermesJMS you need to read the message after some delay.
Upvotes: 2