7 Replies Latest reply on Sep 17, 2014 3:49 PM by jbertram

    HornetQ server standalone with REST interface

    yairogen

      I have a running HornetQ 2.4 server and I need to enable on it the REST interface.

       

      Reading the documentation it seems I need to add the war in my own container (assuming I'm not using AS - which I'm not).

       

      I don't understand how these 2 processes interact?

       

      My use case is as follows:

       

      1. Producer sends messages using core API.
      2. Consumers need to consume messages both by core API (client type A) and by REST API (client type B).

       

      Can someone explain what is needed to be done to achieve the above?

        • 1. Re: HornetQ server standalone with REST interface
          jbertram

          As the documentation states, the REST interface, "...can currently only run within a servlet container."  This means you need an application server (e.g. Wildfly) with a servlet container or a bare servlet container (e.g. Tomcat).  In other words, you can't use the REST interface with standalone HornetQ. 

           

          The REST interface (deployed as a WAR) receives HTTP requests, interprets them, and makes the necessary invocations on the in-vm HornetQ server.

           

          Does that answer your questions?

          1 of 1 people found this helpful
          • 2. Re: HornetQ server standalone with REST interface
            yairogen

            Almost. so I missed the in-vm part - but I did get the servlet container part.

             

            so - you are saying I can't have one instance do both, since the in-vm can't get requests directly (core or jms) from remote client, right?

             

            OR

             

            can I use the in-vm server as my "new" standalone server as such it will serve both REST and CORE interfaces?

            • 3. Re: HornetQ server standalone with REST interface
              jbertram

              so - you are saying I can't have one instance do both, since the in-vm can't get requests directly (core or jms) from remote client, right?

              No, that's not what I'm saying.  The pertinent restriction here is simply that the REST interface WAR and the HornetQ server can only communicate via in-vm connector/acceptor.

               

              can I use the in-vm server as my "new" standalone server as such it will serve both REST and CORE interfaces?

              Technically, REST-enabled HornetQ is never considered "standalone" because it must be integrated into another process (e.g. Wildfly, Tomcat, etc.).  That said, nothing prevents the REST-enabled HornetQ instance to serve other kinds of clients (e.g. core, JMS, etc.) whether they are remote or also in the same JVM.

              • 4. Re: HornetQ server standalone with REST interface
                yairogen

                Very good news. Does the same apply for 2 instances setup for redundancy using let's say replication?

                • 5. Re: HornetQ server standalone with REST interface
                  jbertram

                  Does the same apply for 2 instances setup for redundancy using let's say replication?

                  Does the same what apply?  I don't understand the question.

                  • 6. Re: HornetQ server standalone with REST interface
                    yairogen

                    Does the same apply that we can setup 2 rest servers with in vm hornetq servers and have them have Ha between them using replication?

                    • 7. Re: HornetQ server standalone with REST interface
                      jbertram

                      Yes.  However, it's worth noting that there's no specific HA support for REST clients.  The server-side resources that get created by a REST client will need to be re-created on the new server, and obviously HTTP doesn't support seamless failover.