When LocalInvoker is removed, EJB invoked via remote interface in same JVM is slower because of marshalling in JBoss EAP

Solution Verified - Updated -

Issue

We’re running a JBoss server with a webapp that uses EJB. For performance reason, we changed the jboss-service.xml configuration to explicitly delete the LocalInvoker and PooledInvoker and keep only the UnifiedInvoker in $JBOSS_HOME/server/$PROFILE/conf/jboss-service.xml:

Kept:

   <!-- Unified invoker (based on remoting) -->
   <mbean code="org.jboss.invocation.unified.server.UnifiedInvoker"
      name="jboss:service=invoker,type=unified">
      <depends>jboss:service=TransactionManager</depends>
      <depends>jboss.remoting:service=Connector,transport=socket</depends>
   </mbean>

Deleted:

   <mbean code="org.jboss.invocation.local.LocalInvoker"
      name="jboss:service=invoker,type=local">

      <depends>jboss:service=TransactionManager</depends>
   </mbean>

   <mbean code="org.jboss.invocation.pooled.server.PooledInvoker"
      name="jboss:service=invoker,type=pooled">
      <attribute name="NumAcceptThreads">1</attribute>
      <attribute name="MaxPoolSize">300</attribute>
      <attribute name="ClientMaxPoolSize">300</attribute>
      <attribute name="SocketTimeout">60000</attribute>
      <attribute name="ServerBindAddress">${jboss.bind.address}</attribute>
      <attribute name="ServerBindPort">4445</attribute>
      <attribute name="ClientConnectAddress">${jboss.bind.address}</attribute>
      <attribute name="ClientConnectPort">0</attribute>
      <attribute name="ClientRetryCount">1</attribute>
      <attribute name="EnableTcpNoDelay">false</attribute>

      <!-- Customized socket factory attributes
      <attribute name="ClientSocketFactoryName">custom.client.factory</attribute>
      <attribute name="ServerSocketFactoryName">custom.server.factory</attribute>
      <attribute name="SslDomain">java:/jaas/pooledInvoker</attribute>
      -->
      <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>
   </mbean>

With this configuration, the EJBs work fine, but we noticed that they’re loaded remotely using marshall/unmarshalling process. This marshalling/unmarshalling is slow and causes issues with some of our EJBs which are designed to return non-serializable objects and some database transactions are initialized in the webapp and committed on the EJB but we lose transaction contexts when invoking EJB remotely.

Do you know why JBoss is using remote loading without LocalInvoker and PooledInvoker, while EJB are finally invoked in local within the same JVM? Is there any links between LocalInvoker and UnifiedInvoker? Is there any specific constraint that prevent LocalInvoker from being actived in the JBoss configuration?

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 4.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In