3 Replies Latest reply on Sep 5, 2014 3:23 PM by rcernich

    switchyard ejb migration

    mlybarger

      i have a switchyard application (FSW 6.0.0) that uses ejb.  the application was migrated from a MDB application into a sy environment.  currently, sy listens on the JMS endpoint, and passes control to a camel route, and within that route, to a sy service, which invokes a stateless session bean. (which invokes another stateless bean, which finally does some jpa stuff with an EM.

       

      i'm looking at the possibility of removing all the ejb's from the application, but i'm not sure what the general approach should be.  can each stateless session bean become a sy service with the @Service annotation?  do i need to define all the references and services in the sy.xml as well as in the classes themselves? 

       

      insights would be most appreciated.

        • 1. Re: switchyard ejb migration
          rcernich

          Mark Lybarger wrote:

           

          i'm looking at the possibility of removing all the ejb's from the application, but i'm not sure what the general approach should be.  can each stateless session bean become a sy service with the @Service annotation?  do i need to define all the references and services in the sy.xml as well as in the classes themselves? 

           

          Yes and yes, although depending on how you're invoking the beans today, you may be able to simply annotate your beans with @Named and you can continue to use them in your routes.

          • 2. Re: switchyard ejb migration
            mlybarger

            thanks for the response!  are there any quickstarts or examples that show the use of @Named beans along with @Service beans or the camel routes?  if I could convert my stateless to just being @Named, that would really make it easier.  SY services have a feature of only allowing one parameter to the method calls, and many of my stateless beans have multiple parameters.

            • 3. Re: switchyard ejb migration
              rcernich

              There are a few quickstarts that use @Named to identify processors used by camel routes (e.g. soap-addressing), but I don't think there are any quickstarts that call beans directly (see Camel doc's for bean binding).

               

              Hope that helps,

              Rob