XxlMqConf.java 837 B

1234567891011121314151617181920212223242526272829
  1. package cn.com.ctop.callback.config;
  2. import com.xxl.mq.client.factory.impl.XxlMqSpringClientFactory;
  3. import org.springframework.beans.factory.annotation.Value;
  4. import org.springframework.context.annotation.Bean;
  5. import org.springframework.stereotype.Component;
  6. @Component
  7. public class XxlMqConf {
  8. // ---------------------- param ----------------------
  9. @Value("${xxl.mq.admin.address}")
  10. private String adminAddress;
  11. @Value("${xxl.mq.accessToken}")
  12. private String accessToken;
  13. @Bean
  14. public XxlMqSpringClientFactory getXxlMqConsumer(){
  15. XxlMqSpringClientFactory xxlMqSpringClientFactory = new XxlMqSpringClientFactory();
  16. xxlMqSpringClientFactory.setAdminAddress(adminAddress);
  17. xxlMqSpringClientFactory.setAccessToken(accessToken);
  18. return xxlMqSpringClientFactory;
  19. }
  20. }