I'm looking more from the functional side not from the implementation.
So in general simplifying the code will make it better to understand.
From my perspective we need to cover the requirements from our users
and make it easy to handle.
I don't care whether we have different possibilities to configure the
client. But the most important is to create a InitialContext programatic
with properties and use it for all server actions.
This should be done with a minimum of properties, i.e. default SSL=off
as there is a need to configure it correct at server side.
So I would assume that we deprecate the scoped-context and remote-naming
complete and use the new approach.
I'll create a client project to show typical use-cases with the new API
and check whether we cover the current issues.
For this I appreciate if you have some examples if the creation and
handling for the client has changed.
BTW, is it possible to use the ejb-client 3.0 with current EAP/WildFly?
Is there any restriction or dependency?
At the moment I'm not able to compile the project (branch
uri_invocation), there is a missing dependency.
please find my other comments inline.
On 26/11/14 19:54, David M. Lloyd wrote:
I don't want to commit this to a specific WildFly release but I
and hope it'll come in around WildFly 10 or so (definitely not 9).
As previously discussed, the EJB client architecture is undergoing the
following substantial changes:
• Introduction of URIAffinity, and URI-based invocation
• Expansion of the 'ejb' JNDI initial context to auto-associate the
PROVIDER_URL as the URI affinity for looked-up proxies
What does that mean?
Is it possible to use an InitialContext without any jboss-ejb-client
configuration to be able to invoke ejb's and lookup other JNDI stuff
like JMS with one IC and no redundant server properties?
• Elimination of all "nested" EJB client context
• Integration with Elytron for client identity management
Does that mean the
credentials for the connection and ejb invocation are
Is there a possibility to use the old style CallBackHandler and/or being
able to change the user for an existing remoting connection?
Also whether the credentials are used to invoke ejb's in a
server-to-server communication and the user will be the invocation use
of the first EJB and not the connection user?
• Deferral to Remoting for automatic connection management
• Unification of client configuration, so the Elytron authentication
client, Remoting connection management, remote transaction client, and
EJB client configurations all can be configured in one file or
As such, I've introduced a 2.x branch for upstream where
development of the 2.x series will take place. The "master" branch is
being re-purposed towards this new development, targeted for 3.x of this
There are a number of compatibility considerations from 2.x to 3.x.
Most (I hope) existing client code (which avoids specialized manual
configuration or nested client contexts) should continue to function
as-is, with the following exceptions:
• The following classes and interfaces are currently removed in my
• ClusterContext - replaced with discovery (?)
• ClusterNodeManager - replaced with discovery
• ClusterNodeSelector - replaced with discovery
• DeploymentNodeSelector - replaced with discovery
NodeSelector is being removed and replaced by
discovery this sounds to me that there is no possibility to customize
the load-balancing process
This might affect some use-cases where such policy was implemented to
control specific behaviour.
Does this mean also that the cluster configuration at client side is
deprecated and not longer necessary?
Also the need to configure the cluster-name within the server
configuration to distinguish between different clusters?
• ContextSelector - replaced with general selector class
• EJBClientContextInitializer - no replacement
• EJBClientContextIdentifier - no replacement
• DefaultCallbackHandler - no replacement
• EJBClientConfiguration - replaced with context builder
• EJBClientContextListener - no replacement
• EJBClientInterceptor.Registration - no replacement (interceptor
set cannot be changed)
• EJBClient*TransactionContext - replaced by
• EJBReceiverContext - no replacement
• ReceiverInterceptor - no replacement (internal class)
• ALL public classes in the org.jboss.ejb.client.remoting package
• The following changes will be made to these core classes and interfaces:
• Added more createSession() variants to support new affinity types
• Change createSession() methods to throw CreateException instead
• Remove createProxy() and createSession() variants which accept
• Remove getEJBClientContextIdentifierFor() method
• Remove getAttachments() method
• No longer implements Closeable
Does this mean there is no longer a need
to close a context to avoid
"too much channel" problems. I suppose the "scoped context" will be
• Remove close() method
• Remove all static create() methods, replaced with Builder class
• Remove finalize() method
• Remove getClusterContext(), getEJBClientConfiguration(),
• Remove selector-related methods, replaced with general Selector
• Remove register*() and unregister*() methods (providers are
added to Builder)
• Remove require() method which accepts EJBClientContextIdentifier
• Add getInvocationTimeout() method
• Add forUri() factory method
• Add getCompressionLevel(), isClientAsync(), and isIdempotent()
• Remove finalize()
• EJB*Locator classes
• Additional constructors which also accept an affinity
• Additional "copy" constructors which accept a locator and
affinity, to change the target affinity
• EJBReceiver class
• openSession() method changed to accept a stateless EJB locator
• Constructor changed to no args
• Remove all send*() and other methods related to transactions
• Remove associate(), getNodeName(), [de]registerModule(), exists()
• Remove retryInvocation() method
• Remove getEjbReceiverContext() method
• Remove getNodeName() method
• Deprecated, changed to not use raw types
• Replaced constructor with standard exception four-constructor setup
• The following API classes are added:
• EJBClientPermission - a general permission class
• AbstractEJBMetaData - type-safe hierarchical version of
• EJBClientContext.Builder - forwards-compatible builder for
• EJBDiscoveryProvider - an interface to provide pluggable discovery
• EJBTransportProvider - an interface to provide URI-compatible
transport (factory for EJBReceivers)
• URIAffinity - a type of affinity which has a URI for a target
Note in particular that most of the cluster-support infrastructure is
presently removed with no replacement. It is my hope and intent that
the discovery infrastructure will be able to take over this function.
How much of the code will be new, compared to how much of the code can
be forward-ported and reintroduced from 2.x, remains to be discussed.
At present, the plan is for wire compatibility to be supported for 2.x
clients talking to 3.x servers and vice-versa.
Transaction handling will be relegated to a separate
wildfly-transaction-client API. However the getUserTransaction(node)
method will continue to be supported as a deprecated delegation to the
transaction-client API. In addition, when talking to a 2.x server, it
is expected that a wildfly-transaction-client SPI implementation will
piggyback on the existing EJB protocol transaction messages.
Is there a possibility
to use the InitialContext and do a
lookup("UserTransaction") to get a reference to UserTransaction without
any knowledge of the server environment?
This was used <AS7 and also from other vendor.
Also is the ejb and other invocations sticky during the Tx is active?
If any of these API changes seems unacceptable, now is the time to
discuss it. All the code that was removed was determined to be tied too
tightly to the previous location or configuration strategy, and thus
couldn't sensibly be supported going forward. I have hopefully been
adequately upfront about what I intended to remove or support going
forward. In addition, by supporting the 2.x client, most migration
concerns can hopefully be mitigated. But it's possible that some
classes or methods could indeed be reintroduced with sensible semantics
and in such a way as to not cause problems; if you have any thoughts
along these lines, please share them and we can discuss them on a
I've pushed up the proposed baseline 3.0 API at
review. I intend for pull requests that are relevant to both old and
new code bases to be applied to both if possible, to avoid increasing
the incompatibility window even further.