1e09706e04dd9f7071c04921c943e8a42b12d58b.svn-base 747 B

1234567891011121314151617181920212223242526272829303132
  1. package org.jeecg.common.modules.redis.client;
  2. import org.jeecg.common.base.BaseMap;
  3. import org.jeecg.common.constant.GlobalConstants;
  4. import org.springframework.context.annotation.Configuration;
  5. import org.springframework.data.redis.core.RedisTemplate;
  6. import javax.annotation.Resource;
  7. /**
  8. * redis客户端
  9. */
  10. @Configuration
  11. public class JeecgRedisClient {
  12. @Resource
  13. private RedisTemplate<String, Object> redisTemplate;
  14. /**
  15. * 发送消息
  16. *
  17. * @param handlerName
  18. * @param params
  19. */
  20. public void sendMessage(String handlerName, BaseMap params) {
  21. params.put(GlobalConstants.HANDLER_NAME, handlerName);
  22. redisTemplate.convertAndSend(GlobalConstants.REDIS_TOPIC_NAME, params);
  23. }
  24. }