6 Replies Latest reply on Aug 29, 2011 12:25 PM by yi1zhao

    Integrating ESB Service with .war file

    yi1zhao

      Hello all,

       

      I'm new to JBoss and have a question.

       

      I have JBoss AS 6.1.0 running with JBoss ESB 4.10.  I want to embedd an ESB service (.esb file) into a web app (.war) so that when the ESB service receives a call from a client (with a random string for example), the webapp can display it on to an html page.

       

      Any help is appreciated!

        • 1. Re: Integrating ESB Service with .war file
          tcunning

          You can put package a .WAR file in an .ESB archive.     There's a number of quickstarts that end up doing this - helloworld_hibernate_action, most of the webservice_consumer quickstarts.    You should check them out for examples.

          • 2. Re: Integrating ESB Service with .war file
            yi1zhao

            I'm able to put the .war inside of the .esb and it all deploys fine but how do I have the classes in the .esb call the classes inside of the .war?  They seem to be in different classloaders and can't talk to each other.

             

            If anyone can help, it would be greatly appreicated!

            • 3. Re: Integrating ESB Service with .war file
              yi1zhao

              Does anyone know if this is possible?  If not, what's the best way for the ESB service to talk to the webapp?

              • 4. Re: Integrating ESB Service with .war file
                noelo

                It might be better to embed the web app into the ESB rather than the other way around.

                You can wrap the WAR and invoke it using the http gateway and the http router functionality of the ESB.

                • 5. Re: Integrating ESB Service with .war file
                  mannuyi

                  The first step, you should generate a web service for you web application.

                  Then, using ESB to transfer messages to you web application.

                  That's the common way I think.

                  If you just want to show messages that ESB received, there's another simple way.

                  When ESB received messages, restore it into you local database.

                  Then, you can show it with you web application.

                  • 6. Re: Integrating ESB Service with .war file
                    yi1zhao

                    Thanks for the reply everyone!

                     

                    I just think it's kinda of strange (and inefficient/slow) to have an ESB service and the app that it's associated with talk over HTTP/database.  Is there a way to deply an monolithic app that acts as an ESB service and a web app, that way if the ESB service receives a message, the web app can have instant access to it?