package com.webchat.service.listener;


import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class RedisMessageSender {

    @Resource
    private RedisTemplate redisTemplate;

    /**
     * 发布消息
     *
     * @param channel
     * @param message
     */
    public void sendMessage(String channel, String message) {

        redisTemplate.convertAndSend(channel, message);
    }
}
