You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by "Flores, Paul A." <PA...@SAIC.COM> on 2016/07/14 17:55:31 UTC

RE: C++ API Next Receiver Questions- More

Ted,

Thanks for the reply.

Paul


Questions remain.

In the C++ API documentation it is unclear how to set up prefetching.  Is it related to setting the receiver capacity?  Is there an example?

With prefetch setup does a fetch return more than one message at a time from a specific queue?

________________________________________
From: Ted Ross [tross@redhat.com]
Sent: Thursday, July 14, 2016 12:25 PM
To: users@qpid.apache.org
Subject: Re: C++ API Next Receiver Questions

On 07/14/2016 12:22 PM, Flores, Paul A. wrote:
> Hi,
>
>
>
> At client.
>
>
>
> Basic questions that I have answered but want to double check.
>
>
>
> Can I get some verification/clarification.
>
>
>
> How does pre-fetch influence these questions/answers?
>
>
>
> Thanks for the feedback it is appreciated.
>
>
>
> Paul
>
>
>
> Premise:
>
> Given:
>
>     a Connection with a Session. (Connection to Session 1:1?)
>
>     a Session with more than 1 Receiver. (Session to Receiver 1:N)
>
>     Default configuration specifying pre-fetch
>
>     Each Receiver has a queue. (Receiver to Queue 1:1)
>
>
>
> Questions:
>
> 1) Does Next Receiver "cycle" through receivers?
>
>     Given:
>
>         Three Receivers: A,B and C
>
>         Receivers A and C have message on their respective queues (Alpha and Charlie respectively)
>
> After a fetch on Receiver A (messages remain on Alpha)
>
> Will a call to Next Receiver return Receiver C?

NextReceiver is not directly concerned with whether there are messages
on the queue, but whether there are messages that have been delivered on
the receiver to the client (based on prefetch).  So, yes, NextReceiver
will eventually return C even though messages remain on Alpha.

>
>
>
> 2) Does Next Receiver always return the Receiver with messages on its queue?
>
>     Given:
>
>         Three Receivers: A,B and C
>
>         Receiver B's queue (Bravo) has messages while the other Receiver queues are empty
>
> After a fetch on Receiver B (messages remain on Bravo)
>
> Will a call to Next Receiver return Receiver B?

NextReceiver _only_ returns receivers on which messages have been
prefetched.  So, yes, NextReceiver will return B in this case.  Once all
the messages on Bravo are delivered (even if they remain), NextReceiver
will block because there is no receiver with prefetched deliveries to
return.

Note that if there is no prefetch on any of the receivers, NextReceiver
will never return a receiver.

>
>
>
>
>
>
> ________________________________
>
> This communication (including any attachments) may contain information that is proprietary, confidential or exempt from disclosure. If you are not the intended recipient, please note that further dissemination, distribution, use or copying of this communication is strictly prohibited. Anyone who received this message in error should notify the sender immediately by telephone or by return email and delete it from his or her computer.
>

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

________________________________

This communication (including any attachments) may contain information that is proprietary, confidential or exempt from disclosure. If you are not the intended recipient, please note that further dissemination, distribution, use or copying of this communication is strictly prohibited. Anyone who received this message in error should notify the sender immediately by telephone or by return email and delete it from his or her computer.

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


Re: C++ API Next Receiver Questions- More

Posted by Ted Ross <tr...@redhat.com>.
On 07/14/2016 01:55 PM, Flores, Paul A. wrote:
> Ted,
>
> Thanks for the reply.
>
> Paul
>
>
> Questions remain.
>
> In the C++ API documentation it is unclear how to set up prefetching.  Is it related to setting the receiver capacity?  Is there an example?
>
> With prefetch setup does a fetch return more than one message at a time from a specific queue?

Prefetch is controlled by setting the receiver's capacity.  The capacity 
is the maximum number of messages that may be delivered by the peer 
(broker) and stored locally on the client awaiting a fetch.

Fetch will return at most one message per call.

Prefetch allows the broker to deliver multiple messages along the 
receiver to the client in batches.  A capacity of greater that one 
allows the broker to operate more efficiently and improves message 
throughput.  The reason for this is that the broker's threading model 
assigns a thread to process a single connection at a time.  If the 
connection is writable (i.e. not congested outbound from the broker), it 
is more efficient to send a batch of messages from the same queue than 
to send only one.

>
> ________________________________________
> From: Ted Ross [tross@redhat.com]
> Sent: Thursday, July 14, 2016 12:25 PM
> To: users@qpid.apache.org
> Subject: Re: C++ API Next Receiver Questions
>
> On 07/14/2016 12:22 PM, Flores, Paul A. wrote:
>> Hi,
>>
>>
>>
>> At client.
>>
>>
>>
>> Basic questions that I have answered but want to double check.
>>
>>
>>
>> Can I get some verification/clarification.
>>
>>
>>
>> How does pre-fetch influence these questions/answers?
>>
>>
>>
>> Thanks for the feedback it is appreciated.
>>
>>
>>
>> Paul
>>
>>
>>
>> Premise:
>>
>> Given:
>>
>>     a Connection with a Session. (Connection to Session 1:1?)
>>
>>     a Session with more than 1 Receiver. (Session to Receiver 1:N)
>>
>>     Default configuration specifying pre-fetch
>>
>>     Each Receiver has a queue. (Receiver to Queue 1:1)
>>
>>
>>
>> Questions:
>>
>> 1) Does Next Receiver "cycle" through receivers?
>>
>>     Given:
>>
>>         Three Receivers: A,B and C
>>
>>         Receivers A and C have message on their respective queues (Alpha and Charlie respectively)
>>
>> After a fetch on Receiver A (messages remain on Alpha)
>>
>> Will a call to Next Receiver return Receiver C?
>
> NextReceiver is not directly concerned with whether there are messages
> on the queue, but whether there are messages that have been delivered on
> the receiver to the client (based on prefetch).  So, yes, NextReceiver
> will eventually return C even though messages remain on Alpha.
>
>>
>>
>>
>> 2) Does Next Receiver always return the Receiver with messages on its queue?
>>
>>     Given:
>>
>>         Three Receivers: A,B and C
>>
>>         Receiver B's queue (Bravo) has messages while the other Receiver queues are empty
>>
>> After a fetch on Receiver B (messages remain on Bravo)
>>
>> Will a call to Next Receiver return Receiver B?
>
> NextReceiver _only_ returns receivers on which messages have been
> prefetched.  So, yes, NextReceiver will return B in this case.  Once all
> the messages on Bravo are delivered (even if they remain), NextReceiver
> will block because there is no receiver with prefetched deliveries to
> return.
>
> Note that if there is no prefetch on any of the receivers, NextReceiver
> will never return a receiver.
>
>>
>>
>>
>>
>>
>>
>> ________________________________
>>
>> This communication (including any attachments) may contain information that is proprietary, confidential or exempt from disclosure. If you are not the intended recipient, please note that further dissemination, distribution, use or copying of this communication is strictly prohibited. Anyone who received this message in error should notify the sender immediately by telephone or by return email and delete it from his or her computer.
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
> ________________________________
>
> This communication (including any attachments) may contain information that is proprietary, confidential or exempt from disclosure. If you are not the intended recipient, please note that further dissemination, distribution, use or copying of this communication is strictly prohibited. Anyone who received this message in error should notify the sender immediately by telephone or by return email and delete it from his or her computer.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>

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