|
Examples
Examples of using pyactivemq.
Sending pickled Python objectsThis example shows how to send pickled Python objects (in this case, NumPy arrays). http://code.google.com/p/pyactivemq/source/browse/trunk/src/examples/numpypickle.py Expected output: pickled 1000 arrays, each 80000 bytes, in 4.179399 seconds (18.2548 MiB/s) Asynchronous message listenerThe latest code in trunk supports asynchronous message listeners. http://code.google.com/p/pyactivemq/source/browse/trunk/src/examples/asynclistener.py Expected output (varies due to the threads associated with consumers): consumer0 got: hello0 consumer1 got: hello0 consumer2 got: hello0 consumer0 got: hello1 consumer2 got: hello1 consumer1 got: hello1 ... consumer0 got: hello97 consumer0 got: hello98 consumer0 got: hello99 Durable subscriptionThis example corresponds to the DurableSubscriberExample.java described in the Java EE 5 Tutorial in Chapter 31 under Creating Robust JMS Applications. http://code.google.com/p/pyactivemq/source/browse/trunk/src/examples/DurableSubscriberExample.py Expected output: Starting subscriber PUBLISHER: Publishing message: Here is a message 1 PUBLISHER: Publishing message: Here is a message 2 PUBLISHER: Publishing message: Here is a message 3 SUBSCRIBER: Reading Message: Here is a message 1 SUBSCRIBER: Reading Message: Here is a message 2 SUBSCRIBER: Reading Message: Here is a message 3 Closing subscriber PUBLISHER: Publishing message: Here is a message 4 PUBLISHER: Publishing message: Here is a message 5 PUBLISHER: Publishing message: Here is a message 6 Starting subscriber SUBSCRIBER: Reading Message: Here is a message 4 SUBSCRIBER: Reading Message: Here is a message 5 SUBSCRIBER: Reading Message: Here is a message 6 Closing subscriber |
► Sign in to add a comment
Do you have samples of twisted integration?
I built version 0.1.0 with activemq-2.2.5, python 2.5 and apr-1.3.3 and the built went ok. When I try to import pyactivemq ... I get undefined symbol: PyUnicodeUCS4_FromEncodedObject?
BTW: python 2.4 works.
What kind of Twisted integration example would you like to see?
Tried the asynclistener example with pyactivemq-0.1.0, activemq-cpp-2.2.1 and libboost-python1.38.0 on the ubuntu 9.10 and I got the following error :
Traceback (most recent call last):
Boost.Python.ArgumentError?: Python argument types in did not match C++ signature:Any idea?