How to Configure EJB Client Address in JBoss EAP 8+ / 7.1+

Solution Verified - Updated

Environment

  • Red Hat Enterprise Application Platform (EAP)
    • 8
    • 7.1+

Issue

  • How to configure EJB Client Address in JBoss EAP 8 + ?
  • How to configure EJB Client Address in JBoss EAP 7.1?

Resolution

Container-based configuration:

Note: the outbound-bind-address gets configured on the io worker, the example below shows configuring the default io worker which is what the EJB3 subsystem uses by default.

/subsystem=io/worker=default/outbound-bind-address=default:add(bind-address=127.0.0.1, bind-port=8080, match="::/0")
        <subsystem xmlns="urn:jboss:domain:ejb3:5.0">
        ...
            <remote connector-ref="http-remoting-connector" thread-pool-name="default">
                <channel-creation-options>
                    <option name="READ_TIMEOUT" value="${prop.remoting-connector.read.timeout:20}" type="xnio"/>
                    <option name="MAX_OUTBOUND_MESSAGES" value="1234" type="remoting"/>
                </channel-creation-options>
            </remote>
        ...
        </subsystem>
       ...
        <subsystem xmlns="urn:jboss:domain:io:1.1">
            <worker name="default"/>
            <buffer-pool name="default"/>
        </subsystem>

Resource contains attributes:
"match" which is a CIDR block e.g. "10.0.0.0/8", "ff00::/8", "0.0.0.0/0", "::/0", etc.
"bind-address" which is an IP address to bind to when the destination address matches (must be the same address family as the CIDR block)
"bind-port" which is an optional source port number (defaults to 0 i.e. normal randomized source port)

Standalone client configuration:


wildfly-client.xml
Element "outbound-bind-addresses" within "worker" (namespace is "urn:xnio:3.5")
Sub-element "bind-address" has attributes "match", "bind-address", "bind-port", same rules & syntax as above
If no matching expression exists, then the outbound socket is not explicitly bound (same behavior as today).
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.