36 lines
1.0 KiB
Java
36 lines
1.0 KiB
Java
package com.adc.da.mq;
|
|
|
|
import com.adc.da.slrs.otConvertMq.entity.OtConvertMq;
|
|
import org.springframework.amqp.core.AmqpTemplate;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Hashtable;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
|
|
@Component
|
|
public class CreateUpdateMQService {
|
|
@Autowired
|
|
private AmqpTemplate rabbitTemplate;
|
|
|
|
/**
|
|
* @Author yuezhihang
|
|
* @Description 创建消息队列
|
|
* Date 2018/8/24 13:59
|
|
* @Param [convert, convertType]
|
|
* @return int
|
|
**/
|
|
public void sendMQ(Hashtable<String,String> hashtable , List<String> remove , List<String> add){
|
|
Map<String,Object> map=new HashMap<>();
|
|
map.put("tableData",hashtable);
|
|
map.put("remove",remove);
|
|
map.put("add",add);
|
|
//发送消息队列
|
|
this.rabbitTemplate.convertAndSend("qd-update-exchange_SQ_GSAR_RELEASE", "qd-update-key_SQ_GSAR_RELEASE", map);
|
|
}
|
|
|
|
}
|