Spring AMQP 1.0 GA

| by Bienvenido David Follow 0 Followers on Sep 09, 2011. Estimated reading time: 2 minutes |

A note to our readers: You asked so we have developed a set of features that allow you to reduce the noise: you can get email and web notifications for topics you are interested in. Learn more about our new features.

SpringSource, a division of VMware, has released Spring AMQP 1.0 GA (1.0.0.RELEASE). The Spring AMQP project applies core Spring concepts to the development of AMQP-based messaging solutions, and is available in both Java and .NET versions. For a good primer on Spring AMQP and AMQP in general, read the "Introduction to SpringSource's Advanced Message Queuing Protocol Support".

Spring AMQP provides org.springframework.amqp.core.AmqpTemplate for sending and receiving messages. AMQP template implementations support sending and receiving POJOs instead of javax.jms.Message instances. They also provide a way to customize the MessageConverter used to marshal the Object. Spring + JMS users will notice similarities between JmsTemplate and the new AmqpTemplate.

Here are code snippets on how synchronous messaging works using Spring AMQP with RabbitMQ behind the scenes. RabbitMQ is a VMware product and is the default AMQP implementation used in the official Spring AMQP examples.

<beans xmlns=""

	<rabbit:connection-factory id="connectionFactory"/>
	<rabbit:template id="amqpTemplate" connection-factory="connectionFactory"/>
	<rabbit:admin connection-factory="connectionFactory"/>
	<rabbit:queue name="helloworld.queue"/>

The above spring configuration xml references the ConnectionFactory, creates a RabbitTemplate for access to the message broker, creates a RabbitAdmin to manage exchanges, queues and bindings, and finally creates the queue. Next are the Java code snippets to send and receive messages.

import org.springframework.amqp.core.AmqpTemplate;

AmqpTemplate amqpTemplate = context.getBean(AmqpTemplate.class);
amqpTemplate.convertAndSend("helloworld.queue", "Hello World");

import org.springframework.amqp.core.AmqpTemplate;

AmqpTemplate amqpTemplate = context.getBean(AmqpTemplate.class);

To get started, download the Spring AMQP for Java or the Spring AMQP for .NET. The Spring AMQP for Java artifacts are also available in the SpringSource Maven repository and Maven Central. Dependencies are spring-amqp, spring-core, spring-context. Include spring-rabbit if you are using RabbitMQ as the message broker. You can also try the Spring AMQP examples hosted at GitHub. The examples are Maven based projects and requires RabbitMQ and Erlang. Read the file that comes with the sample code for complete build instructions.

For Cloud Foundry users, VMware has also announced the free public beta of RabbitMQ on Cloud Foundry. You can use Spring AMQP to connect to RabbitMQ on Cloud Foundry, with examples to help you quickly get started. For Spring Integration users, AMQP support is available in version 2.1 M1.

Besides VMware's RabbitMQ, other AMQP based message-oriented middleware are Apache Qpid, Red Hat Enterprise MRG, and StormMQ (hosted). iMatrix's OpenAMQ is no longer supported and thus no longer an alternative.

For more information on Spring AMQP, please visit the Spring AMQP Reference for Java and the Spring AMQP Reference for .NET reference pages.

Rate this Article

Adoption Stage

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread


Login to InfoQ to interact with what matters most to you.

Recover your password...


Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.


More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.


Stay up-to-date

Set up your notifications and don't miss out on content that matters to you