platform-core/platform-cache/src/main/java/org/sunbird/cache/util/RedisCacheUtil.java
public static void publish(String channel, String data) {
        if (StringUtils.isNotBlank(channel) && StringUtils.isNotBlank(data)) {
            Jedis jedis = getConnection();
            try {
                jedis.publish(channel, data);
            } catch (Exception e) {
                TelemetryManager.error("Exception Occurred While Publishing Message to Redis Channel : " + channel + " for data : " + data + " | Exception is : ", e);
                throw new ServerException(CacheErrorCode.ERR_CACHE_PUBLISH_CHANNEL_ERROR.name(), e.getMessage());
            } finally {
                returnConnection(jedis);
            }
        }
    }
/**
     * This method push given string message to given channel, which can be consumed by all subscribers of that channel.
     *
     * @param channel
     * @param data
     */
This method push given string message to given channel, which can be consumed by all subscribers of that channel.
@param channel
@param data
This method push given string message to given channel which can be consumed by all subscribers of that channel . @param channel @param data
public static void publish(String channel, String data) {
        if (StringUtils.isNotBlank(channel) && StringUtils.isNotBlank(data)) {
            Jedis jedis = getConnection();
            try {
                jedis.publish(channel, data);
            } catch (Exception e) {
                TelemetryManager.error("Exception Occurred While Publishing Message to Redis Channel : " + channel + " for data : " + data + " | Exception is : ", e);
                throw new ServerException(CacheErrorCode.ERR_CACHE_PUBLISH_CHANNEL_ERROR.name(), e.getMessage());
            } finally {
                returnConnection(jedis);
            }
        }
    }
public static void publish ( String channel , String data ) { if ( StringUtils . isNotBlank ( channel ) && StringUtils . isNotBlank ( data ) ) { Jedis jedis = getConnection ( ) ; try { jedis . publish ( channel , data ) ; } catch ( Exception e ) { TelemetryManager . error ( "Exception Occurred While Publishing Message to Redis Channel : " + channel + " for data : " + data + " | Exception is : " , e ) ; throw new ServerException ( CacheErrorCode . ERR_CACHE_PUBLISH_CHANNEL_ERROR . name ( ) , e . getMessage ( ) ) ; } finally { returnConnection ( jedis ) ; } } }
This method push given string message to given channel, which can be consumed by all subscribers of that channel.
This method push given string message to given channel which can be consumed by all subscribers of that channel .