package com.didispace.rabbit; import org.springframework.amqp.rabbit.annotation.RabbitHandler; import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Component; import java.util.Date; /** * @author 翟永超 * @create 2016/9/25. * @blog http://blog.didispace.com */ @Component @RabbitListener(queues = "hello") public class Receiver { @RabbitHandler public void process(String hello) { System.out.println("Receiver : " + hello); } }