Bug 461572 - Simpler examples in the Tutorial
Simpler examples in the Tutorial
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: Documentation (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jonathan Robie
Kim van der Riet
: Documentation
Depends On:
  Show dependency treegraph
Reported: 2008-09-09 04:34 EDT by David Sommerseth
Modified: 2016-05-22 19:27 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-11-05 14:36:40 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
simple qpid client (3.96 KB, text/plain)
2008-09-09 04:34 EDT, David Sommerseth
no flags Details

  None (edit)
Description David Sommerseth 2008-09-09 04:34:35 EDT
Created attachment 316158 [details]
simple qpid client

The examples in the tutorial jumps to a pretty advanced level quite quickly.  I would suggest to make also space for some really small and easy level examples as well, to get started and get familiar with the concept.

I've written a small program used for testing a bug, and this could most probably be modified and adjusted to fit into such an example.
Comment 1 Jonathan Robie 2008-09-18 10:47:57 EDT
When I compare your program to the first program in the tutorial, I think the main difference is that you use the default exchange, which saves a few lines of code, but actually not that many. 

The advantage of the approach I currently take is that the code reflects the basic concepts people need to learn. So your program avoids these lines:

session.exchangeBind(arg::exchange="amq.direct", arg::queue="message_queue", arg::bindingKey="routing_key");

But these lines are central to understanding the relationship between exchanges, queues, and bindings. Your program uses the default exchange, so it does not need these lines, but the tutorial would still have to explain why the messages in your program somehow get delivered to the queue. I would have to explain the default exchange and the bindings it uses in the very first example, without any explicit syntax to point to.

You also save an argument in messageTransfer() by not specifying the exchange to which the message is sent, so it defaults to the default exchange. The first example in the tutorial specifies the direct exchange:

session.messageTransfer(arg::content=message, arg::destination="amq.direct");

For reading from the queue, your program is *definitely* simpler. The current tutorial code starts with a message listener rather than SubscriptionManager.get() or perhaps a local queue. Modifying the first example to use one of these simpler methods might make sense, but I would still want to introduce listener.cpp as part of the initial direct example, because most of the time, we really do want people to read using either a message listener or a local queue.


Note You need to log in before you can comment on or make changes to this bug.