yangys
2024-10-30 c27b939fa5fa6ce4d712f7e9ced2ad811d69d5ec
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
package com.qianwen.smartman.modules.smis.message.producer;
 
//import org.apache.rocketmq.spring.core.RocketMQTemplate;
import com.qianwen.smartman.common.constant.WorkstationConstant;
import com.qianwen.smartman.common.mqtt.MqttMessageSender;
import com.qianwen.smartman.modules.smis.dto.WorkstationCreateMessageDTO;
 
import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Component;
 
@Component
public class InsertWorkstationProducer {
    //private final RocketMQTemplate rocketMQTemplate;
    @Autowired
    private MqttMessageSender mqttMsgSender;
    /*
    public InsertWorkstationProducer(final RocketMQTemplate rocketMQTemplate) {
        this.rocketMQTemplate = rocketMQTemplate;
    }*/
 
    public void sendInsertWorkstationMessage(Long workstationId) {
        //this.rocketMQTemplate.syncSend(WorkstationConstant.WORKSTATION_CREATE_TOPIC, MessageBuilder.withPayload(dto).build());
        
        mqttMsgSender.sendMessage(WorkstationConstant.WORKSTATION_CREATE_TOPIC, String.valueOf(workstationId));
    }
}