4 Replies Latest reply on Feb 26, 2018 11:44 PM by Prateek Malhotra

    Using invoker-proxy-binding in Jboss 6

    Prateek Malhotra Newbie

      We have multiple MDB’s connecting to Solace and EMS and packaged inside an ear.

      Eg ear name is XYZ.ear has to MDB jar like ABC.jar and PQR.jar.

       

      The same ear is deployed to play different roles which are specific to the app based on the configurations

      The MDB are selectively activated based on how the ear is being deployed i.e. ABC.jar config properties (providerAdapterJNDI) may not be configured in property files in case not required.

      The property are loaded as below from ../ server-deploy/properties-service.xml

       

      <attribute name="URLList">

      path/jms_live.properties,path/jms_reload.properties

      </attribute>

       

      This is being handled by using invoker-proxy-bindings of factory type org.jboss.ejb.plugins.jms.JMSContainerInvoker.

      Does anybody know if there is a replacement available for this in jboss-ejb3.xml?

        • 1. Re: Using invoker-proxy-binding in Jboss 6
          Prateek Malhotra Newbie
          1. jboss.xml:

          <?xml version="1.0" encoding="UTF-8" ?>

          <!DOCTYPE jboss PUBLIC

          "-//JBoss//DTD JBOSS 5.0//EN"

          "http://www.jboss.org/j2ee/dtd/jboss_5_0.dtd">

          <jboss>

          <enterprise-beans>

          <message-driven>

          <ejb-name>BatchBean</ejb-name>

          <destination-jndi-name>${LISTEN_DESTINATION}</destination-jndi-name>

                                                          <invoker-bindings>

                                      <invoker>

                                 <invoker-proxy-binding-name>TIBEMS</invoker-proxy-binding-name>

                                  </invoker>

                                  </invoker-bindings>

                                                          </message-driven>

          <message-driven>

          <ejb-name>AdhocReportRequestMDB</ejb-name>

          <destination-jndi-name>${ADHOC_REQUEST_DESTINATION}</destination-jndi-name>

                                                          <invoker-bindings>

                                      <invoker>    

                                 <invoker-proxy-binding-name>SOLACE_JMS</invoker-proxy-binding-name>

                                  </invoker>

                                  </invoker-bindings>

          </message-driven>

          </enterprise-beans>

                          <invoker-proxy-bindings>         

                                          <invoker-proxy-binding>

          <name>TIBEMS</name>

          <invoker-mbean>default</invoker-mbean>

          <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>

          <proxy-factory-config>

                                                  <activation-config>

                                                          <activation-config-property>

                                                                          <activation-config-property-name>providerAdapterJNDI</activation-config-property-name>

                                                                          <activation-config-property-value>${AGG2_LISTEN_BINDING}</activation-config-property-value>

                                                          </activation-config-property>

                                                          <activation-config-property>

                                                                          <activation-config-property-name>minSession</activation-config-property-name>

                                                                          <activation-config-property-value>1</activation-config-property-value>

                                                          </activation-config-property>

                                                          <activation-config-property>

                                                                          <activation-config-property-name>maxSession</activation-config-property-name>

                                                                          <activation-config-property-value>1</activation-config-property-value>

                                                          </activation-config-property>

                                                          <activation-config-property>

                                                                          <activation-config-property-name>maxMessages</activation-config-property-name>

                                                                          <activation-config-property-value>1</activation-config-property-value>

                                                          </activation-config-property>

                                                          <activation-config-property>

                                                                          <activation-config-property-name>keepAlive</activation-config-property-name>

                                                                          <activation-config-property-value>30000</activation-config-property-value>

                                                          </activation-config-property>

                                                          <activation-config-property>

                                                                          <activation-config-property-name>reconnectInterval</activation-config-property-name>

                                                                          <activation-config-property-value>${RELOAD_RECONNECT_INTERVAL}</activation-config-property-value>

                                                          </activation-config-property>

                                                          <activation-config-property>

                                                                          <activation-config-property-name>reconnectAttempts</activation-config-property-name>

                                                                          <activation-config-property-value>${RELOAD_RECONNECTION_ATTEMPTS}</activation-config-property-value>

                                                          </activation-config-property>

                                                          <activation-config-property>

                                                                          <activation-config-property-name>useDLQ</activation-config-property-name>

                                                                          <activation-config-property-value>false</activation-config-property-value>

                                                          </activation-config-property>

                                                  </activation-config>

                                                  <endpoint-interceptors>

          <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>

          <interceptor>org.jboss.ejb.plugins.inflow.MessageEndpointInterceptor</interceptor>

          <interceptor>org.jboss.proxy.TransactionInterceptor</interceptor>

          <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>

                                                  </endpoint-interceptors>

                                  </proxy-factory-config>

                </invoker-proxy-binding>

          <invoker-proxy-binding>

          <name>SOLACE_JMS</name>

          <invoker-mbean>default</invoker-mbean>

          <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>

          <proxy-factory-config>

                                                  <activation-config>

                                                          <activation-config-property>

                                                                          <activation-config-property-name>providerAdapterJNDI</activation-config-property-name>

                                                                          <activation-config-property-value>${ADHOC_BINDING}</activation-config-property-value>

                                                          </activation-config-property>

                                                          <activation-config-property>

                                                                          <activation-config-property-name>minSession</activation-config-property-name>

                                                                          <activation-config-property-value>1</activation-config-property-value>

                                                          </activation-config-property>

                                                          <activation-config-property>

                                                                          <activation-config-property-name>maxSession</activation-config-property-name>

                                                                          <activation-config-property-value>1</activation-config-property-value>

                                                          </activation-config-property>

                                                          <activation-config-property>

                                                                          <activation-config-property-name>maxMessages</activation-config-property-name>

                                                                          <activation-config-property-value>1</activation-config-property-value>

                                                          </activation-config-property>

                                                          <activation-config-property>

                                                                          <activation-config-property-name>keepAlive</activation-config-property-name>

                                                                          <activation-config-property-value>30000</activation-config-property-value>

                                                          </activation-config-property>

                                                          <activation-config-property>

                                                                          <activation-config-property-name>reconnectInterval</activation-config-property-name>

                                                                          <activation-config-property-value>${RELOAD_RECONNECT_INTERVAL}</activation-config-property-value>

                                                          </activation-config-property>

                                                          <activation-config-property>

                                                                          <activation-config-property-name>reconnectAttempts</activation-config-property-name>

                                                                          <activation-config-property-value>${RELOAD_RECONNECTION_ATTEMPTS}</activation-config-property-value>

                                                          </activation-config-property>

                                                          <activation-config-property>

                                                                          <activation-config-property-name>useDLQ</activation-config-property-name>

                                                                          <activation-config-property-value>false</activation-config-property-value>

                                                          </activation-config-property>

                                                  </activation-config>

                                                  <endpoint-interceptors>

                                                     <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>

          <interceptor>org.jboss.ejb.plugins.inflow.MessageEndpointInterceptor</interceptor>

          <interceptor>org.jboss.proxy.TransactionInterceptor</interceptor>

                                                     <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>

                                                  </endpoint-interceptors>

                                  </proxy-factory-config>

          </invoker-proxy-binding>

          </invoker-proxy-bindings>

                 

          </jboss>

          • 2. Re: Using invoker-proxy-binding in Jboss 6
            Prateek Malhotra Newbie

            ejb-jar.xml:

            <?xml version="1.0" encoding="UTF-8"?>

            <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee

            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance

            xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/j2ee/ejb-jar_2_1.xsd"

                       version="2.1">

             

                            <description>Agg2BatchBean</description>

                            <display-name>Agg2BatchBean</display-name>

                           

                            <enterprise-beans>

                                            <message-driven>

                                                            <ejb-name>BatchBean</ejb-name>

                                                            <ejb-class>abc.xyz.bean.BatchBean</ejb-class>

                                                           

                                                            <transaction-type>Container</transaction-type>

                                                            <message-destination-type>javax.jms.Topic</message-destination-type>

                                                           

                                            <activation-config>

            <activation-config-property>

            <activation-config-property-name>sessionTransacted</activation-config-property-name>

            <activation-config-property-value>false</activation-config-property-value>

            </activation-config-property>

                                                            <activation-config-property>

                                                                            <activation-config-property-name>user</activation-config-property-name>

                            <activation-config-property-value>${tibemsuser}</activation-config-property-value>

            </activation-config-property>

                                                            <activation-config-property>

                                                                            <activation-config-property-name>password</activation-config-property-name>

                            <activation-config-property-value>${tibemsPassword}</activation-config-property-value>

            </activation-config-property>           

            </activation-config>

                             

                                            </message-driven>

                                           

                                            <message-driven>

                                  <description>Handles Distributed Report Requests</description>

            <ejb-name>AdhocReportRequestMDB</ejb-name>

            <ejb-class>abc.xyz.AdhocReportRequestMDB</ejb-class>

            <transaction-type>Container</transaction-type>

            <message-destination-type>javax.jms.Topic</message-destination-type>

                                              <activation-config>

                                            <activation-config-property>

                                            <activation-config-property-name>sessionTransacted</activation-config-property-name>

                                        <activation-config-property-value>false</activation-config-property-value>

                                                            </activation-config-property>

                                  </activation-config>     

                                </message-driven>                   

                               

                            </enterprise-beans>

             

                            <assembly-descriptor>

                                            <container-transaction>

                                                            <method>

                                                                            <ejb-name>BatchBean</ejb-name>

                                                                            <method-name>*</method-name>

                                                            </method>

                                                            <trans-attribute>NotSupported</trans-attribute>

                                            </container-transaction>

                                            <container-transaction>

                                                            <method>

                                                                            <ejb-name>AdhocReportRequestMDB</ejb-name>

                                                                            <method-name>*</method-name>

                                                            </method>

                                                            <trans-attribute>NotSupported</trans-attribute>

                                            </container-transaction> 

                            </assembly-descriptor>

                           

              </ejb-jar>

            • 3. Re: Using invoker-proxy-binding in Jboss 6
              Prateek Malhotra Newbie

              The issue here is if we have two MDB in a jar and we want to enable or disable that based on a configuration.

              If you see in the example below this has been achieved using invoker proxy via property providerAdapterJndi.
              When the MDB need to be activated the value is available in the property file and if needs to be disabled the value is not present.
              The xml configuration(jboss.xml and ejb-jar. xml) remains same at all times.