Hi Rajith,

One more question, hopefully the last one (since now thanks to you,
almost everything is working) ... can I somehow add more bindings to
existing consumer? The address for subscribing multiple bindings into
one queue you suggested before ... "my-own-topic-exchange/usa.#;
{create: receiver, link {name: my queue, x-declare: {auto-delete:
true,  'qpid.max_size': 1000} , x-bindings: [{exchange : 'amq.direct',
key : test},{exchange : 'amq.topic', key : 'xyz.#'}]} }" ... works
nicely. I create a destination from this address and based on the
destination, I create the consumer using
session.createConsumer(Destination dest).

But is there any possibility to add subscription keys to this existing
consumer? I can create another consumer, which would subscribe the new
bindings to the same queue, but this solution doesn't seem elegant
enough for me :-o.

Thanks & Regards
Jakub Scholz

On Mon, Jun 28, 2010 at 16:14, Rajith Attapattu <[email protected]> wrote:
> On Mon, Jun 28, 2010 at 5:25 AM, Jakub Scholz <[email protected]> wrote:
>> Hi Rajith,
>>
>> Thanks for the fix - the first three problems are working as expected
>> with latest trunk. I used following address when I found these
>> problems:
>
> Thanks for checking it out and letting me know.
>
>> amq.direct/CLIENT_X.56789; {create: receiver, link : {name :
>> 'service.tmp.CLIENT_X.123456_resp', x-declare : { auto-delete: true,
>> exclusive: true, 'qpid.max_size': 1000, 'qpid.policy_type': ring } } }
>>
> Thx !
>
>> Regarding the "access" right ... I believe in case it would be
>> necessary, we can add the "access" right to the ACL list. The C++ API
>> (version 0.5) and .NET API (version 0.6) are running successfully
>> against the same ACL setup as I'm running this JMS based application.
>
> Are you doing any explicit exchange queries and exchange binds ?
> If yes then the ACL should fail them. If thats not the case then it
> should be a bug and I'd appreciate any info you have on them.
>
>> But these older versions of course don't use the new addressing
>> scheme. From my point of view, it would be great to have a possibility
>> to bypass this querying functionality (for example by another option
>> in address). But I don't have enough knowledge about the APIs to know
>> whether it is possible or isn't.
>
> The new addressing scheme is common to all clients and we aim to have
> a consistent behaviour.
> When interpreting an address-string the client needs to figure out if
> it's an exchange or a queue if the node type is missing (for 0-10) and
> if it actually exists.
> So there will be an exchange and/or queue query. So those permissions
> are needed in the current ACL model.
> I guess your question is, whether we could turn off the querying for
> existence if the node type is present ?
>
>> Thanks & Regards
>> Jakub Scholz
>>
>> On Fri, Jun 25, 2010 at 22:33, Rajith Attapattu <[email protected]> wrote:
>>> Hello Jakub,
>>>
>>> I have fixed the fist 3 problems in rev 958102 on qpid trunk.
>>> Many thanks for bringing this to my attention.
>>>
>>> Could you also specify the address string that cause each of these problems?
>>>
>>> As for problem 4, if you are using ACL then you need explicit
>>> permission to access (query) or bind to an exchange.
>>> When using type : queue then the "address" is taken as a queue and
>>> then will be bound to any exchange explicitly specified in string.
>>> (By default every queue created is bound to the nameless exchange with
>>> queue name as the binding key).
>>>
>>> If using type : topic then address is considered as an exchange and
>>> the client will try to see if an exchange by the name exists. Hence
>>> the call to exchange query.
>>>
>>> I was a bit surprised when you mentioned that you don't get this with
>>> the c++ API and .NET API.
>>> Could you provide more details on that ?
>>>
>>> If ACL is used then permissions will determine who can access what.
>>>
>>> Regards,
>>>
>>> Rajith
>>>
>>> On Fri, Jun 25, 2010 at 1:46 PM, Jakub Scholz <[email protected]> wrote:
>>>> Hi Rajith,
>>>>
>>>> You don't need to apologize, I'm glad for any help. I builded the
>>>> latest trunk and tried it again. The previous problem with the
>>>> PropertiesFileInitialContextFactoryis indeed fixed. I run into few
>>>> other problems regarding the addresses:
>>>>
>>>> 1) When I used the addresses you suggested, it was complaining about
>>>> NullPointerException in AddressHelper.getLink
>>>>
>>>> WARNUNG: Unable to create destination:java.lang.NullPointerException
>>>> java.lang.NullPointerException
>>>>        at 
>>>> org.apache.qpid.client.messaging.address.AddressHelper.getLink(AddressHelper.java:326)
>>>>        at 
>>>> org.apache.qpid.client.AMQDestination.getInfoFromAddress(AMQDestination.java:823)
>>>>        at 
>>>> org.apache.qpid.client.AMQDestination.<init>(AMQDestination.java:157)
>>>>        at 
>>>> org.apache.qpid.client.AMQAnyDestination.<init>(AMQAnyDestination.java:52)
>>>>        at 
>>>> org.apache.qpid.client.AMQDestination.createDestination(AMQDestination.java:669)
>>>>        at 
>>>> org.apache.qpid.jndi.PropertiesFileInitialContextFactory.createDestination(PropertiesFileInitialContextFactory.java:240)
>>>>        at 
>>>> org.apache.qpid.jndi.PropertiesFileInitialContextFactory.createDestinations(PropertiesFileInitialContextFactory.java:160)
>>>>        at 
>>>> org.apache.qpid.jndi.PropertiesFileInitialContextFactory.getInitialContext(PropertiesFileInitialContextFactory.java:117)
>>>>        at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
>>>>        at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
>>>>        at javax.naming.InitialContext.init(Unknown Source)
>>>>        at javax.naming.InitialContext.<init>(Unknown Source)
>>>>        at 
>>>> org.apache.qpid.example.jmsexample.hello.Hello.runTest(Hello.java:18)
>>>>        at jms.Client.main(Client.java:329)
>>>>
>>>> This problem seems to be caused by missing capacity option in my
>>>> Address. After i added capacity: 1000, this problem didn't appeared
>>>> again. Maybe some default CAPACITY value should be added to the
>>>> AddressHelper.
>>>>
>>>> 2) The qpid.policy-type option seems to be expecting integer instead
>>>> of String. Therefore, when I tried to set policy-type to ring, I got
>>>> following exception:
>>>>
>>>> java.lang.NumberFormatException: For input string: "ring"
>>>>        at java.lang.NumberFormatException.forInputString(Unknown Source)
>>>>        at java.lang.Integer.parseInt(Unknown Source)
>>>>        at java.lang.Integer.parseInt(Unknown Source)
>>>>        at 
>>>> org.apache.qpid.configuration.Accessor$MapAccessor.getInt(Accessor.java:101)
>>>>        at 
>>>> org.apache.qpid.client.messaging.address.AddressHelper.getQpidQueueOptions(AddressHelper.java:132)
>>>>        at 
>>>> org.apache.qpid.client.messaging.address.AddressHelper.createQueueNode(AddressHelper.java:273)
>>>>        at 
>>>> org.apache.qpid.client.messaging.address.AddressHelper.getSourceNode(AddressHelper.java:300)
>>>>        at 
>>>> org.apache.qpid.client.AMQDestination.rebuildTargetAndSourceNodes(AMQDestination.java:832)
>>>>        at 
>>>> org.apache.qpid.client.AMQSession_0_10.resolveAddressType(AMQSession_0_10.java:1217)
>>>>        at 
>>>> org.apache.qpid.client.AMQSession_0_10.handleAddressBasedDestination(AMQSession_0_10.java:1144)
>>>>        at 
>>>> org.apache.qpid.client.AMQSession.registerConsumer(AMQSession.java:2606)
>>>>        at org.apache.qpid.client.AMQSession.access$500(AMQSession.java:95)
>>>>        at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:1809)
>>>>        at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:1775)
>>>>        at 
>>>> org.apache.qpid.client.AMQConnectionDelegate_0_10.executeRetrySupport(AMQConnectionDelegate_0_10.java:278)
>>>>        at 
>>>> org.apache.qpid.client.AMQConnection.executeRetrySupport(AMQConnection.java:765)
>>>>        at 
>>>> org.apache.qpid.client.failover.FailoverRetrySupport.execute(FailoverRetrySupport.java:102)
>>>>        at 
>>>> org.apache.qpid.client.AMQSession.createConsumerImpl(AMQSession.java:1773)
>>>>        at 
>>>> org.apache.qpid.client.AMQSession.createConsumer(AMQSession.java:921)
>>>>        at 
>>>> org.apache.qpid.example.jmsexample.hello.Hello.runTest(Hello.java:30)
>>>>        at jms.Client.main(Client.java:329)
>>>>
>>>> After changing the args.getInt(...) to args.getString(...) on line 132
>>>> of AddressHelper class.
>>>>
>>>> 3) The last exception I run into was this:
>>>>
>>>> java.lang.NullPointerException
>>>>        at 
>>>> org.apache.qpid.client.messaging.address.AddressHelper.fillInCommonNodeArgs(AddressHelper.java:281)
>>>>        at 
>>>> org.apache.qpid.client.messaging.address.AddressHelper.createQueueNode(AddressHelper.java:274)
>>>>        at 
>>>> org.apache.qpid.client.messaging.address.AddressHelper.getSourceNode(AddressHelper.java:300)
>>>>        at 
>>>> org.apache.qpid.client.AMQDestination.rebuildTargetAndSourceNodes(AMQDestination.java:832)
>>>>        at 
>>>> org.apache.qpid.client.AMQSession_0_10.resolveAddressType(AMQSession_0_10.java:1217)
>>>>        at 
>>>> org.apache.qpid.client.AMQSession_0_10.handleAddressBasedDestination(AMQSession_0_10.java:1144)
>>>>        at 
>>>> org.apache.qpid.client.AMQSession.registerConsumer(AMQSession.java:2606)
>>>>        at org.apache.qpid.client.AMQSession.access$500(AMQSession.java:95)
>>>>        at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:1809)
>>>>        at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:1775)
>>>>        at 
>>>> org.apache.qpid.client.AMQConnectionDelegate_0_10.executeRetrySupport(AMQConnectionDelegate_0_10.java:278)
>>>>        at 
>>>> org.apache.qpid.client.AMQConnection.executeRetrySupport(AMQConnection.java:765)
>>>>        at 
>>>> org.apache.qpid.client.failover.FailoverRetrySupport.execute(FailoverRetrySupport.java:102)
>>>>        at 
>>>> org.apache.qpid.client.AMQSession.createConsumerImpl(AMQSession.java:1773)
>>>>        at 
>>>> org.apache.qpid.client.AMQSession.createConsumer(AMQSession.java:921)
>>>>        at 
>>>> org.apache.qpid.example.jmsexample.hello.Hello.runTest(Hello.java:30)
>>>>        at jms.Client.main(Client.java:329)
>>>>
>>>> On the line 281 of AddressHelper, the null check is missing again.
>>>> After verifying whether nodeProps != null the problem seemed to be
>>>> fixed.
>>>>
>>>> 4) The last problem I found so far was, that the JMS API needed the
>>>> access right to the exchange I was binding. That is currently
>>>> forbidden on our system. This right was not needed with the old Qpid
>>>> API or in c++ and .NET APIs. I was getting following errors:
>>>>
>>>> INFO: Created session:org.apache.qpid.client.amqsession_0...@b1a4e2
>>>> org.apache.qpid.transport.SessionException: ch=0 id=0
>>>> ExecutionException(errorCode=NOT_ALLOWED, commandId=0, classCode=7,
>>>> commandCode=6, fieldIndex=0, description=not-allowed: ACL denied
>>>> exchange bound request from cli...@qpid5318
>>>> (qpid/broker/SessionAdapter.cpp:238), errorInfo={})
>>>>        at 
>>>> org.apache.qpid.transport.Session$ResultFuture.get(Session.java:847)
>>>>        at 
>>>> org.apache.qpid.transport.Session$ResultFuture.get(Session.java:859)
>>>>        at 
>>>> org.apache.qpid.client.AMQSession_0_10.resolveAddressType(AMQSession_0_10.java:1203)
>>>>        at 
>>>> org.apache.qpid.client.AMQSession_0_10.handleAddressBasedDestination(AMQSession_0_10.java:1144)
>>>>        at 
>>>> org.apache.qpid.client.AMQSession.registerConsumer(AMQSession.java:2606)
>>>>        at org.apache.qpid.client.AMQSession.access$500(AMQSession.java:95)
>>>>        at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:1809)
>>>>        at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:1775)
>>>>        at 
>>>> org.apache.qpid.client.AMQConnectionDelegate_0_10.executeRetrySupport(AMQConnectionDelegate_0_10.java:278)
>>>>        at 
>>>> org.apache.qpid.client.AMQConnection.executeRetrySupport(AMQConnection.java:765)
>>>>        at 
>>>> org.apache.qpid.client.failover.FailoverRetrySupport.execute(FailoverRetrySupport.java:102)
>>>>        at 
>>>> org.apache.qpid.client.AMQSession.createConsumerImpl(AMQSession.java:1773)
>>>>        at 
>>>> org.apache.qpid.client.AMQSession.createConsumer(AMQSession.java:921)
>>>>        at 
>>>> org.apache.qpid.example.jmsexample.hello.Hello.runTest(Hello.java:30)
>>>>        at jms.Client.main(Client.java:329)
>>>>
>>>> I tried to force the node type with "node: { type: topic }", which
>>>> gave me different error:
>>>>
>>>> INFO: Created session:org.apache.qpid.client.amqsession_0...@2016b0
>>>> org.apache.qpid.transport.SessionException: ch=0 id=0
>>>> ExecutionException(errorCode=NOT_ALLOWED, commandId=0, classCode=7,
>>>> commandCode=3, fieldIndex=0, description=not-allowed: ACL denied
>>>> exchange query request from cli...@qpid5318
>>>> (qpid/broker/SessionAdapter.cpp:153), errorInfo={})
>>>>        at 
>>>> org.apache.qpid.transport.Session$ResultFuture.get(Session.java:847)
>>>>        at 
>>>> org.apache.qpid.transport.Session$ResultFuture.get(Session.java:859)
>>>>        at 
>>>> org.apache.qpid.client.AMQSession_0_10.isExchangeExist(AMQSession_0_10.java:1041)
>>>>        at 
>>>> org.apache.qpid.client.AMQSession_0_10.handleAddressBasedDestination(AMQSession_0_10.java:1165)
>>>>        at 
>>>> org.apache.qpid.client.AMQSession.registerConsumer(AMQSession.java:2606)
>>>>        at org.apache.qpid.client.AMQSession.access$500(AMQSession.java:95)
>>>>        at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:1809)
>>>>        at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:1775)
>>>>        at 
>>>> org.apache.qpid.client.AMQConnectionDelegate_0_10.executeRetrySupport(AMQConnectionDelegate_0_10.java:278)
>>>>        at 
>>>> org.apache.qpid.client.AMQConnection.executeRetrySupport(AMQConnection.java:765)
>>>>        at 
>>>> org.apache.qpid.client.failover.FailoverRetrySupport.execute(FailoverRetrySupport.java:102)
>>>>        at 
>>>> org.apache.qpid.client.AMQSession.createConsumerImpl(AMQSession.java:1773)
>>>>        at 
>>>> org.apache.qpid.client.AMQSession.createConsumer(AMQSession.java:921)
>>>>        at 
>>>> org.apache.qpid.example.jmsexample.hello.Hello.runTest(Hello.java:30)
>>>>        at jms.Client.main(Client.java:329)
>>>>
>>>> But I still need the access rights to the exchange to get it working.
>>>> I tried to use the assert option, but it doesn't help. Can I somehow
>>>> bypass this or is adding the access right for the exchange the only
>>>> possibility?
>>>>
>>>> Thanks & Regards
>>>> Jakub
>>>>
>>>> On Fri, Jun 25, 2010 at 16:06, Rajith Attapattu <[email protected]> wrote:
>>>>> Hi Jakub,
>>>>>
>>>>> Apologies for the delay in replying to you. I was down with the flu
>>>>> this week and it derailed most of my plans.
>>>>> Anyways there was a bug (QPID-2696) in Qpid which cause the issue you 
>>>>> reported.
>>>>> I have fixed this in rev 957942 in trunk.
>>>>> Please give it a try and let us know.
>>>>> Again, very sorry for the delay in responding.
>>>>>
>>>>> Regards,
>>>>>
>>>>> Rajith
>>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Regards,
>>>
>>> Rajith Attapattu
>>> Red Hat
>>> http://rajith.2rlabs.com/
>>>
>>
>
>
>
> --
> Regards,
>
> Rajith Attapattu
> Red Hat
> http://rajith.2rlabs.com/
>

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to