How to configure an EAP6 ejb-client to fail fast if the network connection fail

Solution Verified - Updated -

Issue

  • My ejb client is blocked for a long time if the network connection failed, how can I avoid this?
  • I use a UNIX command to simulate a network failure and my clients stuck, how can I configure a faster failure?
iptables -P INPUT DROP ; iptables -P FORWARD DROP ; iptables -P OUTPUT DROP
  • The ejb client hang for longer and the configuration of org.xnio.Options.READ_TIMEOUT and org.xnio.Options.WRITE_TIMEOUT does not help, which property need to be configured?
  • To test the client failover behaviour a network administrator shuts down the switch port of one machine.
    Afterwards the client tries to call a remote function which fails with an error after waiting for the configured invocation-timeout.
Caused by: javax.ejb.EJBException: java.util.concurrent.TimeoutException: No invocation response received in 2000 milliseconds
    at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:236) [jboss-ejb-client-1.0.24.Final-redhat-1.jar:1.0.24.Final-redhat-1]
    at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181) [jboss-ejb-client-1.0.24.Final-redhat-1.jar:1.0.24.Final-redhat-1]
    at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144) [jboss-ejb-client-1.0.24.Final-redhat-1.jar:1.0.24.Final-redhat-1]
    at com.sun.proxy.$Proxy16.getPropertyContent(Unknown Source)
    ...
Caused by: java.util.concurrent.TimeoutException: No invocation response received in 2000 milliseconds
    at org.jboss.ejb.client.EJBClientInvocationContext$InvocationTimeoutResultProducer.getResult(EJBClientInvocationContext.java:698) [jboss-ejb-client-1.0.24.Final-redhat-1.jar:1.0.24.Final-redhat-1]
    at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:272) [jboss-ejb-client-1.0.24.Final-redhat-1.jar:1.0.24.Final-redhat-1]
    ...

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content