Skip to content

rabbitmq-jms 'admin' objects RMQConnectionFactory and RMQDestination are not compatible with RMQObjectFactory #128

@l-k-test

Description

@l-k-test

RMQConnectionFactory.getReference() and RMQDestination.getReference() return javax.naming.Reference instances that are not 'convertible' back to RMQConnectionFactory/RMQDestination.

There are 2 problems:

  1. The javax.naming.Reference instances do not have 'classFactory' property set. As a result an instance of RMQConnectionFactory/RMQDestination can be bound into a naming context. But it cannot be retrieved back from JNDI. Instead an instance of javax.naming.Reference is retrieved.

  2. Even if RMQObjectFactory is used as 'classFactory' in javax.naming.Reference instances, it is still not going to work. The reason is: RMQConnectionFactory/RMQDestination use their class names as 'className' property of javax.naming.Reference. RMQObjectFactory does not recognize these class names as valid. This class has the following comment (and the code that does what the comment says):

        /*
         * Valid class names are:
         * javax.jms.ConnectionFactory
         * javax.jms.QueueConnectionFactory
         * javax.jms.TopicConnectionFactory
         * javax.jms.Topic
         * javax.jms.Queue
         *
         */

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions