In the examples we have written for C++ and Python, the need to allocate credit 
explicitly in order to receive messages is one of the harder things to explain 
to beginners.

Consider the following code:

connection.open(host, port);
Session session =  connection.newSession();

session.messageSubscribe(arg::queue="message_queue", 
arg::destination="listener_destination");

//############## Gripe, gripe, grumble, grumble ....
session.messageFlow(arg::destination="listener_destination", arg::unit=0, 
arg::value=1);//messages ### Define a constant?
session.messageFlow(arg::destination="listener_destination", arg::unit=1, 
arg::value=0xFFFFFFFF);//bytes ###### Define a constant?

Listener listener(session, "listener_destination");
listener.listen();

I understand that in the future there will be constants for arg::unit, that 
helps some. But what would really help is a sensible default for credit, 
because beginners or people writing a first prototype probably do not know what 
values to set for these, and it would really be better to explain the concept 
of credit in later examples, not in the first (otherwise) simple examples.

Is there any reason these do not have sensible defaults that would allow people 
to receive messages without explicitly allocating credit? (Obviously, any 
explicit allocation would override these defaults.)

What guidelines should we give users for setting these values when they do 
explicitly allocate credit?

Jonathan


Reply via email to