5 Replies Latest reply on Mar 30, 2012 2:07 PM by kcbabo

    Passing AS7 specific resources into SwitchYard component

    igarashitm

      On my way to implement JCA gateway, I have noticed I need to have some AS7 specific resources in the gateway component.

       

      To activate JCA message inflow endpoint, we need two objects - ActivationSpec and ResourceAdapter, that need AS7 API to be injected or instantiated.

       

      ActivationSpec is created by createActivationSpec() method on org.jboss.as.ejb3.component.EJBUtilities service, so this service needs to be injected into SwitchYard service. (or we can create it manually using ResourceAdapterRepository service - not so big difference)

      And ResourceAdapter is acquired from org.jboss.jca.core.spi.rar.ResourceAdapterRepository service, so this service needs to be injected into SwitchYard service.

       

      On the other hand, if we have the JCA related parameter (resource adapter name, messaging listener interface, activation config and so on) in switchyard.xml, the Activator for JCA gateway should access to above AS7 resource. This means the JCA gateway component depends on AS7.

       

      Another option is to put all configuration into AS7 standalone.xml, and instantiate the ActivationSpec and ResourceAdapter in SwitchYard service. This means the SwitchYard service instantiates these objects at boot time, but not deployment time. And then inject them into JCA gateway component at deployment time. To achieve this, we need some logical name for the JCA configuration and make relationship with switchyard.xml. for example:

       

      • standalone.xml

      <module identifier="org.switchyard.component.jca" implClass="org.switchyard.component.jca.deploy.InflowComponent">

          <config.jca name="jca-config-1"

              resourceAdapter="jms-ra.rar"

              messagingType="javax.jms.MessageListener">

              <activationConfig>

                  <property name="destinationType" value="javax.jms.Queue"/>

                  <property name="destination" value="queue/ServiceQueue"/>

              </activationConfig>

          </config.jca>

      </module>

       

      • switchyard.xml

      <sca:service name="InflowService" promote="InflowService">

          <jca:binding.jca configName="jca-config-1"/>

      </sca:service>

       

      Any advice would be appreciated!

       

      Thanks,

      Tomo

        • 1. Re: Passing AS7 specific resources into SwitchYard component
          igarashitm

          Now the latter option sounds good to me .. JCA component won't have any dependency on AS7 if we choose this, but just depends on javax.resouce kind of stuff.

          • 2. Re: Passing AS7 specific resources into SwitchYard component
            kcbabo

            Hey Tomo,

             

            This is good info.  Before I get to the details you posted above, I think it would be good to cover the overall requirements for the JCA gateway.  My assumption here is that we want to support any type of JCA adapter with this gateway.  This means that the gateway will interact with the JCA subysystem using standard JCA APIs and any adapter-specific information will have to be supplied on a per-deployment basis.  Further, the gateway needs to handle service bindings (inflow) and reference bindings (outbound).  I'm good with focusing on inflow initially, but we should keep the outbond case in the back of our minds during the initial design.

             

            OK, so back to the details you posted above.  The ResourceAdapterRepository service looks promising for creating the ActivationSpec.  Since the adapter id, endpoint listener, and activation spec can be different across deployments (i.e. with different adapter types), we will need to take this in as part of the deployment configuration (in switchyard.xml) vs. putting it in standalone.xml.  From what I see above, you should be covered if you can get a handle on ResourceAdapterRepository and grab the rest from the binding.jca configuration, yeah?

             

            BTW, in terms of what's in the configuration for the binding, you may want to take a look at the OASIS SCA JCA Binding spec:

            http://docs.oasis-open.org/opencsa/sca-bindings/sca-jcabinding-1.1-spec.pdf

             

            We don't have to support all that now. :-)  But it's a good reference point.

             

            cheers,

            keith

            • 3. Re: Passing AS7 specific resources into SwitchYard component
              igarashitm

              Thanks for you comment, Keith!

               

              This is good info.  Before I get to the details you posted above, I think it would be good to cover the overall requirements for the JCA gateway.  My assumption here is that we want to support any type of JCA adapter with this gateway.  This means that the gateway will interact with the JCA subysystem using standard JCA APIs and any adapter-specific information will have to be supplied on a per-deployment basis.  Further, the gateway needs to handle service bindings (inflow) and reference bindings (outbound).  I'm good with focusing on inflow initially, but we should keep the outbond case in the back of our minds during the initial design.

              yep, I think we can do it with separating Handler into InflowHandler for ServiceBinding and OutboundHandler for ReferenceBinding like HornetQ binding.

               

              OK, so back to the details you posted above.  The ResourceAdapterRepository service looks promising for creating the ActivationSpec.  Since the adapter id, endpoint listener, and activation spec can be different across deployments (i.e. with different adapter types), we will need to take this in as part of the deployment configuration (in switchyard.xml) vs. putting it in standalone.xml.  From what I see above, you should be covered if you can get a handle on ResourceAdapterRepository and grab the rest from the binding.jca configuration, yeah?

              yes, if we only have ResourceAdapterRepository, we can handle them. But you mean the Activator for JCA component can touch the ResourceAdapterRepository directly? We will have "import org.jboss...*" in JCA component if do so.

               

              BTW, in terms of what's in the configuration for the binding, you may want to take a look at the OASIS SCA JCA Binding spec:

              http://docs.oasis-open.org/opencsa/sca-bindings/sca-jcabinding-1.1-spec.pdf

              Oh, I didn't know it, that is also the one I should take a look.

               

              Thanks,

              Tomo

              • 4. Re: Passing AS7 specific resources into SwitchYard component
                igarashitm

                After chatting with Keith and Magesh, we decided to bring ResourceAdapterRepository into JCA component. Message listener type and activation config are application specific parameter, so we can't separate that logic for creating ActivationSpec from JCA component.

                • 5. Re: Passing AS7 specific resources into SwitchYard component
                  kcbabo

                  I think that's fine for an initial pass.  We don't need to hit the bulls-eye on the first shot, just get near the target.  We can debate the finer points once we have an end-to-end example to look at.