gregory james marsh wrote:
I'd like to learn more about staging and using a "store." Could someone give me a quick primer and/or point to some sample code or documentation?

You need to have a store 'plugin' loaded. You can build such a plugin from the source here:

https://svn.jboss.org/repos/rhmessaging/store/trunk/cpp

Checkout the code, run bootstrap then ./configure --with-qpid-checkout=/path/to/qpid, then make. This produces msgstore.so which can be loaded by qpidd with --load-module.

As an example, I've started the C++ broker (M4-RC3) with all defaults. I'm not setting the staging-threshold (ie. I take the default 5M). I'm not using a store because I don't know how to use this (yet). I send a 5M message and here is how things play out on the consumer/subscriber:

  Message producer_msg;
  LocalQueue local_my_queue;
.
. // Open connection, session, subscription here
.
          producer_msg = local_my_queue.get();
.
.
.

I print out some info about producer_msg and this is what appears:

producer_msg.getMessageProperties().getContentLength()= 5000000
producer_msg.getData().size()= 0

So how would my consumer get that staged 5M content?

Unfortunately you can't! There was a bug in the code (fixed in latest RC [1]) that allowed the content to be 'released' even if there was no store (meaning it would not be retrievable). So either turn staging off explicitly (--staging-threshold 0) or use the latest RC if you don't have a store loaded.

I should again point out that at present staging is only used in the client->broker direction. When the broker sends messages to the client the full content ends up being loaded into memory before the message is delivered so I'm not sure its particularly valuable in its current form.

[1] http://people.apache.org/~rhs/qpid-M4-RC8/

Reply via email to