| | |
| | | |
| | | import com.qcloud.cmq.Message; |
| | | import com.yeshi.buwan.dto.mq.IqiyiAlbum2MQMsg; |
| | | import com.yeshi.buwan.dto.mq.SolrVideoMQMsg; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | cmqUtil.deleteMsg(QUEUENAME_VIDEO_UPDATE_IQIYI_2, handler); |
| | | } |
| | | |
| | | //搜索引擎 |
| | | |
| | | /** |
| | | * 搜索引擎 |
| | | * @param id |
| | | */ |
| | | |
| | | /** |
| | | * 搜索引擎消息 |
| | | * |
| | | * @param id |
| | | */ |
| | | public void addSolrMsg(String id) { |
| | | cmqUtil.sendMsg(QUEUENAME_SOLR, id); |
| | | } |
| | | |
| | | public List<SolrVideoMQMsg> consumeSolrMsg(int count) { |
| | | List<SolrVideoMQMsg> list = new ArrayList<>(); |
| | | List<Message> msgList = cmqUtil.recieveMsg(count, QUEUENAME_SOLR); |
| | | if (msgList != null) |
| | | for (Message msg : msgList) { |
| | | SolrVideoMQMsg mm = new SolrVideoMQMsg(); |
| | | mm.setHandler(msg.receiptHandle); |
| | | mm.setId(msg.msgBody); |
| | | list.add(mm); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | | public void deleteSolrMsg(String handler) { |
| | | cmqUtil.deleteMsg(QUEUENAME_SOLR, handler); |
| | | } |
| | | |
| | | } |