Java Reference
In-Depth Information
sample, we will choose the simpler way and add
jboss-ejb-client.properties
file in the client's classpath.
Note
In Maven, the appropriate location for most of the resource files (like mentioned proper-
ties) is the
src/main/resources
directory.
The contents of the
jboss-ejb-client.properties
file are as follows:
remote.connections=default
remote.connection.default.host=localhost
remote.connection.default.port=8080
There is also a
remote.connectionprovider.create.options.org
.xnio.Options.SSL_ENABLED
property, which enables the encryption of the XNIO
connection; otherwise, plaintext will be used. (In
Chapter 10
,
Securing WildFly Applica-
tions
, we will discuss using SSL to secure the connection between the client and server.)
The
remote.connections
property can be set to define a list of logical names that
will be used for connection purposes by the
remote.connection.[name].host
and
remote.connection.[name].port
attributes. If you define more than one
connection, as in the following example, the connections will be split across various des-
tinations, as shown in the following code snippet:
remote.connections=host1,host2
remote.connection.host1.host=192.168.0.1
remote.connection.host2.host=192.168.0.2
remote.connection.host1.port=8080
remote.connection.host2.port=8080
The default port used by the remoting framework is
8080
.
You may wonder how EJB remoting can work on the same port as the HTTP protocol.
Starting from WildFly, remoting uses the HTTP protocol upgrade mechanism. The first
connection is done on the
8080
port (via HTTP), then it is upgraded to EJB remoting,
and switched to another port (chosen by WildFly).