4 Replies Latest reply on Feb 23, 2009 11:00 AM by msatala

    can this be done in Jboss ESB?

    msatala

      Hello,
      I've started evaluating Jboss ESB. After reading almost all supplied pdf documents I'm still not sure if the ESB can fulfil all our requirements. I guess the only way to find out is to try to actually implement it so I decided to ask here first.
      We're working on a large project that is based around event driven architecture. To dispatch an event an application calls a webservice exposed by the ESB. There will be several consumers interested in that event. They will expose the same webservice on their respective urls. The ESB will route the recieved event to all interested consumers by invoking their respective webservices.

      I believe this turns into following JBoss ESB requirements:
      1. Expose a webservice. It would be best if a wsdl was enough (no classes) since we don't really need to transform the SOAP message into java objects. The webservice will have several actions.
      2. Upon recieving a call to that webservice, the ESB will forward the incoming SOAP message (xml) to a JMS topic.
      3. There would be several subscribers to that topic. A subscriber is actualy a service and each will recieve the message.
      4. After recieving the SOAP message, the service (= subscriber) will invoke a webservice on a different machine with the same xml that was recieved by the ESB.

      Will JBoss ESB:
      ... be able to do this out of the box?
      ... require some hacking before being able to do it?
      .... not be able to do it or it would be too difficult?

      Thanks,
      Milan

        • 1. Re: can this be done in Jboss ESB?
          beve

          Hi,

          glad to hear that you are considering JBossESB.

          1. Expose a webservice. It would be best if a wsdl was enough (no classes) since we don't really need to transform the SOAP message into java objects.

          A service in JBossESB can be exposed as a web service by setting the attribute 'webservice' to true on the action element in the configuration:
          <actions inXsd="/request.xsd" outXsd="/response.xsd" faultXsd="/fault.xsd" webservice="true">
           <action name="action" class="org.jboss.soa.esb.samples.quickstart.publishAsWebservice.ESBWSListenerAction" process="displayMessage"/>
          </actions>
          

          An example of this can be found in the publish_as_webservice quickstart. Note that the default value for webservice is true and therefore does not exist in the quickstarts configuration.

          2. Upon recieving a call to that webservice, the ESB will forward the incoming SOAP message (xml) to a JMS topic.

          You could to this by using the JMSRouter actions but another option is to use StaticWiretap or StaticRouter to route the message different services and take advantage of the transport capabilities in the esb.

          3. There would be several subscribers to that topic. A subscriber is actualy a service and each will recieve the message.

          As noted above you could use a StaticRouter to route the message directly to the services. You can see an example usage of StaticRouter in the wiretap quickstart.

          4. After recieving the SOAP message, the service (= subscriber) will invoke a webservice on a different machine with the same xml that was recieved by the ESB.

          This can be done using one of the SOAPClients. Take a look at one of the webservice_consumer quickstarts for examples of this.

          Is there a reason that you want the to share the same message format among these services and the calling clients?
          This will make your solution sensitive to changes in the message formats, possible requiring all services and clients to be updated if a change is later required. The message format will be tightly coupled between clients and services.
          I would personally go with transforming the incoming message to an internal message format that is not exposed outside the bus. This would also mean transforming it when leaving the bus to invoke the webservice outside the esb. This way you can simply update the transformation(s) without affecting clients and other services when a change is required in either the client or the services message format.

          Regards,

          /Daniel

          • 2. Re: can this be done in Jboss ESB?
            msatala

            Thank you Daniel for your answer. It rose a few more question.

            This will make your solution sensitive to changes in the message formats, possible requiring all services and clients to be updated if a change is later required. The message format will be tightly coupled between clients and services.

            I agree with you. As a matter of fact most event consumers will have their own message formats. In the documentation I saw that xml transformation is well supported in JBoss ESB. That's why I didn't ask about that.

            However except for the functionality I described before, the ESB will also serve as a mediator. This means that clients will be able to find all webservices on the ESB, even though the webservices will actualy be hosted elsewhere. This will be useful if a server that runs a particular webservice moves to a different location becouse clients won't need to be modified. We'll just update the ESB.

            Let's say that the ESB hosts webservices A and B at:
            http://localhost:1234/services/ServiceA
            http://localhost:1234/services/ServiceB

            1. Client invokes http://localhost:1234/services/ServiceA
            2. ESB forwards the message it recieved to http://server.com/ServiceA
            3. The response is sent back to the client.
            4. The same would work for service B:
            Client -> http://localhost:1234/services/ServiceB -> http://otherserver.com/ServiceB -> Client

            I think JBoss ESB is up to the task. However after looking at the documentation and the examples I'm not sure about two things:
            1. How to specify the url (eg: http://localhost:1234/services/ServiceA) of the webservice? I found an example for http transport provider&listener:
            <jbr-provider name="JBR-Http" protocol="http" host="localhost">
            <jbr-bus busid="Http-1" port="8765" />
            </jbr-provider>

            <jbr-listener name="Http-Gateway" busidref="Http-1" is-gateway="true"/>

            However this doesn't specify the url, just the port. I wasn't able to find any relevant documentation on this (I searched all pdf documents for jbr-bus).

            2. Is SOAPClient able to work without operationName/soapAction parameter? Since I'm only forwarding the message I don't need SOAPClient to wrap it into a SOAP envelope (becouse it already is). In fact it doesn't even have to be a SOAPClient. Simple HttpClient would do the job.

            • 3. Re: can this be done in Jboss ESB?
              tfennelly

               

              "msatala" wrote:
              1. How to specify the url (eg: http://localhost:1234/services/ServiceA) of the webservice? I found an example for http transport provider&listener:
              <jbr-provider name="JBR-Http" protocol="http" host="localhost">
              <jbr-bus busid="Http-1" port="8765" />
              </jbr-provider>

              <jbr-listener name="Http-Gateway" busidref="Http-1" is-gateway="true"/>

              However this doesn't specify the url, just the port. I wasn't able to find any relevant documentation on this (I searched all pdf documents for jbr-bus).


              Yes, there is a limitation here with the JBR Provider. If you are doing your evaluation with v4.5.GA of the ESB (just released last week), then you'll find that there's a new Tomcat gateway provided in that release.

              "msatala" wrote:
              2. Is SOAPClient able to work without operationName/soapAction parameter? Since I'm only forwarding the message I don't need SOAPClient to wrap it into a SOAP envelope (becouse it already is). In fact it doesn't even have to be a SOAPClient. Simple HttpClient would do the job.


              Maybe you could use the HttpRouter here instead of the SOAPClient?

              • 4. Re: can this be done in Jboss ESB?
                msatala

                Thank you both for help. I was able to route a webservice using HttpRouter and http-provider combination.

                However it seems that we'll use a different esb. There are two reasons:
                1) It can be integrated into tomcat.
                2) It's more "webservice friendly". It can expose a wsdl and then automaticaly modify it's endpoints to proper location.

                However being the person who will do most of the work on ESB I can say that I like JBoss more becouse it's easier to configure and you have a clear understanding of what's happening under the hood.