PooledSession does not appear to use the Topic supplied to the
createPublisher(topic) method, at least when obtained from
PooledConnectionFactory.
When the publish(Message) method is called on the returned
TopicPublisher instance, an UnsupportedOperationException is thrown ("A
destination must be specified."). Sending to a queue does not produce
the same error.
Some simple digging turns up the fact that the ActiveMQTopicPublisher
instance nested inside PooledTopicPublisher gets initialized with a
ProducerInfo whose destination is null. Looks like
PooledSession.getTopicPublisher() is responsible for creating the
publisher from the contained ActiveMQSession, but does not supply a
destination (explicitly passes null).
I've opened issue AMQ-1161 and attached code to reproduce the error. Any
ideas? Am I doing something wrong?
http://issues.apache.org/activemq/browse/AMQ-1161