[ 
https://issues.apache.org/jira/browse/QPID-4229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13434155#comment-13434155
 ] 

Holger Caesar edited comment on QPID-4229 at 8/15/12 1:39 AM:
--------------------------------------------------------------

Unfortunately I am not sure whether I am allowed to post the whole test suite 
here, therefore I'll try to post the most important snippets. I am using "qpidd 
(qpidc) version 0.14".

My properties file looks like this:
{code:title=Bar.java|borderStyle=solid}
java.naming.factory.initial = 
org.apache.qpid.jndi.PropertiesFileInitialContextFactory
connectionfactory.qpidConnectionfactory = 
amqp://anonymous:anonymous@clientId/vhost?brokerlist='tcp://#########:5672'
{code}

In both the publisher and subscriber I create connections like this:
{code:title=Bar.java|borderStyle=solid}
                ConnectionFactory connectionFactory = null;
                
                try {
                        Properties properties = new Properties();

                        
properties.load(Tools.class.getResourceAsStream("Server.properties"));
                        // Replace dummy client ID by thread specific client ID
                        properties.setProperty("qpidConnectionfactory", 
properties.getProperty("connectionfactory.qpidConnectionfactory").replace("clientId",
 clientId));
                        Context context = new InitialContext(properties);

                        connectionFactory = (ConnectionFactory) 
context.lookup("qpidConnectionfactory");
                } catch (NamingException e) {
                        e.printStackTrace();
                        System.exit(1);
                } catch (IOException e) {
                        e.printStackTrace();
                        System.exit(1);
                }

                int connIndex = threadId % CProperties.noOfConnections;

                if (connections[connIndex] == null) {
                        try {
                                connections[connIndex] = 
connectionFactory.createConnection();
                        } catch (JMSException e) {
                                e.printStackTrace();
                                System.exit(1);
                        }
                }
{code}

And queues/topics are created like this:
{code:title=Bar.java|borderStyle=solid}
                if (queue) dest = session.createQueue(destinationName + "; 
{create: always}");
                else       dest = session.createTopic("BURL:" + 
destinationName); //Do not append any parameters here, as that will break wild 
cards
{code}
                
      was (Author: night):
    Unfortunately I am not sure whether I am allowed to post the whole test 
suite here, therefore I'll try to post the most important snippets. I am using 
"qpidd (qpidc) version 0.14".

My properties file looks like this:
java.naming.factory.initial = 
org.apache.qpid.jndi.PropertiesFileInitialContextFactory
connectionfactory.qpidConnectionfactory = 
amqp://anonymous:anonymous@clientId/vhost?brokerlist='tcp://#########:5672'

In both the publisher and subscriber I create connections like this:
                ConnectionFactory connectionFactory = null;
                
                try {
                        Properties properties = new Properties();

                        
properties.load(Tools.class.getResourceAsStream("Server.properties"));
                        // Replace dummy client ID by thread specific client ID
                        properties.setProperty("qpidConnectionfactory", 
properties.getProperty("connectionfactory.qpidConnectionfactory").replace("clientId",
 clientId));
                        Context context = new InitialContext(properties);

                        connectionFactory = (ConnectionFactory) 
context.lookup("qpidConnectionfactory");
                } catch (NamingException e) {
                        e.printStackTrace();
                        System.exit(1);
                } catch (IOException e) {
                        e.printStackTrace();
                        System.exit(1);
                }

                int connIndex = threadId % CProperties.noOfConnections;

                if (connections[connIndex] == null) {
                        try {
                                connections[connIndex] = 
connectionFactory.createConnection();
                        } catch (JMSException e) {
                                e.printStackTrace();
                                System.exit(1);
                        }
                }

And queues/topics are created like this:
                if (queue) dest = session.createQueue(destinationName + "; 
{create: always}");
                else       dest = session.createTopic("BURL:" + 
destinationName); //Do not append any parameters here, as that will break wild 
cards
                  
> Durable subscription fails due to exclusiveness
> -----------------------------------------------
>
>                 Key: QPID-4229
>                 URL: https://issues.apache.org/jira/browse/QPID-4229
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker, Java Client
>    Affects Versions: 0.14
>            Reporter: Holger Caesar
>            Priority: Critical
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> I want to run a test case where 20 subscribers register to a number of topics 
> that 5 publishers publish to. This baseline test works and now I want to 
> modify it to check whether durability works properly in QPID. The order is as 
> follows:
> 1) Broker starts up
> 2) Subscribers announce a durable subscription and then terminate
> 3) Publishers send their messages and terminate
> 4) Broker restarts
> 5) Subscribers connect again and read their messages (without announcing the 
> durable subscription again)
> Once again I try to be JMS compliant and I am using 
> "Session.createDurableSubscriber(..)". However, when I do that I get an 
> error, because the subscriber wants to have an exclusive subscription to a 
> wildcard queue:
> javax.jms.JMSException: Error registering consumer: 
> org.apache.qpid.AMQException: ch=0 id=2 
> ExecutionException(errorCode=RESOURCE_LOCKED, commandId=4, classCode=8, 
> commandCode=1, fieldIndex=0, description=resource-locked: Cannot grant 
> exclusive access to queue clientId:T.# (qpid/broker/SessionAdapter.cpp:332), 
> errorInfo={}) [error code 405: Already exists]
> But this is weird since I never specified exclusiveness and even trying to 
> disable it does not work (I tried adding "exclusive='false'" in the 
> connectionFactory string as well as "; {exclusive: False}" after the 
> Destination address string.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to