package com.sky.ioc.message;

import com.alibaba.fastjson.JSONObject;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class MessageSender {
    @Autowired
    private AmqpTemplate rabbitTemplate;

    public void send() {
       /* JSONObject json = new JSONObject();
        json.put("title","hello");
        json.put("time",new Date());
        System.out.println("Sender : " + json.toJSONString());
        this.rabbitTemplate.convertAndSend("message", json);*/
    }
}
