For remote EJBs in EAP 7 what are the differences between remote+http, http-remoting , https-remoting and remote ?
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 7.x
Issue
- to call remote EJBs in EAP7 there are 3 available connectors: HTTP-REMOTING , HTTPS-REMOTING and REMOTE
- In order to help us to chose the right connector please provide documentation explaining the differences between the 3 connectors and the capabilities of each.
Resolution
Comparison
| Protocol | Works on EAP version | Comments |
|---|---|---|
| remote | EAP 6 | is the JBoss EAP 6 remoting protocol. It is not HTTP and cannot be used through a load balancer as it is designed to make a persistent connection to a host |
| http-remoting | EAP 7.0+ | http-remoting: / https-remoting: is the JBoss EAP 7.0+ remoting protocol that uses http-upgrade, it will connect via HTTP and then use http-upgrade and switch to the remoting protocol. Though it is HTTP, it cannot be used through a load balancer for load balancing, it is designed to make a persistent connection to the remote host and remain connected until the JVM is shut down or closed by the client. |
| remote+http | EAP 7.1+ | Works the same as http-remoting with EAP 7.1+. In EAP 7.0 http-remoting should be used and not remote+http. |
| http | EAP 7.2 | In JBoss EAP 7.2 this protocol can be used as an HTTP protocol that can be used through a load balancer as it does not use http-upgrade and it can be load balanced via an HTTP load balancer. See more details |
The configuration of the subsystem(s)
The remoting subsystem allows one to configure inbound and outbound connections for local and remote services as well as the settings for those connections.
JBoss Remoting includes the following configurable elements: the endpoint, connectors, and a series of local and remote connection URIs. In most of the cases, there will be no need for users to configure the remoting subsystem at all, unless one uses custom connectors for their own applications.
Applications that act as remoting clients, such as EJBs, need separate configuration to connect to a specific connector. Refer to the documentation for an overview of the Remoting subsystem.
With reference to HTTP-REMOTING, in configuring EAP 7 for EJBs there is the "remoting" and "ejb3" subsystems which utilize the default http-remoting-connector. In the "remoting" subsystem we have an http-connector which has as default:
<http-connector name="http-remoting-connector" connector-ref="default" security-realm="ApplicationRealm"/>
which is referenced in the "ejb3" subsystem by:
<remote connector-ref="http-remoting-connector" thread-pool-name="default"/>
Per the question, the "REMOTE" that is referred to is the remoting protocol from EAP 6 (see (a) below) whereas the "HTTPS-REMOTING" is in reference to configuring EAP 7 so that EJB connections use encryption, see below.
Variations
The following variations on the default configuration for EJBs are possible:
- Instead of using the default
http-remoting-connectorfor EAP7 one can instead use the remoting protocol (which was used in EAP6) and utilizes port 4447 instead ofhttp-remotingport 8080. Refer to the solution Is it possible to use the remoting protocol instead of the http-remoting with http upgrade in EAP 7?. - For 2-way SSL connection in EAP 7 (
httpsprotocol) then refer to the solution How can I configure JBoss EAP 7 so that EJB connections use 2-way SSL?
Overview
For an overview of how to configure the client, check the main article: How configure an EJB client in EAP 7.1+
For EJB over Http see: Invoking EJBs / JNDI / JMS over HTTP in JBoss EAP 7.2 / 7.1 with or without a Load Balancer
Root Cause
remote+protocols:
At the creation the intention was to use the standardremote+always, see This content is not included.WFCORE-296. But for compatibility both patterns were kept.- EAP 7 included the Undertow web server, which has the http-upgrade capability, allowing clients to connect on the http port and then switch to the remoting protocol, this allows the remoting subsystem to use the same port as the http port, thus less ports need to be opened in the firewall. As such, the legacy remoting port 4447 and management-native ports are no longer required and should only be used there is an EAP 6 client or host controller that needs to connect to EAP 7.
management-native and the legacy remoting port 4447 should be considered deprecated in EAP 7, and therefore not be used, unless there is an EAP 6.4 server involved.
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.