Search code examples
jmswildfly-8hornetq

Configure hornetq on Wildfly8 to send messages on JMS queue


I have recently started using Wildfly 8 and noticed that Wildfly8 has a built-in JMS utility called Hornetq. My question is, how can I configure hornetq to send and receive message on a JMS queue using Wildfly8 server?


Solution

  • There are a number of good tutorials on the net about how to use HornetQ (JMS) from within Widlfly, I like this one for JMS 2.0:

    Here is the hello world example from Wildfly themselves, illustrating how to implement an MDB and the respective listeners and topics:

    That page describes everything in excellent detail and demonstrates the use of JMS 2.0 and EJB 3.2 Message-Driven Bean in WildFly 8. The project is runnable with maven and creates two JMS resources:

    • A queue named HELLOWORLDMDBQueue bound in JNDI as java:/queue/HELLOWORLDMDBQueue
    • A topic named HELLOWORLDMDBTopic bound in JNDI as java:/topic/HELLOWORLDMDBTopic

    If you are having trouble with configuration of queues etc. in the standalone, the docs here are actually quite helpful as well: