/**
 * Copyright (C), 2022-04-13
 * FileName: ProducerApplication
 * Author:   wanglongda
 * Date:     2022/4/13 15:39
 * Description: 发送者
 */
package me.zhengjie.config.rocket;/**
 * Created Name: wanglongda
 * Created Time: 2022/4/13 15:39
 * Description: iot-ykt
 */

import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * <功能简要> <br>
 * <发送者>
 *
 * @Author wanglongda
 * @createTime 2022/4/13 15:39
 * @Version 1.0.0
 */
@Component
public class Producer{

    @Resource
    private RocketMQTemplate rocketMQTemplate;
//     发送消息的实例
    public void sendMessage(String topic, String msg) {
        rocketMQTemplate.convertAndSend(topic, msg);
    }
}
