123456789101112131415161718192021222324 |
- package com.yihu.wlyy.redis;
- import com.yihu.wlyy.util.SystemConf;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.beans.factory.annotation.Value;
- import org.springframework.stereotype.Component;
- import redis.clients.jedis.Jedis;
- /**
- * Created by Trick on 2017/8/7.
- */
- @Component
- public class RedisThread implements Runnable {
- @Value("${spring.redis.host}")
- private String url;
- @Autowired
- private RedisMsgPubSubListener redisMsgPubSubListener;
- @Override
- public void run() {
- Jedis jedis = new Jedis(url);
- jedis.subscribe(redisMsgPubSubListener, SystemConf.getInstance().getSystemProperties().getProperty("redis_prescription_title"));
- }
- }
|