添加消息到 Stream 的函数,
RedisConstant增加变量
This commit is contained in:
parent
167f3dd19b
commit
23b5e3e375
|
@ -41,4 +41,14 @@ public interface RedisConstant {
|
|||
String EMAIL_MSG_ID = "email_msg_id";
|
||||
|
||||
String UNDEAL_FILE = "Undeal:";
|
||||
|
||||
//自动分析等级
|
||||
String AUTO_CAT = "Stream:AutoCat";
|
||||
String GROUP_AutoCat = "Group_AutoCat";
|
||||
String AUTO_CONSUMER = "AutoCat_Consumer";
|
||||
//人工交互等级
|
||||
String CATEGORY = "Stream:Category";
|
||||
String GROUP_Category = "Group_Category";
|
||||
String CATEGORY_CONSUMER = "Category_Consumer";
|
||||
|
||||
}
|
||||
|
|
|
@ -198,6 +198,15 @@ public class RedisStreamUtil {
|
|||
// 向Redis Stream中推送消息
|
||||
return putRecord(record);
|
||||
}
|
||||
/**
|
||||
* 添加消息到 Stream (对象格式)
|
||||
*/
|
||||
public <T> RecordId addMessage(String streamKey, T message) {
|
||||
ObjectRecord<String, T> record = StreamRecords.newRecord()
|
||||
.in(streamKey)
|
||||
.ofObject(message);
|
||||
return stringRedisTemplate.opsForStream().add(record);
|
||||
}
|
||||
|
||||
public void setSilence(Map<String, Long> silenceMap){
|
||||
// 返回批处理的执行结果
|
||||
|
|
Loading…
Reference in New Issue
Block a user