-
Notifications
You must be signed in to change notification settings - Fork 50
Description
The RMQObjectFactory class does not work with Wildfly object-factory JNDI binding configuration, documented here
This is because the getObjectInstance() Object first argument is handled as a javax.naming.Reference instance whereas a java.lang.String object is actually provided to this method by Wildfly when using the object-factory binding configuration.
Thus, the following NamingException is always thrown by this code bellow:
Reference ref = obj instanceof Reference ? (Reference) obj : null;
if (ref == null && (environment == null || environment.isEmpty())) {
throw new NamingException("Unable to instantiate object: obj is not a Reference instance and environment table is empty");
}
From what I understand from javax.naming.ObjectFactory javadoc, there is not requirement to deal with this parameter as a javax.naming.Reference instance only.
So in order to make the RMQObjectFactory work with Wildfly object-factory, we could add the possibility to provide all required properties via the Hashtable environment third argument of getObjectInstance() method.
Note that I'm going to propose a PR for that.