mirror of https://github.com/apache/activemq.git
Revert "fix up createPublisher contract to throw on null topic param, match the java doc"
the java doc allows null for an anonymous publish - the check needs to go in TopicRequestor part of the jdk
This reverts commit 29ecfd6cdb
.
This commit is contained in:
parent
59bfffd2b4
commit
6a0c65828a
|
@ -1701,9 +1701,6 @@ public class ActiveMQSession implements Session, QueueSession, TopicSession, Sta
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public TopicPublisher createPublisher(Topic topic) throws JMSException {
|
public TopicPublisher createPublisher(Topic topic) throws JMSException {
|
||||||
if (topic == null) {
|
|
||||||
throw new InvalidDestinationException("topic is null");
|
|
||||||
}
|
|
||||||
checkClosed();
|
checkClosed();
|
||||||
|
|
||||||
if (topic instanceof CustomDestination) {
|
if (topic instanceof CustomDestination) {
|
||||||
|
|
|
@ -17,17 +17,14 @@
|
||||||
package org.apache.activemq;
|
package org.apache.activemq;
|
||||||
|
|
||||||
import javax.jms.Connection;
|
import javax.jms.Connection;
|
||||||
import javax.jms.TopicConnection;
|
|
||||||
import javax.jms.Destination;
|
import javax.jms.Destination;
|
||||||
import javax.jms.JMSException;
|
import javax.jms.JMSException;
|
||||||
import javax.jms.Message;
|
import javax.jms.Message;
|
||||||
import javax.jms.MessageConsumer;
|
import javax.jms.MessageConsumer;
|
||||||
import javax.jms.MessageProducer;
|
import javax.jms.MessageProducer;
|
||||||
import javax.jms.Session;
|
import javax.jms.Session;
|
||||||
import javax.jms.TopicSession;
|
|
||||||
import javax.jms.TextMessage;
|
import javax.jms.TextMessage;
|
||||||
import javax.jms.Topic;
|
import javax.jms.Topic;
|
||||||
import javax.jms.TopicRequestor;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -153,20 +150,6 @@ public class JmsTopicRedeliverTest extends TestSupport {
|
||||||
assertNull(consumer.receiveNoWait());
|
assertNull(consumer.receiveNoWait());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testExOnNullDestToTopicRequestor() throws Exception {
|
|
||||||
|
|
||||||
TopicConnection topicConnection = connectionFactory.createTopicConnection();
|
|
||||||
TopicSession topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
|
|
||||||
try {
|
|
||||||
TopicRequestor topicRequestor = new TopicRequestor(topicSession, null);
|
|
||||||
fail("Expect ex on invalid dest");
|
|
||||||
} catch (javax.jms.InvalidDestinationException expected) {
|
|
||||||
} finally {
|
|
||||||
topicConnection.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
protected MessageConsumer createConsumer() throws JMSException {
|
protected MessageConsumer createConsumer() throws JMSException {
|
||||||
if (durable) {
|
if (durable) {
|
||||||
LOG.info("Creating durable consumer");
|
LOG.info("Creating durable consumer");
|
||||||
|
|
Loading…
Reference in New Issue