private static final String[] BEAN_CONFIG = { "classpath:/META-INF/spring/jobs/messaging/rabbitmq-beans.xml",
"classpath:/META-INF/spring/config-beans.xml" };
public static void main(String[] args) {
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(BEAN_CONFIG);
AmqpTemplate amqpTemplate = applicationContext.getBean("inboundAmqpTemplate", RabbitTemplate.class);
for (int i = 0; i < SEND_MESSAGE_COUNT; i++ ) {
amqpTemplate.convertAndSend("foo message: " + i);
}
((ConfigurableApplicationContext) applicationContext).close();
}