qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morgan Lindqvist <morgan.lindqv...@ericsson.com>
Subject Re: [C++ broker] How to create filters and queues
Date Sat, 12 Mar 2016 17:58:39 GMT
Hi,

Thanks for the assistance, I however still have problems and I am not making
any progress so here comes some more questions. Everything was working fine
with 0.9.1 and RabbitMQ but I must be missing something vital when it comes
moving to AMQP 1.0 and QPID.

Environment: Ubuntu 14.04. qpidd 0.34. Client based on amqp10 for Node JS

Target: Have one AMQP 1.0 node/exchange that an application writes messages
into. Have a number of clients with one queue each that receives all
messages that matches the filter criteria. If a message matches multiple
criteria it shall be put in all the queues for which the filter matches.

I did not manage to get the filtering working so I thought I would start
with a simple node and queue, but that failed as well.

Approach to create the nodes, queue and binding:
  qpid-config -b admin/XXXX@127.0.0.1 add exchange direct nwEx
  qpid-config -b admin/XXXX@127.0.0.1 add queue nwQ
  qpid-config -b admin/XXXX@127.0.0.1 bind nwEx nwQ nwB

The Node JS code for writing contain the following lines:
        client.createSender('nwEx'),
...
        sender.send(message).then(function (state) {...)

Message is defines as follows
        var message  = { body : 'Message body',
                         properties: { userId: settings.username },
                         applicationProperties: { who: 'XYZ', what: 'Yes',
where: 'SWE', format: 'Nice' }};


The Node JS code for reading is as follows:
      client.createReceiver('nwQ')
...
    receiver.on('message', function (message) {
      console.log('msg recv');
      curr++;
    });


Looking at the logs from qpidd I see the connections to the exchange and the
queue, but no error messages.

The qpidd.acl is as follows
  group admin admin@QPID
  acl allow admin all
  acl deny all all

This should be easy, I must be doing something fundamentally wrong, I an
just missing it. The receiving application does not receive any data at all.

When this is working I need to get the filtering up and running as well. The
queue and filter I specified for the above message and application
properties were as follows
    pid-config -b admin/XXXX@127.0.0.1 add queue nwQ
--argumentqpid.filter="where='SWE'"

Here I guess that I need to identify that the "where" attribute comes from
the applicationProperties part in the message. (see above)

I have been searching the web but not managed to find any good examples.
Assistance is welcome.

Best Regards,
Morgan


Olivier Mallassi wrote
> Hi
> 
> I do not know about the JS API but
> 
> 1/ AFAIK, AMQP 1.0 does not define anything regarding queue creation and
> assume queues already exist on the broker side.
> 2/ with qpid cpp,  you could be able to create the "filtered queue " with
> 
>  qpid-config add exchange topic subjects
> 
> qpid-config add queue mysubscription
> --argumentqpid.filter="\"amqp.correlation_id\"='abc'
> AND color='blue' AND weight > 2500"
> 
>   qpid-config bind subjects mysubscription mysubject
> 
> 
> 
> HTH.
> 
> oliv/
> 
> On Thu, Mar 10, 2016 at 5:03 PM, Morgan Lindqvist <

> morgan.lindqvist@

>> wrote:
> 
>> Hi All,
>>
>> I was previously using AMQP 0.9.1 (RabbitMQ) and the client library
>> amqplib
>> for Node JS. With these components it was easy to give the client the
>> possibility to create the queue and the bindingKey and connect it to an
>> topic-exchange.
>>
>> I now would like a client to create a queue and a filter and connect it
>> to
>> an existing node using QPIDD and the Node JS library amqp10.
>>
>> So far I have not discovered any way to do this from the client.
>>
>> I have also been looking for documentation for how to create and describe
>> a
>> filter (so that it works like a bindingKey for 0.9.1). I have however not
>> been successful. Or have I misunderstood how filters can be used?
>>
>> Assistance to make me move forward is highly appreciated.
>>
>> Best Regards,
>> Morgan
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://qpid.2158936.n2.nabble.com/C-broker-How-to-create-filters-and-queues-from-the-client-tp7639889.html
>> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: 

> users-unsubscribe@.apache

>> For additional commands, e-mail: 

> users-help@.apache

>>
>>





--
View this message in context: http://qpid.2158936.n2.nabble.com/C-broker-How-to-create-filters-and-queues-from-the-client-tp7639889p7639988.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Mime
View raw message