1 Reply Latest reply on Jan 19, 2017 4:18 AM by Abhinav Gupta

    EJB heartBeat interval and tcp-keep-alive

    Abhinav Gupta Newbie

      Hello,

       

      We are using WildFly 9.0.2 for our application.

      Here we have a client server communication over EJB between two wildfly servers running on different host.

       

      On high level server one call EJB exposed on server2 and server2 process the request and return back response.

      Now based on complexity of request it could take considerable amount of time to server2 to give response. On our inhouse testing setup everything works good ; But our client holds a firewall in between and firewall start dropping connections. ( Mostly because it reach state connection timeout at firewall ). We are sure that connection is drop on firewall because if we increase the timeout application works.

       

      I looked in direction to pass hearbeat interval and keepalive to EJB , but seems some issue in my configuration.

       

      We are passing all property to javax.naming.InitialContext.InitialContext as below : Below is xml which we parse and add as properties.

       

           <Param Name="java.naming.factory.initial">org.jboss.naming.remote.client.InitialContextFactory</Param>

                                                                  <Param Name="java.naming.provider.url">http-remoting://<host>:8080< Param>

                                                                  <Param Name="java.naming.security.principal">ejb</Param>

                                                                  <Param Name="java.naming.security.credentials">xrgv+f3+4hc=</Param>

                                                                  <Param Name="jboss.naming.client.ejb.context">true</Param>

                                                                  <Param Name="remote.connection.default.connect.options.org.jboss.remoting3.RemotingOptions.HEARTBEAT_INTERVAL">5000</Param>

                                                                  <Param Name="remote.connection.default.connect.options.org.xnio.Options.KEEP_ALIVE">true</Param>

       

      For testing we just halt our application after jump to server2 and take a look at wireshark to capture tcp alive packets. But we don’t see any packets.

       

      I tried below things but didn't worked :

      1. Adding above properties in a file jboss-ejb-client.properties and add this file as wildfly module + add this module to jboss-deployment-structure of ear to get it deployed.
      2. Add this to file via System.setProperty() .. on variable "jboss.ejb.client.properties.file.path"

       

      Please suggest. Attaching standalone-full.xml.

       

      Thanks,

      Abhinav

        • 1. Re: EJB heartBeat interval and tcp-keep-alive
          Abhinav Gupta Newbie

          Hello,

          I manage to solve this issue.

          Issue seems solved after we start passing

           

          jboss.naming.client.connect.options.org.jboss.remoting3.RemotingOptions.HEARTBEAT_INTERVAL

           

          and we add in our ear , jboss-deployment-stucture.xml

           

          <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">

              <deployment>

                  <dependencies>

          <module name = "org.jboss.remoting" export="true"/>

                  </dependencies>

          </jboss-deployment-structure>

           

           

          I enable DEBUG logs for remoting subsystem and find that exception , if I dont add this module as dependency, while setting this property.

          To find this property I need to add some loggers to jboss-remote-naming-2.0.4.Final module.

           

          Thanks,

          Abhinav