1 Reply Latest reply on Nov 13, 2014 2:12 PM by rcernich

    SY Service -> CDI (...) -> SY Service

    mlybarger

      I have a SY Service that invokes a CDI Bean to do some work. along the lines, that calls another cdi bean which then needs to send data to a jms queue.  The flow looks like this:

       

      ASYService -> CDIOne -> CDITwo -> BSYService -> BSYReference

       

      BSYService is defined with @Service annotation and has a proper reference to BSYReference.  It looks fine in switchyard.xml except that there is no inbound bindings. 

       

      In CDITwo, the service is just injected with @Inject

       

      It seems to work ok, but my question is, is this expected behavior?  In my actual case, there's probably a few more CDI beans in the mix, but I simplified to get to the point.

       

      Thanks!

        • 1. Re: SY Service -> CDI (...) -> SY Service
          rcernich

          Hey Mark,

           

          That should be fine.  The critical piece is that a reference is declared on a bean component, which allows the SwitchYard CDI extension to properly wire the @Reference qualifier.  I don't believe CDITwo needs to be declared as a component, but you might want to add a reference to ASYService for BSYService.  CDITwo is effectively executing within the context of ASYService, so any policies, etc. that might be declared with respect to ASYService will cascade appropriately.

           

          Hope that helps,

          Rob