qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qpid user 2 <qpid.use...@gmail.com>
Subject Re: Java Messaging API
Date Thu, 19 May 2011 21:36:52 GMT
Guys. I am using the following destination address in my jndi property, as
advised:
destination.header = my-subscription-queue; {create:always,
node:{x-declare:{auto-delete:True},
x-bindings:[{queue:my-subscription-queue, exchange:'amq.match',
arguments:{'x-match':any, 'userid':10}}]}}

but I am getting a parsing error when parsing for context, as follows. Am I
missing anything?


WARNING: Unable to create destination:java.net.URISyntaxException: Error
occured while parsing URL at index 182: my-subscription-queue;
{create:always, node:{x-declare:{auto-delete:True},
x-bindings:[{queue:my-subscription-queue, exchange:'amq.match',
arguments:{'x-match':any, 'userid':10}}]}}%^
java.net.URISyntaxException: Error occured while parsing URL at index 182:
my-subscription-queue; {create:always, node:{x-declare:{auto-delete:True},
x-bindings:[{queue:my-subscription-queue, exchange:'amq.match',
arguments:{'x-match':any, 'userid':10}}]}}%^
    at org.apache.qpid.url.BindingURLParser.<init>(BindingURLParser.java:88)
    at
org.apache.qpid.url.AMQBindingURL.parseBindingURL(AMQBindingURL.java:58)
    at org.apache.qpid.url.AMQBindingURL.<init>(AMQBindingURL.java:53)
    at
org.apache.qpid.jndi.PropertiesFileInitialContextFactory.createDestination(PropertiesFileInitialContextFactory.java:241)
    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(NamingManager.java:667)
    at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
    at javax.naming.InitialContext.init(InitialContext.java:223)
    at javax.naming.InitialContext.<init>(InitialContext.java:197)
    at
rim.core.instrumentation.subscription.Subscription.main(Subscription.java:37)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 182
    at
org.apache.qpid.url.BindingURLParser.extractExchangeName(BindingURLParser.java:218)
    at org.apache.qpid.url.BindingURLParser.next(BindingURLParser.java:137)
    at org.apache.qpid.url.BindingURLParser.<init>(BindingURLParser.java:70)
    ... 10 more


Thanks
Siamak



On Thu, May 19, 2011 at 10:55 AM, Gordon Sim <gsim@redhat.com> wrote:

> On 05/19/2011 03:53 PM, Rajith Attapattu wrote:
>
>> On Thu, May 19, 2011 at 10:04 AM, Gordon Sim<gsim@redhat.com>  wrote:
>>
>>> On 05/19/2011 02:36 PM, qpid user 2 wrote:
>>>
>>>>
>>>> So any input on this? I am trying to construct a header exchange
>>>> subscription using JMS. How would the destination and jndi properties
>>>> look
>>>> like?
>>>>
>>>
>>> For python or c++ the following address is an example of what you want:
>>>
>>>  my-headers-exchange;
>>> {link:{x-bindings:[{arguments:{'x-match':all,a:b,c:d}}]}}
>>>
>>> That is assuming you have created the headers exchange named
>>> my-headers-exchange already, e.g. with qpid-config. This will match any
>>> message with both a header keyed 'a' with value 'b' and a header keyed
>>> 'c'
>>> with value 'd'.
>>>
>>> Unfortunately it would appear there is a bug in the JMS client preventing
>>> this from working there. (
>>> https://issues.apache.org/jira/browse/QPID-3265)
>>>
>>> An alternative address would be:
>>>
>>>  my-subscription-queue; {create:always,
>>> node:{x-declare:{auto-delete:True},
>>> x-bindings:[{queue:my-subscription-queue, exchange:my-headers-exchange,
>>> arguments:{'x-match':all,a:b,c:d}}]}}
>>>
>>> However that requires that my-subscription-queue be a unique name - not
>>> sure
>>> how well that will work for a JNDI based destination.
>>>
>>
>> I verified that the above addressing string can be specified in the
>> JNDI properties.
>>
>
> The point is not that it can't be specified in JNDI but that multiple
> consumers created from the destination obtained will all be using the same
> queue and will thus compete for messages which is not what you want.
>
> If there was only going to be one consumer that might not be an issue of
> course.
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message