Logan Barnett created QPID-5510:
-----------------------------------
Summary: Creating a subscription when the topic address has
'{create: never}' creates the subscription anyways.
Key: QPID-5510
URL: https://issues.apache.org/jira/browse/QPID-5510
Project: Qpid
Issue Type: Bug
Components: Java Client
Affects Versions: 0.27
Environment: Client: OSX 10.9.1, Java 1.7.0_15 - using qpid-client
0.24 from Maven
Server: Ubuntu 12.04.3, OpenJDK 2.3.10 - using trunk Java broker
Reporter: Logan Barnett
I've been subscribing to a non-existing topic using { create: never}, and the
topic subscription succeeds. Here's the address string in the properties file
I'm using:
{noformat}
destination.dontCreateTopicExchange = amq.topic / test-create-failure; {
create: never }
{noformat}
Here's the junit test:
{code:java}
@Test
public void testSubscriptionCannotBeCreatedWithCreateNever() throws
Exception {
Context context = null;
Session session = null;
Connection connection = null;
MessageConsumer messageConsumer = null;
try {
Properties properties = new Properties();
properties.load(this.getClass().getResourceAsStream("/hello.properties"));
context = new InitialContext(properties);
ConnectionFactory connectionFactory =
(ConnectionFactory)context.lookup("qpidConnectionfactory");
connection = connectionFactory.createConnection();
connection.start();
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Destination destination =
(Destination)context.lookup("dontCreateTopicExchange");
Topic topic = (Topic)destination;
System.out.println("Subscribing to topic (" + topic.toString() + ")
" + topic.getTopicName());
try {
messageConsumer = session.createConsumer((Topic)destination);
// should not have gotten this far
Assert.fail("Expected Session.createConsumer() to fail, but it
succeeded.");
}
catch(JMSException e) { }
}
finally {
if(messageConsumer != null) messageConsumer.close();
if(session != null) session.close();
if(connection != null) connection.close();
if(context != null) context.close();
}
}
{code}
>From what I gather from the address string docs, session.createConsumer()
>should throw a JMSException, right?
Thanks!
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]