|
| 1 | +Overview |
| 2 | +======== |
| 3 | + |
| 4 | +A number of examples are packaged with the source distribution and |
| 5 | +with the tests jar in the binary distribution. These examples vary in |
| 6 | +complexity from simple clients and servers through to complex test |
| 7 | +harnesses that are used for testing the RabbitMQ server. |
| 8 | + |
| 9 | +The source code for the examples can be found in the |
| 10 | +test/src/com/rabbitmq/examples directory of the source distribution. |
| 11 | + |
| 12 | + |
| 13 | +Running the Examples |
| 14 | +==================== |
| 15 | + |
| 16 | +The script runjava.sh or runjava.bat can be found in the top level |
| 17 | +directory of the binary distribution or in the scripts directory of |
| 18 | +the source distribution. |
| 19 | + |
| 20 | +This script can be used to run the examples. For instance, if you are |
| 21 | +using the binary distribution and if you have a RabbitMQ broker |
| 22 | +running and you open two shell or console windows you can test basic |
| 23 | +connectivity like this: |
| 24 | + |
| 25 | +shell-1$ ./runjava.sh com.rabbitmq.examples.SimpleConsumer |
| 26 | + |
| 27 | +shell-2$ ./runjava.sh com.rabbitmq.examples.SimpleProducer |
| 28 | + |
| 29 | +shell-1$ ./runjava.sh com.rabbitmq.examples.SimpleConsumer |
| 30 | +Message: the time is Fri Feb 26 08:28:58 GMT 2010 |
| 31 | + |
| 32 | +Running the examples from the source distribution requries two more |
| 33 | +preliminary steps: |
| 34 | + |
| 35 | +shell-1$ ant dist |
| 36 | + |
| 37 | +shell-1$ cd build/dist/ |
| 38 | + |
| 39 | +Now, the examples can be run exactly as detailed above. |
| 40 | + |
| 41 | +The more complex examples will require additional command line |
| 42 | +arguments and it is best to examine the source of the examples to |
| 43 | +determine what arguments are available. |
| 44 | + |
| 45 | +All examples live in the com.rabbitmq.examples package, so just add |
| 46 | +that package name to the examples described below to produce the full |
| 47 | +classname that is required as the first argument to the runjava |
| 48 | +script. |
| 49 | + |
| 50 | + |
| 51 | +Simple Examples |
| 52 | +=============== |
| 53 | + |
| 54 | +SimpleProducer - Sends a message to an exchange. |
| 55 | +SimpleConsumer - Reads a message from a queue. |
| 56 | +SimpleTopicProducer - Sends a message to a topic exchange. |
| 57 | +SimpleTopicConsumer - Reads a message from a topic queue. |
| 58 | +SendString - Send a string to an exchange. |
| 59 | +FileProducer - Sends a file to an exchange. |
| 60 | +FileConsumer - Reads a file from a queue. |
| 61 | +HelloClient - Performs a simple RPC call over AMQP. |
| 62 | +HelloServer - Acts as an RPC server over AMQP. |
| 63 | +HelloJsonClient - Performs a simple JSON-RPC call over AMQP. |
| 64 | +HelloJsonServer - Acts as a JSON-RPC server over AMQP. |
| 65 | +LogTail - Tails the server logs. |
| 66 | +SendString - Sends a user supplied message over AMQP. |
| 67 | + |
| 68 | + |
| 69 | +More Complex Examples |
| 70 | +===================== |
| 71 | + |
| 72 | +Most of these examples are used in testing and tuning the RabbitMQ |
| 73 | +server. |
| 74 | + |
| 75 | +BufferPerformanceMetrics - Tests buffer sizing. |
| 76 | +ChannelCreationPerformance - Test different Channel creation strategies. |
| 77 | +ConsumerMain - Measures performance of Consumers. |
| 78 | +ManyConnections - Tests many connections. |
| 79 | +MulticastMain - Measures performance of multiple consumers and producers. |
| 80 | +ProducerMain - Measures performance of Producers. |
| 81 | +SpammyTopicProducer - Sends lots of different topic messages over AMQP. |
| 82 | +StressPersister - Stress test for persister. |
| 83 | +TestMain - RabbitMQ server regression tests. |
| 84 | +TracerConcurrencyTest - Tests correct concurrency behaviour of RabbitMQ tracer. |
0 commit comments