5 Replies Latest reply on May 15, 2015 9:46 AM by jbertram

    How to send a STOMP message from HornetQ server to client ?

    romsky007

      Salut,

       

      I develop an extension for a legacy system that utilises STOMP protocol. I need to reimplement a server part of the communication.

      As long as HornetQ supports STOMP, I should use it. For now, I realise that HornetQ resends incoming STOMP

      messages into already existing (defined in standalone-full.xml) JMS queue.

       

      From existing HornetQ documentation it is not clear:


      1) What is going with STOMP messages where the destination frame defines JMS queue that is not known to HornetQ server?

      Are they all go to Dead-Leter-Queue?


      2) JMS communication is a loosely coupled one. How can the server response and send STOMP messages back to the client?


      Is there any internet resources describing possible usage of STOMP with HornetQ?


      Thank you for your help!


        • 1. Re: How to send a STOMP message from HornetQ server to client ?
          jbertram

          1) What is going with STOMP messages where the destination frame defines JMS queue that is not known to HornetQ server?

          Are they all go to Dead-Leter-Queue?

          Based on my reading of the code it looks like the server will return an error to the client if the client sends a message to a destination that doesn't exist.

           

          2) JMS communication is a loosely coupled one. How can the server response and send STOMP messages back to the client?

          I'm not sure what you're asking here.  Can you clarify your question?

           

          Is there any internet resources describing possible usage of STOMP with HornetQ?

          The HornetQ User Guide and the examples shipped with HornetQ are the best resources I know.

          • 2. Re: How to send a STOMP message from HornetQ server to client ?
            romsky007

            I can receive STOMP message only in onMessage() method of my MDB. How can I send response to STOMP client ?

            • 3. Re: How to send a STOMP message from HornetQ server to client ?
              jbertram

              Check out this documentation.

               

              In short, it should be pretty straight-forward for the MDB to send a message to a destination where the STOMP client can then consume it.

              • 4. Re: How to send a STOMP message from HornetQ server to client ?
                romsky007

                In that documentation there is no word about sending STOMP message from MDB to the client.

                I am pretty sure that is NOT possible. Sorry, but STOMP in HornetQ is almost useless .

                • 5. Re: How to send a STOMP message from HornetQ server to client ?
                  jbertram

                  In that documentation there is no word about sending STOMP message from MDB to the client.

                  It's true that the documentation doesn't specifically mention anything about MDBs.  However, in JMS terms an MDB is just a MessageListener implementation (i.e. a message consumer) and the documentation addresses the necessary message conversions that should happen between STOMP producers and JMS consumers and vice-versa.

                   

                  Just to be clear, no message producer (whether STOMP, core, or JMS) can send a message directly to another client of any type.  That's not how HornetQ works.  All messages go through the broker.  A STOMP producer can send a message to a destination and an MDB can consume that message.  Then the MDB can send a message to another queue and a STOMP client can consume it.  That's how the request/reply pattern works.

                   

                  I am pretty sure that is NOT possible.

                  I'm pretty sure it is.

                   

                  Sorry, but STOMP in HornetQ is almost useless .

                  I would disagree with that assessment.