All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.antelopeframework.redis.mq.QueueNameBuilder Maven / Gradle / Ivy

The newest version!
package com.github.antelopeframework.redis.mq;

import org.apache.commons.lang3.StringUtils;

import com.github.antelopeframework.BizRuntimeException;

/**
 * Redis对列key构建; 格式为"_queue_{type}_{name}".
 * 
 * @author yangzhi
 */
public class QueueNameBuilder {
    public final static String QUEUE_NAME_PATTERN = "l::_queue_%s";
    
    /**
     * 
     * @param topic
     * @param priority
     * @return
     */
    public static String name(String topic) {
    	if (StringUtils.isBlank(topic)) {
    		throw new BizRuntimeException("'topic' parameter is blank.");
    	}

        return String.format(QUEUE_NAME_PATTERN, topic);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy