8 Replies Latest reply on Oct 24, 2008 7:47 AM by Julio Carlos Barrera

    replies with ESB messages

    Julio Carlos Barrera Newbie

      I'm a new user of JBossESB server. I'm using jbossesb-server-4.4.GA with Linux. While I'm learning how to use ESB, I base my first deployments in the examples.

      I have modify the basic helloworld example to send a ESB message and receive a reply to confirm this delivery. When I tried to deploy it, I have some issues.

      First of all, I think the channels are not bidirectional or something else, because I'm not be able to deliver the reply message. Anyway I've tried to set the replyTo field, and I don't know where can I obtain my self URI.

      As you can see, I have many problems that I need to solve to deploy my easy project.

        • 1. Re: replies with ESB messages
          Alexandre Gomes Newbie

          Hi 'logoff',

          quoting JBoss ESB Programmers Guide, page 18:

          "In order to encourage loose coupling we recommend a message-exchange pattern
          based on one-way messages, i.e., requests and responses are independent messages, correlated
          where necessary by the infrastructure or application. Applications constructed in this way are
          less brittle and can be more tolerant of failures, giving developers more flexibility in their
          deployment and message delivery requirements.
          To ensure loose coupling of services and develop SOA applications, it is necessary to:
          • Use oneÂway message exchanges rather than requestÂresponse. "

          regards,
          Alexandre Gomes

          • 2. Re: replies with ESB messages
            Julio Carlos Barrera Newbie

            OK, sorry, I've read this document, but I need to read it again.

            Anyway, it means that I need to deploy two ESB channels if the service needs two way messages. In the helloworld sample there is two channels, one for the ESB messages and another for the JMS messages. How can I construct another channel? May be it is easy, but I have not find how to do it... Channels in sample are predefined in the ESB server, aren't it? Then I need to deploy my own channels properly to every service that I need to deploy and I shouldn't use sample ones.

            Besides, what is the use of the replyTo field of ESB message?

            Thank you very much Alexandre!

            • 3. Re: replies with ESB messages
              Julio Carlos Barrera Newbie

              Sorry about the doble post. When I was talking about channels, I need to add queues. I need to use both, isn't it? The predefined ones are the queues, I need to create my own queues and channels. Channels and queues cannot be bidirectional, then I need to create one for each service.

              • 4. Re: replies with ESB messages
                Daniel Bevenius Master

                If you have not already take a look at the helloworld_topic_notifier quickstart.
                This will send a send a JMS message to trigger the ESB service and the quickstart also shows how a client can be notified by the ESB. For instructions about running this have a look at the readme file.

                I need to add queues
                .
                The queue and topic definitions are located in jbm-queue-service.xml if you are using JBossMessaging and jbmq-queue-service.xml if you are using JBossMQ.


                Besides, what is the use of the replyTo field of ESB message?

                This is described in the ProgrammersGuilde.pdf, I think that the "Default ReplyTo" and "Handling responses" sections will shed some light on this.

                Regards,

                /Daniel

                • 5. Re: replies with ESB messages
                  Julio Carlos Barrera Newbie

                  Now I'm modifying the helloworld example and I take a look all the xml files. I will try to add another ESB channel with queues to send reply messages. I expect I finish and comment my results here.

                  Thank you very much for your help!

                  • 6. Re: replies with ESB messages
                    Julio Carlos Barrera Newbie

                    Hi again.

                    I'm working about the previous message. I have explored the helloworld_topic_notifier, but i want to work with ESB messages, without JMS gateways and nothing related to JMS. Then it's not possible to use Topic Notifiers, isn't it?

                    I have the ESB channel of the example, the basic service and the listener of it. But when the client of this service wants to reply the messages of the service, where I will send this messages? I need another listener in the client, but I have only seen listeners in the services. Where I put this listener? I have created a reply channel, it is necessary? I think it's necessary...

                    Well, I have many doubts, but I'm learning slowly.

                    Thank you for your help.

                    • 7. Re: replies with ESB messages
                      Daniel Bevenius Master

                       

                      but i want to work with ESB messages

                      Ok, so then take a look at the helloworld quickstart and run 'ant sendesb'.
                      The class named org.jboss.soa.esb.samples.quickstars.helloworld.test.SendEsbMessage sends a ESB Message directly to the service, without going through a gateway.


                      But when the client of this service wants to reply the messages of the service, where I will send this messages?

                      Sorry, I'm not sure that I've understood your question. But as you can see in the SendEsbMessage above the ServiceInvoker calls the ESB using the 'deliverAsync' method.
                      There is also a 'deliverSync' method for services that are declared with a Message Exchange Pattern (mep="RequestResponse"). An example of this can be found in the 'custom_action" quickstart. Run the 'ant sendesb' target to try this out.

                      Does that help?

                      Regards,

                      /Daniel



                      • 8. Re: replies with ESB messages
                        Julio Carlos Barrera Newbie

                        OK, I have finished my simple and basic example. A client invokes a service and sends an ESB message with some parameters (serviceInvoker.deliverSync() method, waiting for response). A service receive this message trough an ESB channel in a JBossMQ provider. After decoding and process this ESB message the service responses with another ESB message with a success parameter. Finally, the client decodes this message and the transaction finish.

                        I use JBossMQ provider, JMS listeners and all the messages are ESB messages. Do you think is better to use JBoss Messaging instead JBossMQ in JBossESB server? I have read the documentation about it and it seems to be the future option. Anyway JBoss Messaging is a JMS provider. Exist another providers, but do exists a pure ESB provider? I don't think so...

                        Thank you very much all of you for your help!