ÎļþÃû´Ó src/java/org/apereo/cas/web/landtool/rabbitmq/RadarRabbitMQTemplate.java ÐÞ¸Ä |
| | |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | |
| | | import org.apereo.cas.web.landtool.rabbitmq.config.RabbitMQProperties; |
| | | import org.apereo.cas.web.landtool.rabbitmq.config.RabbitMqProperties; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.amqp.core.Message; |
| | |
| | | * 2019-07-05 |
| | | */ |
| | | @Component |
| | | public class RadarRabbitMQTemplate implements RabbitTemplate.ConfirmCallback, ReturnCallback{ |
| | | private static final Logger LOGGER = LoggerFactory.getLogger(RadarRabbitMQTemplate.class); |
| | | public class RadarRabbitMqTemplate implements RabbitTemplate.ConfirmCallback, ReturnCallback{ |
| | | private static final Logger LOGGER = LoggerFactory.getLogger(RadarRabbitMqTemplate.class); |
| | | |
| | | @Autowired |
| | | private RabbitTemplate rabbitTemplate; |
| | | @Autowired |
| | | private RabbitMQProperties sysConfig; |
| | | private RabbitMqProperties sysConfig; |
| | | |
| | | @PostConstruct |
| | | public void init() { |
| | |
| | | |
| | | } |
| | | |
| | | //åéæ¶æ¯ï¼ä¸éè¦å®ç°ä»»ä½æ¥å£ï¼ä¾å¤é¨è°ç¨ã |
| | | /** |
| | | * åéæ¶æ¯ï¼ä¸éè¦å®ç°ä»»ä½æ¥å£ï¼ä¾å¤é¨è°ç¨ã |
| | | * @param routingKey |
| | | * @param msg |
| | | */ |
| | | public void send(String routingKey,String msg){ |
| | | rabbitTemplate.convertAndSend(sysConfig.getRmqExchangeName(),routingKey,msg); |
| | | } |
| | | |
| | | //åéæ¶æ¯ï¼ä¸éè¦å®ç°ä»»ä½æ¥å£ï¼ä¾å¤é¨è°ç¨ã |
| | | /** |
| | | * åéæ¶æ¯ï¼ä¸éè¦å®ç°ä»»ä½æ¥å£ï¼ä¾å¤é¨è°ç¨ã |
| | | * @param exchangeName |
| | | * @param routingKey |
| | | * @param msg |
| | | */ |
| | | public void send(String exchangeName,String routingKey,String msg){ |
| | | rabbitTemplate.convertAndSend(exchangeName, routingKey, msg); |
| | | } |