From 1f23474ae1681569959c8d2d7ac69dff135de5e0 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Tue, 12 Jul 2011 11:09:51 +0100 Subject: [PATCH] AMQP-142: added content to quick start --- src/docbkx/quick-tour.xml | 112 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) diff --git a/src/docbkx/quick-tour.xml b/src/docbkx/quick-tour.xml index bb437867..355ef9dd 100644 --- a/src/docbkx/quick-tour.xml +++ b/src/docbkx/quick-tour.xml @@ -8,5 +8,117 @@ Introduction This is the 5 minute tour to get started with Spring AMQP. + + Prequisites: install and run the RabbitMQ broker (http://www.rabbitmq.com/download.html). + Then grab the spring-rabbit JAR and all its dependencies - the easiest way + to do that is to declare a depenendency in your build tool, e.g. for + Maven: + + + org.springframework.amqp + spring-rabbit + 1.0.0.RELEASE +]]> + +
+ Very, Very Quick + + Using plain, imperative Java to send and receive a message: + + + + Note that there is a ConnectionFactory in + the native Java Rabbit client as well. We are using the Spring + abstraction in the code above. We are relying on the default exchange in + the broker (since none is specified in the send), and the default + binding of all queues to the default exchange by their name (hence we + can use the queue name as a routing key in the send). Those behaviours + are defined in the AMQP specification. +
+ +
+ With XML Configuration + + The same example as above, but externalizing the resource + configuration to XML: + + + + + + + + + + + + + +]]> + + The <rabbit:admin/> declaration by default + automatically looks for beans of type Queue, + Exchange and Binding and + declares them to the broker on behalf of the user, hence there is no + need to use that bean explicitly in the simple Java driver. There are + plenty of options to configure the properties of the components in the + XML schema - you can use auto-complete features of your XML editor to + explore them and look at their documentation. +
+ +
+ With Java Configuration + + The same example again with the external configuration in + Java: + + +