You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by TLFox <ti...@googlemail.com> on 2008/05/28 19:21:55 UTC
Persistent messages sent non blocking
I have been trying out QPID java M2 with the BDB persistent store, and the
JMS java client M2.
When sending small transactions each containing only one persistent message
send, I can get a rate of a few hundred transactions per sec, which is
around what I would expect.
However when I send a stream of persistent messages non transacted I get a
much higher send rate (several thousand messages per sec).
I would expect the two rates to be similar since they both involve
persistence of a single JMS message.
It strikes me that the JMS client must be sending the persistent non
transacted messages non blocking. I.e. it is sending the next one without
waiting for confirmation from the server that the last one has been
persisted (which involves a network round trip).
If JMS semantics are to be followed, then the JMS client must wait for such
confirmation before sending the next one (in the same way as it must wait
for commit to hit the server and a response to be received).
Can someone advise what is happening here? Perhaps I have misconfigured
something?
--
View this message in context: http://www.nabble.com/Persistent-messages-sent-non-blocking-tp17517786p17517786.html
Sent from the Qpid Developers mailing list archive at Nabble.com.
Re: Persistent messages sent non blocking
Posted by Robert Greig <ro...@gmail.com>.
> I have been trying out QPID java M2 with the BDB persistent store, and the
> JMS java client M2.
I meant to add that I recommend using M2.1, or better still build from
the M2.x branch which contains a significant performance improvement
in this area (done post release of M2.1).
RG
Re: Persistent messages sent non blocking
Posted by TLFox <ti...@googlemail.com>.
TLFox wrote:
>
> Are there any workarounds here?
>
>
In case you're interested, I have managed to work around this to a certain
level by manually throttling the producer on the client code that calls the
producer. I have a nice class that will automatically throttle given a
specified rate - it's very accurate based on the token bucket limiter
algorithm.
I started the throttle rate low (1000 msgs/sec) and gradually increased it
until qpid got into a "non steady state" (i.e. one that would eventually
lead to OOM), where the consumer can no longer consume messages at the rate
the producer produces.
This was about 5000 msgs / sec IIRC on my client and server setup (pretty
basic machines) (1K messages), using M2.1, non persistent
--
View this message in context: http://www.nabble.com/Persistent-messages-sent-non-blocking-tp17517786p17537885.html
Sent from the Qpid Developers mailing list archive at Nabble.com.
Re: Persistent messages sent non blocking
Posted by Carl Trieloff <cc...@redhat.com>.
Carl Trieloff wrote:
>>
>>
>> Right now QPID is falling at the first hurdle. From what your saying it
>> seems such a simple example is not possible with QPID unless i manually
>> throttle the producer, which is, not to be a fine point on it, less than
>> ideal.
>>
>> Are there any workarounds here?
>>
>>
> Yea, what happens is that MINA buffers faster than the wire... there
> are some options
> in MINA that can be set to manage the io depth. Something we should
> probably set as
> default.
>
> ? -Dprotectio
>
> In the 0-10 client you can also set ?qpid.read.buffer.limit and
> qpid.write.buffer.limit Martin
> or one someone else on the list should be able to confirm if these can
> be set on M2.x
>
> Carl.
>
I have just been correct on IM that -Dprotectio is also a trunk thing.
Carl.
Re: Persistent messages sent non blocking
Posted by Carl Trieloff <cc...@redhat.com>.
>
>
> Right now QPID is falling at the first hurdle. From what your saying it
> seems such a simple example is not possible with QPID unless i manually
> throttle the producer, which is, not to be a fine point on it, less than
> ideal.
>
> Are there any workarounds here?
>
>
Yea, what happens is that MINA buffers faster than the wire... there are
some options
in MINA that can be set to manage the io depth. Something we should
probably set as
default.
? -Dprotectio
In the 0-10 client you can also set ?qpid.read.buffer.limit and
qpid.write.buffer.limit Martin
or one someone else on the list should be able to confirm if these can
be set on M2.x
Carl.
Re: Persistent messages sent non blocking
Posted by TLFox <ti...@googlemail.com>.
Robert Godfrey wrote:
>
> You are correct, there is no producer side flow control. We are
> looking to shortly put in flow control on the Java Broker
> (https://issues.apache.org/jira/browse/QPID-942), but this is a very
> blunt instrument in AMQP0-8/0-9 (another thing that we have fedback
> into AMQP0-10).
>
> -- Rob
>
>
Hmm, I am basically trying to run a simple JMS application which
a) Send messages via a non transacted producer
b) Consumes messages via a non transacted consumer
And see what the max throughput that Qpid can support.
I.e. Pretty much the simplest JMS example you can think of
Right now QPID is falling at the first hurdle. From what your saying it
seems such a simple example is not possible with QPID unless i manually
throttle the producer, which is, not to be a fine point on it, less than
ideal.
Are there any workarounds here?
--
View this message in context: http://www.nabble.com/Persistent-messages-sent-non-blocking-tp17517786p17535430.html
Sent from the Qpid Developers mailing list archive at Nabble.com.
Re: Persistent messages sent non blocking
Posted by Robert Godfrey <ro...@gmail.com>.
2008/5/29 TLFox <ti...@googlemail.com>:
>
>
>
> TLFox wrote:
>>
>>
>> If BDB is actually synching but the client is sending at such a high rate,
>> this would imply to me that either producer flow control is not
>> implemented in qpid, or the producer window size is set to a very large
>> value.
>>
>> I also notice the server quickly OOMs at this sustained rate.
>>
>>
>
> More on this:
>
> I have also tried with M2.1 Java (with in memory store only since can't
> build the bridging jar at this point).
>
> Using the Java client I have one producer - non transacted, non persistent,
> and one consumer, auto_ack.
>
> I sent messages as fast as I can, the consumer receives about 5000 before
> hanging, the producer then appears to continue sending messages at a high
> rate, before the server runs out of memory.
>
> Is this to be expected? Is there any way of enabling producer flow control.
>
> At the moment the only stable producer/consumer scenario i can get with 2.0
> or 2.1 is when using transactions, performance is low, but it doesn't OOM,
> probably I guess because transactions are sent blocking so doesn't have a
> chance to overwhelm the server.
>
> Any ideas?
>
You are correct, there is no producer side flow control. We are
looking to shortly put in flow control on the Java Broker
(https://issues.apache.org/jira/browse/QPID-942), but this is a very
blunt instrument in AMQP0-8/0-9 (another thing that we have fedback
into AMQP0-10).
-- Rob
Re: Persistent messages sent non blocking
Posted by TLFox <ti...@googlemail.com>.
TLFox wrote:
>
>
> If BDB is actually synching but the client is sending at such a high rate,
> this would imply to me that either producer flow control is not
> implemented in qpid, or the producer window size is set to a very large
> value.
>
> I also notice the server quickly OOMs at this sustained rate.
>
>
More on this:
I have also tried with M2.1 Java (with in memory store only since can't
build the bridging jar at this point).
Using the Java client I have one producer - non transacted, non persistent,
and one consumer, auto_ack.
I sent messages as fast as I can, the consumer receives about 5000 before
hanging, the producer then appears to continue sending messages at a high
rate, before the server runs out of memory.
Is this to be expected? Is there any way of enabling producer flow control.
At the moment the only stable producer/consumer scenario i can get with 2.0
or 2.1 is when using transactions, performance is low, but it doesn't OOM,
probably I guess because transactions are sent blocking so doesn't have a
chance to overwhelm the server.
Any ideas?
--
View this message in context: http://www.nabble.com/Persistent-messages-sent-non-blocking-tp17517786p17534849.html
Sent from the Qpid Developers mailing list archive at Nabble.com.
Re: Persistent messages sent non blocking
Posted by TLFox <ti...@googlemail.com>.
Robert Godfrey wrote:
>
>
> We synch on every message received (we do write-combine the synchs
> when there are many different threads receiving messages
> "simultaneously"). However what you are more likely seeing is that
> the client buffers writes before putting them on the wire. The broker
> will not be processing at 16K message/s
>
> -- Rob
>
>
There is only one producer and consumer so I doubt this is due to write
combines.
If BDB is actually synching but the client is sending at such a high rate,
this would imply to me that either producer flow control is not implemented
in qpid, or the producer window size is set to a very large value.
I also notice the server quickly OOMs at this sustained rate.
--
View this message in context: http://www.nabble.com/Persistent-messages-sent-non-blocking-tp17517786p17530853.html
Sent from the Qpid Developers mailing list archive at Nabble.com.
Re: Persistent messages sent non blocking
Posted by Robert Godfrey <ro...@gmail.com>.
2008/5/28 TLFox <ti...@googlemail.com>:
>
> There is one other thing I don't quite understand.
>
> The persistent message send rate with qpid i get is about 16K messages /
> sec.
>
> I understand now that the messages are sent asynchronously, but I'm thinking
> this must also imply that, not only are the messages sent asynchronously but
> also they are not synced into BDB on every message (I'm guessing you're just
> writing into the BDB in memory cache), since I know there's know way BDB JE
> can do 16K syncs per sec.
We synch on every message received (we do write-combine the synchs
when there are many different threads receiving messages
"simultaneously"). However what you are more likely seeing is that
the client buffers writes before putting them on the wire. The broker
will not be processing at 16K message/s
-- Rob
Re: Persistent messages sent non blocking
Posted by TLFox <ti...@googlemail.com>.
There is one other thing I don't quite understand.
The persistent message send rate with qpid i get is about 16K messages /
sec.
I understand now that the messages are sent asynchronously, but I'm thinking
this must also imply that, not only are the messages sent asynchronously but
also they are not synced into BDB on every message (I'm guessing you're just
writing into the BDB in memory cache), since I know there's know way BDB JE
can do 16K syncs per sec.
So not only do you need to allow option for persistent messages to be sent
synchronously, but you also need an option to tell the server to sync those
persistent non transactional messages after each one.
--
View this message in context: http://www.nabble.com/Persistent-messages-sent-non-blocking-tp17517786p17519906.html
Sent from the Qpid Developers mailing list archive at Nabble.com.
Re: Persistent messages sent non blocking
Posted by TLFox <ti...@googlemail.com>.
Robert Greig wrote:
>
>
> I was trying to come up with something you could do if you are
> determined not to use transactions. I wouldn't do it - I would use
> transactions for this use case.
>
> RG
>
>
Ok fair enough. But the point is the JMS spec requires this to be possible
by *just using the JMS API*
--
View this message in context: http://www.nabble.com/Persistent-messages-sent-non-blocking-tp17517786p17519371.html
Sent from the Qpid Developers mailing list archive at Nabble.com.
Re: Persistent messages sent non blocking
Posted by Robert Greig <ro...@gmail.com>.
2008/5/28 TLFox <ti...@googlemail.com>:
>
> I hope you realise what you suggested is pretty silly, I can pretend you
> didn't say it if you want?
I was trying to come up with something you could do if you are
determined not to use transactions. I wouldn't do it - I would use
transactions for this use case.
RG
Re: Persistent messages sent non blocking
Posted by TLFox <ti...@googlemail.com>.
Robert Greig wrote:
>
> 2008/5/28 TLFox <ti...@googlemail.com>:
>
> I suppose it depends how you define "careful programming". You can
> insert a synchronous operation (in protocol terms) after the publish.
> For example, if you cast your javax.jms.Session to an AMQSession and
> call getQueueDepth(Destination) that would do the trick. There are
> other options - for example, declare the destination.
>
> RG
>
>
The JMS spec concerns the JMS API nothing more.What you have described is
outside the JMS API.
Of course it's possible to hack it someway or other using some other tool.
If we want to get really silly I could intercept the program image and
change the bytes, or use some AOP tool to insert my own code, but that
applies to any system.
I hope you realise what you suggested is pretty silly, I can pretend you
didn't say it if you want?
--
View this message in context: http://www.nabble.com/Persistent-messages-sent-non-blocking-tp17517786p17518931.html
Sent from the Qpid Developers mailing list archive at Nabble.com.
Re: Persistent messages sent non blocking
Posted by Robert Greig <ro...@gmail.com>.
2008/5/28 TLFox <ti...@googlemail.com>:
> "Non-transactional production and consumption can also achieve
> the same level of assurance; however, this requires careful programming."
>
> Please explain how it is possible to achieve the above paragraph in QPID
> without using transactions? With QPID since persistent messages are always
> sent asynchronously it will never be possible to provide the same level of
> assurance no matter how careful you program. Therefore QPID does not comply
> with the above statement from the spec.
I suppose it depends how you define "careful programming". You can
insert a synchronous operation (in protocol terms) after the publish.
For example, if you cast your javax.jms.Session to an AMQSession and
call getQueueDepth(Destination) that would do the trick. There are
other options - for example, declare the destination.
RG
Re: Persistent messages sent non blocking
Posted by TLFox <ti...@googlemail.com>.
Robert Greig wrote:
>
> Yes, we recommend with M2.x that users use transactions to achieve
> this behaviour. As I said, I think this is suboptimal too.
>
> RG
>
>
Sure, you can get once and only once by using transactions, but we're
talking about the non transactional, persistent case here.
The JMS spec is explicit in stating that you can get once and only once
delivery without using transactions as long as the message is persistent.
See Section 4.10, note how it does not mention transactions:
"Most clients should use producers that produce PERSISTENT messages. This
insures once-and-only-once message delivery for messages delivered from a
queue or a durable subscription."
Later on it is more explicit:
"Non-transactional production and consumption can also achieve
the same level of assurance; however, this requires careful programming."
Please explain how it is possible to achieve the above paragraph in QPID
without using transactions? With QPID since persistent messages are always
sent asynchronously it will never be possible to provide the same level of
assurance no matter how careful you program. Therefore QPID does not comply
with the above statement from the spec.
--
View this message in context: http://www.nabble.com/Persistent-messages-sent-non-blocking-tp17517786p17518505.html
Sent from the Qpid Developers mailing list archive at Nabble.com.
Re: Persistent messages sent non blocking
Posted by Robert Greig <ro...@gmail.com>.
2008/5/28 TLFox <ti...@googlemail.com>:
> Section 4.10 of the spec states:
>
> "Most clients should use producers that produce PERSISTENT messages. This
> insures once-and-only-once message delivery for messages delivered from a
> queue or a durable subscription."
The section that was used to justify requiring transactions was later
in 4.10 of the JMS spec:
"It is expected that important messages will be produced with a
PERSISTENT delivery
mode within a transaction and will be consumed within a transaction
from a nontemporary
queue or a durable subscription.
When this is done, applications have the highest level of assurance that a
message has been properly produced, reliably delivered, and accurately
consumed. Non-transactional production and consumption can also achieve
the same level of assurance; however, this requires careful programming."
> If a user has no way of guaranteeing that a message ever gets to the queue
> then it has no way of ensuring once and only once
Yes, we recommend with M2.x that users use transactions to achieve
this behaviour. As I said, I think this is suboptimal too.
RG
Re: Persistent messages sent non blocking
Posted by TLFox <ti...@googlemail.com>.
Robert Greig wrote:
>
>
> No, the JMS specification does not mandate this.
>
> However I agree this is annoying (it is a result of the behaviour of
> the underlying AMQP protocol version implemented by Qpid M2, since
> publish is not a synchronous operation). I believe that the later
> version of the protocol can support proper guaranteed delivery without
> requiring transactions - maybe someone who worked on the M3 Java
> client can let us know whether it supports both modes?
>
> RG
>
>
Thanks Robert for your quick reply.
Although I have to disagree with your interpretation of the JMS 1.1 spec.
Section 4.10 of the spec states:
"Most clients should use producers that produce PERSISTENT messages. This
insures once-and-only-once message delivery for messages delivered from a
queue or a durable subscription."
Once and once delivery means if the server fails no persistent messages can
be lost.
After the call to send() has returned the user should be guaranteed of once
and only once delivery since they are using persistent messages.
However if you send asynchronously, then there is a window between the call
to send() returning and the messaging actually being persisted, during which
if the server fails, the message will be lost.
If a user has no way of guaranteeing that a message ever gets to the queue
then it has no way of ensuring once and only once
--
View this message in context: http://www.nabble.com/Persistent-messages-sent-non-blocking-tp17517786p17518228.html
Sent from the Qpid Developers mailing list archive at Nabble.com.
Re: Persistent messages sent non blocking
Posted by Rajith Attapattu <ra...@gmail.com>.
On Wed, May 28, 2008 at 4:09 PM, Robert Greig <ro...@gmail.com>
wrote:
> 2008/5/28 Rajith Attapattu <ra...@gmail.com>:
>
> > You can do this in the trunk client while using only the JMS API.
> > If you know your message sizes (payload) then you can set
> > -Dmessage_size_before_sync=x and then it will issue a sync after that
> amount
> > of bytes are transfered.
>
> OK, but I think most users will think in terms of messages rather than
> bytes? Did you add this based on a real user requirement?
>
This was added for a completely different reason.
That is to control our replay buffer and avoid memory issues.
I just mentioned this as a possible option.
I totally agree that the option below is the one that makes more sense.
> > This will of course not be effective if you have varying message sizes.
> > We could easily add a jvm argument to track messages. Ex
> > Dmessage_count_before_sync=x.
> > Setting that to 1 will give you what you want.
> > You could also do this per connection or destination by specifying it as
> an
> > option.
>
> I think we'd want to add this.
>
> > There was also some discussion on making the session entirely sync or
> async
> > based on an argument.
> > In such a case every AMQP command will be synchrnous. I think C++ client
> > already has this option (or trying to add it).
> > Maybe we could do this for JMS folks who want that kinda behaviour by
> > specifying a jvm argument or connection argument.
>
> Maybe, I think we want to have enough flexibility to enable users to
> tune bits they want while having sensible defaults. Having all sync or
> all async may not be what people want - for example I can see that
> people will want sync publish but async ack since most people design
> their systems (in my experience) for at least once message delivery.
I suggested this as a convinience for some people you want everything
synchronous.
The default should always be async.
This is in addition to the above I suggested.
>
>
> RG
>
--
Regards,
Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/
Re: Persistent messages sent non blocking
Posted by Robert Greig <ro...@gmail.com>.
2008/5/28 Rajith Attapattu <ra...@gmail.com>:
> You can do this in the trunk client while using only the JMS API.
> If you know your message sizes (payload) then you can set
> -Dmessage_size_before_sync=x and then it will issue a sync after that amount
> of bytes are transfered.
OK, but I think most users will think in terms of messages rather than
bytes? Did you add this based on a real user requirement?
> This will of course not be effective if you have varying message sizes.
> We could easily add a jvm argument to track messages. Ex
> Dmessage_count_before_sync=x.
> Setting that to 1 will give you what you want.
> You could also do this per connection or destination by specifying it as an
> option.
I think we'd want to add this.
> There was also some discussion on making the session entirely sync or async
> based on an argument.
> In such a case every AMQP command will be synchrnous. I think C++ client
> already has this option (or trying to add it).
> Maybe we could do this for JMS folks who want that kinda behaviour by
> specifying a jvm argument or connection argument.
Maybe, I think we want to have enough flexibility to enable users to
tune bits they want while having sensible defaults. Having all sync or
all async may not be what people want - for example I can see that
people will want sync publish but async ack since most people design
their systems (in my experience) for at least once message delivery.
RG
Re: Persistent messages sent non blocking
Posted by Rajith Attapattu <ra...@gmail.com>.
On Wed, May 28, 2008 at 2:21 PM, Robert Greig <ro...@gmail.com>
wrote:
> 2008/5/28 Robert Godfrey <ro...@gmail.com>:
>
> > It is, indeed, a major omission of AMQP 0-8 / 0-9 that there is no
> > synchronous publish method in the protocol. This is rectified in
> > 0-10.
>
> Rajith - is this an option in our trunk JMS client?
Tim/Rob,
You can do this in the trunk client while using only the JMS API.
If you know your message sizes (payload) then you can set
-Dmessage_size_before_sync=x and then it will issue a sync after that amount
of bytes are transfered.
It will then block until the broker signals completion. For the persistent
case this means it has hit the disk (C++ broker).
This will of course not be effective if you have varying message sizes.
We could easily add a jvm argument to track messages. Ex
Dmessage_count_before_sync=x.
Setting that to 1 will give you what you want.
You could also do this per connection or destination by specifying it as an
option.
There was also some discussion on making the session entirely sync or async
based on an argument.
In such a case every AMQP command will be synchrnous. I think C++ client
already has this option (or trying to add it).
Maybe we could do this for JMS folks who want that kinda behaviour by
specifying a jvm argument or connection argument.
So in summary it is certainly possible to do this while still using only JMS
API.
Regards,
Rajith
Re: Persistent messages sent non blocking
Posted by TLFox <ti...@googlemail.com>.
Robert Greig wrote:
>
> I would support the addition of a flag to make non-txnal sends
> synchronous but we have not had any user demand for this yet - many
> people have asked about this but have been happy to use txns.
>
> RG
>
>
You may not know until the shit hits the fan.
Joe user ports application from ANother messaging system to QPID.
After a crash they realise they have lost data. They scream "how can this
be, we are using persistent messages?". You explain to them that QPID does
not send persistent messages synchronously. They move to ANOtherSystem2. ;)
--
View this message in context: http://www.nabble.com/Persistent-messages-sent-non-blocking-tp17517786p17519470.html
Sent from the Qpid Developers mailing list archive at Nabble.com.
Re: Persistent messages sent non blocking
Posted by TLFox <ti...@googlemail.com>.
Robert Greig wrote:
>
>
> In a similar style, Tibco EMS does not by default do an fsync on
> publish (i.e. you cannot be sure it has reached storage). That
> presumably makes them look better in benchmarks where people don't
> read the docs. (There is a flag to make it fsync).
>
>
Yes activemq does the same too.
But at least they allow a flag so you can set it to true (sync on commit)
--
View this message in context: http://www.nabble.com/Persistent-messages-sent-non-blocking-tp17517786p17519493.html
Sent from the Qpid Developers mailing list archive at Nabble.com.
Re: Persistent messages sent non blocking
Posted by Robert Greig <ro...@gmail.com>.
2008/5/28 TLFox <ti...@googlemail.com>:
> What I would suggest is to add a flag so users can choose whether persistent
> messages are sent sync or async. That can default to async so you get better
> performance, but you need some way of letting users get normal JMS
> behaviour. Otherwise you risk losing customer data, since believe me, JMS
> users will assume persistent messages are sent sync (every other system I
> know does it this way).
In a similar style, Tibco EMS does not by default do an fsync on
publish (i.e. you cannot be sure it has reached storage). That
presumably makes them look better in benchmarks where people don't
read the docs. (There is a flag to make it fsync).
I would support the addition of a flag to make non-txnal sends
synchronous but we have not had any user demand for this yet - many
people have asked about this but have been happy to use txns.
RG
Re: Persistent messages sent non blocking
Posted by TLFox <ti...@googlemail.com>.
Robert Godfrey wrote:
>
>
> it's possible to pass the TCK :-)
>
I don't doubt it.
But the JMS TCK is far from an exhaustive test of compliance. It doesn't
test any failure conditions or concurrency issues for a start. :)
--
View this message in context: http://www.nabble.com/Persistent-messages-sent-non-blocking-tp17517786p17519409.html
Sent from the Qpid Developers mailing list archive at Nabble.com.
Re: Persistent messages sent non blocking
Posted by Robert Godfrey <ro...@gmail.com>.
2008/5/28 TLFox <ti...@googlemail.com>:
>
>
>
> Robert Greig wrote:
>>
>> 2008/5/28 Robert Godfrey <ro...@gmail.com>:
>>
>>> It is, indeed, a major omission of AMQP 0-8 / 0-9 that there is no
>>> synchronous publish method in the protocol. This is rectified in
>>> 0-10.
>>
>>
>>
>
> That does indeed seem a big omission.
>
> It basically means, that without using transactions, it's not possible to
> get once and only once delivery guarantee with 0.8 or 0.9, and by
> implication any JMS system built on top of AMQP 0.8/0.9 is not possible to
> be spec compliant.
it's possible to pass the TCK :-) But I agree, to be 100% compliant
with the spirit of the spec then you would want a synchronous publish
in the underlying protocol. I'm personally reluctant to add more qpid
"extensions" to AMQP0-8/0-9 when the machinery already exists in AMQP
0-10 which is what the trunk code / C++ broker implements.
> What I would suggest is to add a flag so users can choose whether persistent
> messages are sent sync or async. That can default to async so you get better
> performance, but you need some way of letting users get normal JMS
> behaviour. Otherwise you risk losing customer data, since believe me, JMS
> users will assume persistent messages are sent sync (every other system I
> know does it this way).
If we were to add an AMQP extension then I would assume we would also
aysnc publish to be turned on / off on a per producer basis...
-- Rob
Re: Persistent messages sent non blocking
Posted by TLFox <ti...@googlemail.com>.
Robert Greig wrote:
>
> 2008/5/28 Robert Godfrey <ro...@gmail.com>:
>
>> It is, indeed, a major omission of AMQP 0-8 / 0-9 that there is no
>> synchronous publish method in the protocol. This is rectified in
>> 0-10.
>
>
>
That does indeed seem a big omission.
It basically means, that without using transactions, it's not possible to
get once and only once delivery guarantee with 0.8 or 0.9, and by
implication any JMS system built on top of AMQP 0.8/0.9 is not possible to
be spec compliant.
What I would suggest is to add a flag so users can choose whether persistent
messages are sent sync or async. That can default to async so you get better
performance, but you need some way of letting users get normal JMS
behaviour. Otherwise you risk losing customer data, since believe me, JMS
users will assume persistent messages are sent sync (every other system I
know does it this way).
--
View this message in context: http://www.nabble.com/Persistent-messages-sent-non-blocking-tp17517786p17519034.html
Sent from the Qpid Developers mailing list archive at Nabble.com.
Re: Persistent messages sent non blocking
Posted by Robert Greig <ro...@gmail.com>.
2008/5/28 Robert Godfrey <ro...@gmail.com>:
> It is, indeed, a major omission of AMQP 0-8 / 0-9 that there is no
> synchronous publish method in the protocol. This is rectified in
> 0-10.
Rajith - is this an option in our trunk JMS client?
> I have many times been tempted to add a Basic.Publish-Sync extension
> to our AMQP implementation for this very purpose.
Yes, I agree it could be useful for people needing to work with third
party products or tools that expect this behaviour. Tim - is this a
showstopper for you? What is your use case?
RG
Re: Persistent messages sent non blocking
Posted by Robert Godfrey <ro...@gmail.com>.
> However I agree this is annoying (it is a result of the behaviour of
> the underlying AMQP protocol version implemented by Qpid M2, since
> publish is not a synchronous operation). I believe that the later
> version of the protocol can support proper guaranteed delivery without
> requiring transactions - maybe someone who worked on the M3 Java
> client can let us know whether it supports both modes?
>
It is, indeed, a major omission of AMQP 0-8 / 0-9 that there is no
synchronous publish method in the protocol. This is rectified in
0-10.
I have many times been tempted to add a Basic.Publish-Sync extension
to our AMQP implementation for this very purpose.
-- Rob
Re: Persistent messages sent non blocking
Posted by Robert Greig <ro...@gmail.com>.
2008/5/28 TLFox <ti...@googlemail.com>:
> It strikes me that the JMS client must be sending the persistent non
> transacted messages non blocking. I.e. it is sending the next one without
> waiting for confirmation from the server that the last one has been
> persisted (which involves a network round trip).
Yes, you are correct.
> If JMS semantics are to be followed, then the JMS client must wait for such
> confirmation before sending the next one (in the same way as it must wait
> for commit to hit the server and a response to be received).
No, the JMS specification does not mandate this.
However I agree this is annoying (it is a result of the behaviour of
the underlying AMQP protocol version implemented by Qpid M2, since
publish is not a synchronous operation). I believe that the later
version of the protocol can support proper guaranteed delivery without
requiring transactions - maybe someone who worked on the M3 Java
client can let us know whether it supports both modes?
RG
Re: Persistent messages sent non blocking
Posted by Robert Godfrey <ro...@gmail.com>.
2008/5/28 TLFox <ti...@googlemail.com>:
>
> Apologies for being a pain here, but there is yet another issue with treating
> persistent message sends as non transactional:
>
> This involves sending a persistent message to a JMS topic which has more
> than one durable subscriber.
>
> In such a case JMS mandates that the message reaches all the subscribers or
> none, i.e. it is transactional.
>
> If you treat it as non transactional, then, on server failure, you could end
> up with a situation where the message is in some subscriptions but not
> others!
>
AMQP treats subscriptions as a special type of queue. When you send a
message that is destined for many subscriptions it enqueues in every
queue within one BDB transaction; so it will reach all or none.
Hope this helps,
Rob
Re: Persistent messages sent non blocking
Posted by TLFox <ti...@googlemail.com>.
Apologies for being a pain here, but there is yet another issue with treating
persistent message sends as non transactional:
This involves sending a persistent message to a JMS topic which has more
than one durable subscriber.
In such a case JMS mandates that the message reaches all the subscribers or
none, i.e. it is transactional.
If you treat it as non transactional, then, on server failure, you could end
up with a situation where the message is in some subscriptions but not
others!
I.e. the user data is left in a inconsistent state.
--
View this message in context: http://www.nabble.com/Persistent-messages-sent-non-blocking-tp17517786p17520855.html
Sent from the Qpid Developers mailing list archive at Nabble.com.