Get ahead
VMware offers training and certification to turbo-charge your progress.
Learn moreWe are pleased to announce that the first milestone of Spring AMQP 1.4 is now available.
##Key Features
@RabbitListener
), enabled with either @EnableRabbit
or <rabbit:annotation-driven />
(see below for an example).RabbitMessagingTemplate
allowing interaction with RabbitMQ
using spring-messaging
Message
objects.RabbitConnectionFactory
Here is a simple example for a POJO service using the new annotations:
public static class MyService {
@RabbitListener(queues = "fooQ")
public String capitalize(String foo) {
return foo.toUpperCase();
}
}
@Configuration
@EnableRabbit
public static class EnableRabbitConfig {
@Bean
public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory() {
SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
factory.setConnectionFactory(rabbitConnectionFactory());
return factory;
}
@Bean
public MyService myService() {
return new MyService();
}
// Rabbit infrastructure setup
@Bean
public ConnectionFactory rabbitConnectionFactory() {
CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
connectionFactory.setHost("localhost");
return connectionFactory;
}
}
See the Release Notes and the Project Page for more information.
A minor 1.3.6 Maintenance Release is also available.