You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
441 B

package com.bx.imcommon.mq;
import java.util.List;
/**
* redis 队列消费者抽象类
*/
public abstract class RedisMQConsumer<T> {
public void onMessage(T data){}
public void onMessage(List<T> datas){}
public String generateKey(){
// 默认队列名就是redis的key
RedisMQListener annotation = this.getClass().getAnnotation(RedisMQListener.class);
return annotation.queue();
}
}