123
This commit is contained in:
@@ -25,6 +25,16 @@ public class AmqpProducer {
|
||||
});
|
||||
}
|
||||
|
||||
public void sendCommonDelayMq(CommonDelayDto dto,Integer timeout){
|
||||
rabbitTemplate.convertAndSend(CommonDelayMqConfig.EXCHANGE_NAME,
|
||||
CommonDelayMqConfig.ROUTING_KEY,
|
||||
JSON.toJSONString(dto),
|
||||
messagePostProcessor -> {
|
||||
messagePostProcessor.getMessageProperties().setDelay(timeout*1000); // 设置延迟时间,单位毫秒
|
||||
return messagePostProcessor;
|
||||
});
|
||||
}
|
||||
|
||||
public void sendCommonDelayMq(Integer type,Long roomId,Integer timeout){
|
||||
CommonDelayDto dto = new CommonDelayDto();
|
||||
dto.setType(type);
|
||||
|
||||
Reference in New Issue
Block a user