Package com.bytedesk.kbase.article.mq
Class ArticleMessageService
java.lang.Object
com.bytedesk.kbase.article.mq.ArticleMessageService
文章消息服务
使用核心模块中的JmsTemplate发送文章索引请求
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbatchSendToIndexQueue(Iterable<String> articleUids) 批量发送文章到索引队列 增加了发送间隔,避免短时间大量索引请求导致的冲突 使用批处理方式并引入延迟策略,更均匀地分散消息发送时间private voidprocessBatch(List<String> batch, int count) 处理批量发送的辅助方法voidsendToDeleteQueue(String articleUid) 发送文章删除请求到索引队列 增加了延迟发送机制和重试机制,避免同时大量删除导致冲突voidsendToIndexQueue(String articleUid) 发送文章到索引队列,用于创建或更新索引 增加了延迟发送机制和重试机制,避免同时大量索引导致冲突
-
Field Details
-
jmsTemplate
@Autowired private org.springframework.jms.core.JmsTemplate jmsTemplate
-
-
Constructor Details
-
ArticleMessageService
public ArticleMessageService()
-
-
Method Details
-
sendToIndexQueue
发送文章到索引队列,用于创建或更新索引 增加了延迟发送机制和重试机制,避免同时大量索引导致冲突- Parameters:
articleUid- 文章的唯一标识
-
sendToDeleteQueue
发送文章删除请求到索引队列 增加了延迟发送机制和重试机制,避免同时大量删除导致冲突- Parameters:
articleUid- 文章的唯一标识
-
batchSendToIndexQueue
批量发送文章到索引队列 增加了发送间隔,避免短时间大量索引请求导致的冲突 使用批处理方式并引入延迟策略,更均匀地分散消息发送时间- Parameters:
articleUids- 文章唯一标识列表
-
processBatch
处理批量发送的辅助方法- Parameters:
batch- 批次数据count- 当前计数
-