3 Replies Latest reply on Oct 10, 2007 5:51 PM by Ron Sigal

    CompressingMarshaller and clientConnectAddress

    Klaus Erber Newbie

      Hello,

      we are using JBoss-4.2.1.GA and need to configure compression and a clientConnectAddress at the same time for the ejb3 connector.

      To configure compression we have make a change in ejb3.deployer/META-INF/jboss-service.xml:

      ...
      <attribute name="InvokerLocator">socket://${jboss.bind.address}:3873/?marshaller=org.jboss.remoting.marshal.compress.CompressingMarshaller&unmarshaller=org.jboss.remoting.marshal.compress.CompressingUnMarshaller</attribute>
      ...
      


      To configure a clientConnectAddress we have replaced the hole connector with:


       <mbean code="org.jboss.remoting.transport.Connector"
       name="jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3">
       <depends>jboss.aop:service=AspectDeployer</depends>
       <attribute name="Configuration">
       <config>
       <invoker transport="socket">
       <attribute name="numAcceptThreads">1</attribute>
       <attribute name="maxPoolSize">360</attribute>
       <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
       <attribute name="timeout" isParam="true">60000</attribute>
       <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
       <attribute name="serverBindPort">3873</attribute>
       <attribute name="clientConnectAddress">
      ###THE_CLIENT_CONNECT_ADDRESS###</attribute>
       <attribute name="backlog">200</attribute>
       </invoker>
       <handlers>
       <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
       </handlers>
       </config>
       </attribute>
       </mbean>
      


      How can we do the both things at the same time?

      Thank you for your help.

      Regards
      Klaus Erber

        • 1. Re: CompressingMarshaller and clientConnectAddress
          Ron Sigal Master

          There are two options:

          1. You can append the clientConnectAddress parameter to the InvokerLocator:

          <attribute name="InvokerLocator">socket://${jboss.bind.address}:3873/?marshaller=org.jboss.remoting.marshal.compress.CompressingMarsh
          aller&unmarshaller=org.jboss.remoting.marshal.compress.CompressingUnMarshaller&clientConnectAddress=bluemonkeydiamond.com</attribute>
          


          or you can add attribute elements for the marshaller and unmarshaller to the invoker element:

           <mbean code="org.jboss.remoting.transport.Connector" name="jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3">
           <depends>jboss.aop:service=AspectDeployer</depends>
           <attribute name="Configuration">
           <config>
           <invoker transport="socket">
           <attribute name="numAcceptThreads">1</attribute>
           <attribute name="maxPoolSize">360</attribute>
           <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
           <attribute name="timeout" isParam="true">60000</attribute>
           <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
           <attribute name="serverBindPort">3873</attribute>
           <attribute name="clientConnectAddress">
          ###THE_CLIENT_CONNECT_ADDRESS###</attribute>
           <attribute name="backlog">200</attribute>
           <attribute name="marshaller">org.jboss.remoting.marshal.compress.CompressingMarshaller</attribute>
           <attribute name="unmarshaller">org.jboss.remoting.marshal.compress.CompressingUnMarshaller</attribute>
           </invoker>
           <handlers>
           <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
           </handlers>
           </config>
           </attribute>
           </mbean>
          


          See Section 5.1.1.2. "Declarative configuration" of the Remoting Guide (http://labs.jboss.com/jbossremoting/docs/guide/index.html).

          • 2. Re: CompressingMarshaller and clientConnectAddress
            Klaus Erber Newbie

            Thank you Ron for your help.

            With the first solution, the client can not connect, because it get's the wrong connect address. With the second solution, the application is working but with no compression (analysed with wireshark).

            In other words: The configurations have no effect. What is wrong with my configuration?

            Here is the whole thing again:


            <mbean code="org.jboss.remoting.transport.Connector"
             name="jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3">
             <depends>jboss.aop:service=AspectDeployer</depends>
             <attribute name="Configuration">
             <config>
             <invoker transport="socket">
             <attribute name="numAcceptThreads">1</attribute>
             <attribute name="maxPoolSize">360</attribute>
             <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
             <attribute name="timeout" isParam="true">60000</attribute>
             <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
             <attribute name="serverBindPort">3873</attribute>
             <attribute name="clientConnectAddress">###THE_CLIENT_CONNECT_ADDRESS###</attribute>
             <attribute name="backlog">200</attribute>
             <attribute name="marshaller">org.jboss.remoting.marshal.compress.CompressingMarshaller</attribute>
             <attribute name="unmarshaller">org.jboss.remoting.marshal.compress.CompressingUnMarshaller</attribute>
             </invoker>
             <handlers>
             <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
             </handlers>
             </config>
             </attribute>
             </mbean>
            


            • 3. Re: CompressingMarshaller and clientConnectAddress
              Ron Sigal Master

              Hi Klaus,

              You want the compressing marshaller and unmarshaller to work on both sides of the connection, of course, which means you want to tell the client about them, which you do by way of InvokerLocator parameters. When use use the Configuration attribute, only the "subattributes" labeled with isParam="true" get added to the InvokerLocator. Your marshaller and unmarshaller attributes don't have this label, so the client doesn't know about them. This is confusing to me, though, since the client and server shouldn't be able to communicate if they're using different marshaller/unmarshallers. Still, it's a place to start.

              I should mention that some people have reported problems with the compression marshaller, particularly in the context of EJBs. See JBREM-677 "Compression marshalling fails intermittently." (http://jira.jboss.com/jira/browse/JBREM-677).