You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "james strachan (JIRA)" <ji...@apache.org> on 2007/02/19 14:46:09 UTC

[jira] Resolved: (AMQ-1161) PooledConnectionFactory / PooledSession generates UnsupportedOperationException when publishing to a topic

     [ https://issues.apache.org/activemq/browse/AMQ-1161?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

james strachan resolved AMQ-1161.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 4.2.0

> PooledConnectionFactory / PooledSession generates UnsupportedOperationException when publishing to a topic
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-1161
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1161
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 4.1.0
>            Reporter: Adam Lewandowski
>             Fix For: 4.2.0
>
>         Attachments: PooledTopicPublisherTest.java
>
>
> PooledSession does not appear to use the Topic supplied to the createPublisher(topic) method. When the publish(Message) method is called on the returned TopicPublisher instance, an UnsupportedOperationException is thrown ("A destination must be specified.").
> 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).
> Sample code to recreate issue (also attached is Junit test case):
> 		ActiveMQTopic topic = new ActiveMQTopic("test");
> 		PooledConnectionFactory pcf = new PooledConnectionFactory();
> 		pcf.setConnectionFactory(new ActiveMQConnectionFactory("vm://test"));
> 		TopicConnection conn = (TopicConnection)pcf.createConnection();
> 		TopicSession session = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
> 		TopicPublisher publisher = session.createPublisher(topic);
> 		publisher.publish(session.createMessage());

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.