admin
2025-02-25 30d8e227e8d823b6c38c3b9c90ac2df03b63befe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.yeshi.fanli.util.mq.cmq;
 
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.util.mq.rabbit.RabbitmqSenderUtil;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;
 
import javax.annotation.Resource;
 
@Component
public class HongBaoRecieveCMQManager {
 
    @Resource
    private RabbitTemplate rabbitTemplate;
 
    private final static String TOPIC_NAME = "topic_hongbao";
 
    public static String QUEUE_INTEGRAL = TOPIC_NAME + "_" + "integral";
 
    public static String SUBSCRIBE_INTEGRAL = "integral";
 
    /**
     * 发布
     *
     * @param hongBaoId
     */
    public void addHongBaoRecieveMsg(Long hongBaoId) {
        if (hongBaoId == null)
            return;
        RabbitmqSenderUtil.sendExchangeMsg(rabbitTemplate,TOPIC_NAME,"*", hongBaoId + "");
        LogHelper.test("红包消息投递成功");
    }
 
}