8 Replies Latest reply on May 24, 2007 11:03 AM by Kevin Conner

    JCA support

    Mark Little Master

      It's worth announcing that Bill has added JCA support to the trunk. See http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingJCAWithJBossESB for more details.

        • 1. Re: JCA support
          mike peyvandi Newbie

          Wondering the advantage of this approach over using MDB, which supports pooling as well?

          Maybe I am missing something! It would be nice if a complete running code can be provided. Is it possible Burr?

          • 2. Re: JCA support
            Kurt Stam Master

            MDBs only work with JMS. The ESB architecture abstracts the transport protocol (JMS, FTP, HTTP, etc), and ends up a pluggable light weight bus.
            You can read more about it here: http://labs.jboss.com/file-access/default/members/jbossesb/freezone/resources/project/JBossESBArchitecture.pdf

            All of Burr's demo's are Quick starts. He codes up most of them while waiting in airports. I'm sure in the next few days he will find the time to check them in, if they aren't already. You can check here:

            http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/samples/quickstarts/

            --Kurt

            • 3. Re: JCA support
              Kevin Conner Master

               

              "system.out" wrote:
              Wondering the advantage of this approach over using MDB, which supports pooling as well?


              MDB is driven by JCA within JBoss AS and it is JCA which provides the pooling.

              The advantage of JCA is that it allows you to integrate resource adapters that have been written by others. For example, one inflow supported by AS is the ability to poll a mail server and have new emails delivered in a similar fashion to MDBs (a different interface is used).

              The work Bill has completed allows for these resources to be integrated without impacting on the core ESB codebase.

              • 4. Re: JCA support
                mike peyvandi Newbie

                I see. Let's compare JCA using ESB with JMS provider, vs JCA using MDB. In the latter, I can invoke any esb service for inbound messages through MDB.

                The latter provides pooling as well, while the former serves only one call at any time. This would be a major drawback for JCAWithJBossESB solution:

                "One instance of the JmsEndpoint? class will be created per gateway defined for this class. This is not like an MDB that is pooled. Only one instance of the class will service each and every incoming message, so you must write threadsafe code. "

                I agree on the point Kurt mentioned about flexibility of choosing the protocol with ESB, but if protocol is chosen to be JMS (in my case!), I think combination of using JCA with MDB -> calling ESB services would be a better choice.

                Any thoughts ?

                • 5. Re: JCA support
                  Kevin Conner Master

                  Bill stated that one instance was created to service all messages, not that only one message was delivered at a time. You must write thread safe code so that multiple threads can be using it at the same time.

                  This is different from MDB which pools instances of the bean and locks an instance to the processing of an individual message, therefore allowing unsafe code.

                  JCA will still pool the delivery of the messages, just that it will only be the threads which are being pooled and not the handlers.

                  • 6. Re: JCA support
                    Kurt Stam Master

                    Some background info: The ESB is designed to leverage the functionality of the AppServer as much as possible, but one of our design goals is to also be able to run it in standalone or embedded mode. This is why we choose not to use MDBs as it, but rather Bill refactored the code such that ESB now has a JCAGateway.

                    A gateway really only one function: Inflow of arbrary formatted messages which are then turned into an ESBMessage, using a default, or custom MessageComposer class. The ESBMessage is then send to a listener, which can have actions to process the message. Both gateways and listeners can run in multithreaded mode (default no. of threads is 1).

                    Yes you will have to wrote threadsafe code in actions. However, you can very easily leave your business code in MDBs and then have the ESB interact with the MDBs over JMS.

                    Well I hope this is an answer to what you are asking.

                    --Kurt

                    • 7. Re: JCA support
                      mike peyvandi Newbie

                      Thanks Kurt & Kevin for clarification. I does make sense to me now.

                      • 8. Re: JCA support
                        Kevin Conner Master

                        The JCA inflow is different from the other gateways in that it is the configuration of the JCA Thread Pool which controls the pooling.