You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Cajus Pollmeier <ca...@naasa.net> on 2010/02/15 10:55:39 UTC

Getting started...

Hi,

sorry for the badly chosen subject - I'm new to the world of amqp/qpid and I'm playing with the python stuff in the moment. While digging around, I ran into a couple of questions:

The python examples offer a .body element for messages, where I can get the message body. How can I  find out which SASL user sent the message?

Alternatively: for qpid, there's an ACL module. I'm authenticating against LDAP and I'd like to use dynamic groups in order to define ACLs depending on a small number of groups. In my case, I'd like to store groups inside of my LDAP tree and not statically defined in my qpid policy file. Is it possible to get this kind of behavior without creating an additional ACL module?

And one python thingie: what would be the preferred way to use a python library inside a threaded environment? I've seen that there's a twisted integrated non qpid library for that, but I can't get it up and running with qpid.

Thanks,
Cajus
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Getting started...

Posted by Gordon Sim <gs...@redhat.com>.
On 02/15/2010 09:55 AM, Cajus Pollmeier wrote:
> Hi,
>
> sorry for the badly chosen subject - I'm new to the world of amqp/qpid and I'm playing with the python stuff in the moment.

Welcome!

> While digging around, I ran into a couple of questions:
>
> The python examples offer a .body element for messages, where I can get the message body. How can I  find out which SASL user sent the message?

The sending client can set the userid on the message (in 
message-properties). This can then be enforced by the broker (so that 
clients can't send messages purporting to be from someone else). The 
receiving client can then read that property. However at present 
messages may not all have the userid set.

>
> Alternatively: for qpid, there's an ACL module. I'm authenticating against LDAP and I'd like to use dynamic groups in order to define ACLs depending on a small number of groups. In my case, I'd like to store groups inside of my LDAP tree and not statically defined in my qpid policy file. Is it possible to get this kind of behavior without creating an additional ACL module?

No, not at present.

> And one python thingie: what would be the preferred way to use a python library inside a threaded environment? I've seen that there's a twisted integrated non qpid library for that, but I can't get it up and running with qpid.

That library is based on the 0-8 or 0-9 version of the protocol and thus 
will not work with qpidd (the c++ based broker). It should work with the 
java based broker as that supports the older versions of AMQP as well.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Standard practice for recovering from resource exceeded exception

Posted by Rajith Attapattu <ra...@gmail.com>.
On Wed, Feb 17, 2010 at 4:17 PM, Andrew L <kh...@hotmail.com> wrote:
>
> My system is sending messages asynchronously and they are enqueued much faster than they are dequeued.  What is the standard method for handling a resource policy exceeded exception from the broker?  Wait and retry sending after some time?  Is there a more pro-active method?

Are you using the c++ client?
If so you would need to re-create your session and then retry after sometime.

However the following may help in eliminating blind retries
If you know the queue-limit then you could do a queue query and get
the current message count.
This will not be much of a help if you have exceeded the byte count
(as opposed to the message count) as the above doesn't give you the
byte depth.

>
> Thanks.
>
> _________________________________________________________________
> Hotmail: Powerful Free email with security by Microsoft.
> http://clk.atdmt.com/GBL/go/201469230/direct/01/



-- 
Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Standard practice for recovering from resource exceeded exception

Posted by Andrew L <kh...@hotmail.com>.
My system is sending messages asynchronously and they are enqueued much faster than they are dequeued.  What is the standard method for handling a resource policy exceeded exception from the broker?  Wait and retry sending after some time?  Is there a more pro-active method?

Thanks.
 		 	   		  
_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
http://clk.atdmt.com/GBL/go/201469230/direct/01/

Re: Getting started...

Posted by Cajus Pollmeier <ca...@naasa.net>.
Thanks, it does ;-)

I'm aware that it (docs and code) is work in progress, so some questions might sound stupid. But things getting clearer. Currently fighting with other things. Will be back soon.

Cheers,
Cajus

@Gordon: I'll wait with doing modifications to the drain thingie, because you told that there were a couple of changes to be done...

Am 03.05.2010 um 22:28 schrieb Jonathan Robie:

> I added a section on the XML Exchange to "Programming in Apache Qpid". The source is checked in to our svn repo, and it will appear on the new web site as soon as it is up, in the meantime you can see it here:
> 
> http://people.apache.org/~jonathan/Programming-In-Apache-Qpid.html
> http://people.apache.org/~jonathan/Programming-In-Apache-Qpid.pdf
> 
> This is still very much a work in progress. Hope it helps you with your XML Exchange questions!
> 
> Jonathan
> 
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
> 


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Getting started...

Posted by Jonathan Robie <jo...@redhat.com>.
I added a section on the XML Exchange to "Programming in Apache Qpid". 
The source is checked in to our svn repo, and it will appear on the new 
web site as soon as it is up, in the meantime you can see it here:

http://people.apache.org/~jonathan/Programming-In-Apache-Qpid.html
http://people.apache.org/~jonathan/Programming-In-Apache-Qpid.pdf

This is still very much a work in progress. Hope it helps you with your 
XML Exchange questions!

Jonathan

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Getting started...

Posted by Jonathan Robie <jo...@redhat.com>.
Here's a C++ program that uses the XML exchange. The only x-bindings 
argument that is really needed is the xquery, since the subject and the 
exchange can be specified as part of standard address syntax. I used a 
stringstream to make it easier to write a query and add it to a template 
string that creates an address containing that query.

I have a Python program that does the same, using the same address, but 
it runs into the bug Gordon reported in 
https://issues.apache.org/jira/browse/QPID-2551.

Hope this is helpful!

Jonathan

#include <qpid/messaging/Connection.h>
#include <qpid/messaging/Message.h>
#include <qpid/messaging/Receiver.h>
#include <qpid/messaging/Sender.h>
#include <qpid/messaging/Session.h>

#include <iostream>
#include <sstream>
using std::stringstream;

using namespace qpid::messaging;

int main(int argc, char** argv) {
   std::string broker = argc > 1 ? argv[1] : "localhost:5672";
   std::string query =
     "let $w := ./weather "
     "return $w/station = 'Raleigh-Durham International Airport (KRDU)' "
     "   and $w/temperature_f > 50"
     "   and $w/temperature_f - $w/dewpoint > 5"
     "   and $w/wind_speed_mph > 7"
     "   and $w/wind_speed_mph < 20";

   stringstream address;

   address << "xml/weather; {"
     " link: { "
     "  x-bindings: [{ arguments: { xquery:\"" << query << "\"} }] "
     " } "
     "}";

   Connection connection(broker);
   try {
     connection.open();
     Session session = connection.createSession();

     Receiver receiver = session.createReceiver(address.str());

     Message message;
     message.setContent(
                "<weather>"
                "<station>Raleigh-Durham International Airport 
(KRDU)</station>"
                "<wind_speed_mph>16</wind_speed_mph>"
                "<temperature_f>70</temperature_f>"
                "<dewpoint>35</dewpoint>"
                "</weather>");
     Sender sender = session.createSender("xml/weather");
     sender.send(message);

     Message response = receiver.fetch();

     std::cout << response.getContent() << std::endl;

     connection.close();
     return 0;
   } catch(const std::exception& error) {
     std::cerr << error.what() << std::endl;
     connection.close();
     return 1;
   }
}


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Getting started...

Posted by Jonathan Robie <jo...@redhat.com>.
On 04/30/2010 05:38 PM, Jonathan Robie wrote:
>
>   sender = session.sender(address)
>   receiver = session.receiver(address)

Oops, that should have read:

sender = session.sender("xml")
receiver = session.receiver(address)

In other words, I should be sending to the XML Exchange, and reading 
from a queue. What I sent actually sends directly to the queue.

Unfortunately, when I fixed that error, the program stopped working. I'm 
not sure if the bug is in my code or not.

Jonathan

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Getting started...

Posted by Jonathan Robie <jo...@redhat.com>.
This Python program works for me, using the same data as the XML 
Exchange example in the Python examples directory.

Make sure you create an instance of the XML exchange with qpid-config first:

$ ./qpid-config add exchange xml xml

Jonathan



import sys
from qpid.messaging import *

broker =  "localhost:5672"
query = """
    let $w := ./weather
    return $w/station = 'Raleigh-Durham International Airport (KRDU)'
       and $w/temperature_f > 50
       and $w/temperature_f - $w/dewpoint > 5
       and $w/wind_speed_mph > 7
       and $w/wind_speed_mph < 20
"""

address = "subscription; {create: always, delete:always, link: { 
x-bindings: [{ exchange: xml, queue: subscription, key: xml, arguments: 
{ xquery: %r} }] } }" % query


connection = Connection(broker)

try:
   connection.open()
   session = connection.session()

   sender = session.sender(address)
   receiver = session.receiver(address)

   sender.send(Message("<weather><station>Raleigh-Durham International 
Airport 
(KRDU)</station><wind_speed_mph>16</wind_speed_mph><temperature_f>70</temperature_f><dewpoint>35</dewpoint></weather>"));

   message = receiver.fetch(timeout=1)
   print message.content
   session.acknowledge()

except MessagingError,m:
   print m
finally:
   connection.close()

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Getting started...

Posted by Gordon Sim <gs...@redhat.com>.
On 04/27/2010 08:57 AM, Cajus Pollmeier wrote:
> Hi. Yes. I'm using trunk for testing now.
>
> While the documentation refers to "-a address", the code in trunk uses just "address".

Yes, there are some differences between the c++ and python arguments at 
present and that is one of them. (Hopefully I'll fix that one shortly). 
The address-file option is a nice one also,

> I've added "-a addressfile" to the local drain version to not waste the time with shell escapes.
>
> Seems like the todo file is right: xquery does not work right now. If you think it should:
>
> xml; {
>    node: {
>      x-bindings: [
>                    {
>                      exchange: xml,
>                      queue: message_queue,
>                      key: weather,
>                      arguments: {
>                        xquery: "let $w := ./weather; return $w/station = 'somewhere'"
>                      }
>                    }
>                  ]
>          }
> }

The x-bindings in the node properties will only be enacted if you turn 
the create policy on (e.g. create: always). There is an issue there as 
well however in the receiver case.

Creating a receiver for an address that resolves to an exchange results 
in the client creating a subscription queue and binding it to that 
exchange. There is some detail in the docs around how this is handled 
for the different exchange types. In the case of the xml exchange you 
either have to include a subject or you have to have an x-bindings 
element defined for the *link* (not the node). Without that, the client 
can't create a valid binding for the subscription queue.

The xml exchange doesn't like the xquery you use above. However the 
following will work using the c++ version of drain (this will work with 
the xml_producer in the old xml example):

drain -a "xml; {link:{x-bindings: [{exchange: xml, key:"content_feed", 
arguments:{xquery:\"declare variable \$control external; ./message/id 
mod 2 = 1 or \$control = 'end'\"}}]}}" -f

I don't have an address file option just yet, but this is equivalent to:

xml; {
    link: {
      x-bindings: [
                    {
                      exchange: xml,
                      key: content_feed,
                      arguments: {
                        xquery:"declare variable $control external; 
./message/id mod 2 = 1 or $control = 'end'"
                      }
                    }
                  ]
          }
}

If you then run the xml_producer then you will see the odd numbered 
messages as expected.

There is an issue with the python client at present. If fed the above 
address it will still result in the error below. This is because it 
sends to bind requests and the first has no arguments specified for it. 
I've created a Jira to track that: 
https://issues.apache.org/jira/browse/QPID-2551

I hope this makes sense. I appreciate its not as obvious as would be 
ideal. Thoughts on how we could better document this are appreciated.

>
> Is the address string correct, or am I missing something? Here's the drain output:
>
> Traceback (most recent call last):
>    File "./drain", line 93, in<module>
>      rcv = ssn.receiver(addr)
>    File "<string>", line 6, in receiver
>    File "/usr/lib/python2.5/site-packages/qpid/messaging/endpoints.py", line 571, in receiver
>      receiver._ewait(lambda: receiver.linked)
>    File "/usr/lib/python2.5/site-packages/qpid/messaging/endpoints.py", line 881, in _ewait
>      result = self.session._ewait(lambda: self.error or predicate(), timeout)
>    File "/usr/lib/python2.5/site-packages/qpid/messaging/endpoints.py", line 528, in _ewait
>      self.check_error()
>    File "/usr/lib/python2.5/site-packages/qpid/messaging/endpoints.py", line 517, in check_error
>      raise self.error
> qpid.messaging.exceptions.ServerError: internal-error: Could not parse xquery: (qpid/xml/XmlExchange.cpp:118)(541)



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Getting started...

Posted by Cajus Pollmeier <ca...@naasa.net>.
Hi. Yes. I'm using trunk for testing now.

While the documentation refers to "-a address", the code in trunk uses just "address". I've added "-a addressfile" to the local drain version to not waste the time with shell escapes.

Seems like the todo file is right: xquery does not work right now. If you think it should:

xml; {
  node: {
    x-bindings: [
                  {
                    exchange: xml,
                    queue: message_queue,
                    key: weather,
                    arguments: {
                      xquery: "let $w := ./weather; return $w/station = 'somewhere'"
                    }
                  }
                ]
        }
}

Is the address string correct, or am I missing something? Here's the drain output:

Traceback (most recent call last):
  File "./drain", line 93, in <module>
    rcv = ssn.receiver(addr)
  File "<string>", line 6, in receiver
  File "/usr/lib/python2.5/site-packages/qpid/messaging/endpoints.py", line 571, in receiver
    receiver._ewait(lambda: receiver.linked)
  File "/usr/lib/python2.5/site-packages/qpid/messaging/endpoints.py", line 881, in _ewait
    result = self.session._ewait(lambda: self.error or predicate(), timeout)
  File "/usr/lib/python2.5/site-packages/qpid/messaging/endpoints.py", line 528, in _ewait
    self.check_error()
  File "/usr/lib/python2.5/site-packages/qpid/messaging/endpoints.py", line 517, in check_error
    raise self.error
qpid.messaging.exceptions.ServerError: internal-error: Could not parse xquery: (qpid/xml/XmlExchange.cpp:118)(541)

Cheers,
Cajus

Am 26.04.2010 um 09:49 schrieb Gordon Sim:

> Note that the info in the docs relates to the latest code from trunk. The api (and particularly the address options) was still in flux when 0.6 was released, so there have been some changes since then.
> 
> On 04/26/2010 07:33 AM, Cajus Pollmeier wrote:
>> Thanks Jonathan,
>> 
>> reading now... Guess it will help a lot ;-)
>> 
>> Cheers,
>> Cajus
>> 
>> Am 25.04.2010 um 21:26 schrieb Jonathan Robie:
>> 
>>> On 04/22/2010 09:31 AM, Cajus Pollmeier wrote:
>>>> 
>>>> just waited for 0.6 to pop up and tried to do something with the new API. Is there some documentation for it and it's usage intention?
>>>> 
>>>> Reading the code examples (examples/api) and the (rare) documentation for the API itself, I'm wondering where queues and exchanges have gone. How would i.e. the xml example look like using the new API - if possible?
>>>> 
>>> 
>>> See if this helps:
>>> 
>>>       http://people.apache.org/~jonathan/High-Level-API.html,
>>>       http://people.apache.org/~jonathan/High-Level-API.pdf
>>> 
>>> This will show up in our documentation in some revised form.
>>> 
>>> Jonathan
>>> 
>>> ---------------------------------------------------------------------
>>> Apache Qpid - AMQP Messaging Implementation
>>> Project:      http://qpid.apache.org
>>> Use/Interact: mailto:users-subscribe@qpid.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project:      http://qpid.apache.org
>> Use/Interact: mailto:users-subscribe@qpid.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
> 


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Getting started...

Posted by Gordon Sim <gs...@redhat.com>.
Note that the info in the docs relates to the latest code from trunk. 
The api (and particularly the address options) was still in flux when 
0.6 was released, so there have been some changes since then.

On 04/26/2010 07:33 AM, Cajus Pollmeier wrote:
> Thanks Jonathan,
>
> reading now... Guess it will help a lot ;-)
>
> Cheers,
> Cajus
>
> Am 25.04.2010 um 21:26 schrieb Jonathan Robie:
>
>> On 04/22/2010 09:31 AM, Cajus Pollmeier wrote:
>>>
>>> just waited for 0.6 to pop up and tried to do something with the new API. Is there some documentation for it and it's usage intention?
>>>
>>> Reading the code examples (examples/api) and the (rare) documentation for the API itself, I'm wondering where queues and exchanges have gone. How would i.e. the xml example look like using the new API - if possible?
>>>
>>
>> See if this helps:
>>
>>        http://people.apache.org/~jonathan/High-Level-API.html,
>>        http://people.apache.org/~jonathan/High-Level-API.pdf
>>
>> This will show up in our documentation in some revised form.
>>
>> Jonathan
>>
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project:      http://qpid.apache.org
>> Use/Interact: mailto:users-subscribe@qpid.apache.org
>>
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Getting started...

Posted by Cajus Pollmeier <ca...@naasa.net>.
Thanks Jonathan,

reading now... Guess it will help a lot ;-)

Cheers,
Cajus

Am 25.04.2010 um 21:26 schrieb Jonathan Robie:

> On 04/22/2010 09:31 AM, Cajus Pollmeier wrote:
>> 
>> just waited for 0.6 to pop up and tried to do something with the new API. Is there some documentation for it and it's usage intention?
>> 
>> Reading the code examples (examples/api) and the (rare) documentation for the API itself, I'm wondering where queues and exchanges have gone. How would i.e. the xml example look like using the new API - if possible?
>>   
> 
> See if this helps:
> 
>       http://people.apache.org/~jonathan/High-Level-API.html,
>       http://people.apache.org/~jonathan/High-Level-API.pdf
> 
> This will show up in our documentation in some revised form.
> 
> Jonathan
> 
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
> 


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Getting started...

Posted by Jonathan Robie <jo...@redhat.com>.
On 04/22/2010 09:31 AM, Cajus Pollmeier wrote:
>
> just waited for 0.6 to pop up and tried to do something with the new API. Is there some documentation for it and it's usage intention?
>
> Reading the code examples (examples/api) and the (rare) documentation for the API itself, I'm wondering where queues and exchanges have gone. How would i.e. the xml example look like using the new API - if possible?
>    

See if this helps:

        http://people.apache.org/~jonathan/High-Level-API.html,
        http://people.apache.org/~jonathan/High-Level-API.pdf

This will show up in our documentation in some revised form.

Jonathan

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Getting started...

Posted by Cajus Pollmeier <ca...@naasa.net>.
Am 17.02.2010 um 15:03 schrieb Rajith Attapattu:
> On Wed, Feb 17, 2010 at 5:07 AM, Cajus Pollmeier <ca...@naasa.net> wrote:
>> Thanks. The help thingie did the trick - just exported it to something more usable.
>> 
>> You're talking about qpid.messaging. Where can I find this one? It doesn't seem to be in my 0.5 installation.
> 
> The new messaging API is still being worked out.
> However the 0.6 release should contain a fairly workable API.

just waited for 0.6 to pop up and tried to do something with the new API. Is there some documentation for it and it's usage intention?

Reading the code examples (examples/api) and the (rare) documentation for the API itself, I'm wondering where queues and exchanges have gone. How would i.e. the xml example look like using the new API - if possible?

Cheers,
Cajus
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Getting started...

Posted by Rajith Attapattu <ra...@gmail.com>.
On Wed, Feb 17, 2010 at 5:07 AM, Cajus Pollmeier <ca...@naasa.net> wrote:
> Thanks. The help thingie did the trick - just exported it to something more usable.
>
> You're talking about qpid.messaging. Where can I find this one? It doesn't seem to be in my 0.5 installation.

The new messaging API is still being worked out.
However the 0.6 release should contain a fairly workable API.

>
> Am 16.02.2010 um 15:08 schrieb Gordon Sim:
>
>> On 02/15/2010 05:52 PM, Cajus Pollmeier wrote:
>>> Hmm. Looks like the specs declare an user-id in the message-properties. The python docs don't tell me much about session.message_properties() and possible methods.
>>>
>>> Is there a way to get it?
>>
>> You can get information on the various properties using pythons help mechanism and an interactive python session. (import qpid.session, then help(qpid.session.Session)). That will include information on the methods and properties available (most of the text is taken from the amqp xml spec).
>>
>> msg.get("message_properties").userid lets you get at the userid (I believe msg["message_properties"].userid would do the same.
>>
>> Btw, you may also want to look at the higher level api in qpid.messaging. It aims to abstract a lot of the protocol details making it easier to use and more future proof.
>>
>>>
>>> Am 15.02.2010 um 10:55 schrieb Cajus Pollmeier:
>>>
>>>> Hi,
>>>>
>>>> sorry for the badly chosen subject - I'm new to the world of amqp/qpid and I'm playing with the python stuff in the moment. While digging around, I ran into a couple of questions:
>>>>
>>>> The python examples offer a .body element for messages, where I can get the message body. How can I  find out which SASL user sent the message?
>>>>
>>>> Alternatively: for qpid, there's an ACL module. I'm authenticating against LDAP and I'd like to use dynamic groups in order to define ACLs depending on a small number of groups. In my case, I'd like to store groups inside of my LDAP tree and not statically defined in my qpid policy file. Is it possible to get this kind of behavior without creating an additional ACL module?
>>>>
>>>> And one python thingie: what would be the preferred way to use a python library inside a threaded environment? I've seen that there's a twisted integrated non qpid library for that, but I can't get it up and running with qpid.
>>>>
>>>> Thanks,
>>>> Cajus
>>>> ---------------------------------------------------------------------
>>>> Apache Qpid - AMQP Messaging Implementation
>>>> Project:      http://qpid.apache.org
>>>> Use/Interact: mailto:users-subscribe@qpid.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> Apache Qpid - AMQP Messaging Implementation
>>> Project:      http://qpid.apache.org
>>> Use/Interact: mailto:users-subscribe@qpid.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project:      http://qpid.apache.org
>> Use/Interact: mailto:users-subscribe@qpid.apache.org
>>
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>



-- 
Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Getting started...

Posted by Cajus Pollmeier <ca...@naasa.net>.
Thanks. The help thingie did the trick - just exported it to something more usable.

You're talking about qpid.messaging. Where can I find this one? It doesn't seem to be in my 0.5 installation.

Am 16.02.2010 um 15:08 schrieb Gordon Sim:

> On 02/15/2010 05:52 PM, Cajus Pollmeier wrote:
>> Hmm. Looks like the specs declare an user-id in the message-properties. The python docs don't tell me much about session.message_properties() and possible methods.
>> 
>> Is there a way to get it?
> 
> You can get information on the various properties using pythons help mechanism and an interactive python session. (import qpid.session, then help(qpid.session.Session)). That will include information on the methods and properties available (most of the text is taken from the amqp xml spec).
> 
> msg.get("message_properties").userid lets you get at the userid (I believe msg["message_properties"].userid would do the same.
> 
> Btw, you may also want to look at the higher level api in qpid.messaging. It aims to abstract a lot of the protocol details making it easier to use and more future proof.
> 
>> 
>> Am 15.02.2010 um 10:55 schrieb Cajus Pollmeier:
>> 
>>> Hi,
>>> 
>>> sorry for the badly chosen subject - I'm new to the world of amqp/qpid and I'm playing with the python stuff in the moment. While digging around, I ran into a couple of questions:
>>> 
>>> The python examples offer a .body element for messages, where I can get the message body. How can I  find out which SASL user sent the message?
>>> 
>>> Alternatively: for qpid, there's an ACL module. I'm authenticating against LDAP and I'd like to use dynamic groups in order to define ACLs depending on a small number of groups. In my case, I'd like to store groups inside of my LDAP tree and not statically defined in my qpid policy file. Is it possible to get this kind of behavior without creating an additional ACL module?
>>> 
>>> And one python thingie: what would be the preferred way to use a python library inside a threaded environment? I've seen that there's a twisted integrated non qpid library for that, but I can't get it up and running with qpid.
>>> 
>>> Thanks,
>>> Cajus
>>> ---------------------------------------------------------------------
>>> Apache Qpid - AMQP Messaging Implementation
>>> Project:      http://qpid.apache.org
>>> Use/Interact: mailto:users-subscribe@qpid.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project:      http://qpid.apache.org
>> Use/Interact: mailto:users-subscribe@qpid.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
> 


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Getting started...

Posted by Gordon Sim <gs...@redhat.com>.
On 02/15/2010 05:52 PM, Cajus Pollmeier wrote:
> Hmm. Looks like the specs declare an user-id in the message-properties. The python docs don't tell me much about session.message_properties() and possible methods.
>
> Is there a way to get it?

You can get information on the various properties using pythons help 
mechanism and an interactive python session. (import qpid.session, then 
help(qpid.session.Session)). That will include information on the 
methods and properties available (most of the text is taken from the 
amqp xml spec).

msg.get("message_properties").userid lets you get at the userid (I 
believe msg["message_properties"].userid would do the same.

Btw, you may also want to look at the higher level api in 
qpid.messaging. It aims to abstract a lot of the protocol details making 
it easier to use and more future proof.

>
> Am 15.02.2010 um 10:55 schrieb Cajus Pollmeier:
>
>> Hi,
>>
>> sorry for the badly chosen subject - I'm new to the world of amqp/qpid and I'm playing with the python stuff in the moment. While digging around, I ran into a couple of questions:
>>
>> The python examples offer a .body element for messages, where I can get the message body. How can I  find out which SASL user sent the message?
>>
>> Alternatively: for qpid, there's an ACL module. I'm authenticating against LDAP and I'd like to use dynamic groups in order to define ACLs depending on a small number of groups. In my case, I'd like to store groups inside of my LDAP tree and not statically defined in my qpid policy file. Is it possible to get this kind of behavior without creating an additional ACL module?
>>
>> And one python thingie: what would be the preferred way to use a python library inside a threaded environment? I've seen that there's a twisted integrated non qpid library for that, but I can't get it up and running with qpid.
>>
>> Thanks,
>> Cajus
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project:      http://qpid.apache.org
>> Use/Interact: mailto:users-subscribe@qpid.apache.org
>>
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Getting started...

Posted by Cajus Pollmeier <ca...@naasa.net>.
Hmm. Looks like the specs declare an user-id in the message-properties. The python docs don't tell me much about session.message_properties() and possible methods.

Is there a way to get it?

Am 15.02.2010 um 10:55 schrieb Cajus Pollmeier:

> Hi,
> 
> sorry for the badly chosen subject - I'm new to the world of amqp/qpid and I'm playing with the python stuff in the moment. While digging around, I ran into a couple of questions:
> 
> The python examples offer a .body element for messages, where I can get the message body. How can I  find out which SASL user sent the message?
> 
> Alternatively: for qpid, there's an ACL module. I'm authenticating against LDAP and I'd like to use dynamic groups in order to define ACLs depending on a small number of groups. In my case, I'd like to store groups inside of my LDAP tree and not statically defined in my qpid policy file. Is it possible to get this kind of behavior without creating an additional ACL module?
> 
> And one python thingie: what would be the preferred way to use a python library inside a threaded environment? I've seen that there's a twisted integrated non qpid library for that, but I can't get it up and running with qpid.
> 
> Thanks,
> Cajus
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
> 


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org