MqQueue4ModifyMchUserRemove.java 1.7 KB
Newer Older
D
dingzhiwei 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*
 * Copyright (c) 2021-2031, 河北计全科技有限公司 (https://www.jeequan.com & jeequan@126.com).
 * <p>
 * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.gnu.org/licenses/lgpl.html
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.jeequan.jeepay.mgr.mq.queue;

18
import com.alibaba.fastjson.JSONArray;
D
dingzhiwei 已提交
19 20 21 22 23 24 25
import com.jeequan.jeepay.core.constants.CS;
import lombok.extern.slf4j.Slf4j;
import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Component;

26 27
import java.util.Collection;

D
dingzhiwei 已提交
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
/**
 * 商户用户信息清除
 *
 * @author pangxiaoyu
 * @site https://www.jeepay.vip
 * @date 2021-06-07 07:15
 */
@Slf4j
@Component
public class MqQueue4ModifyMchUserRemove extends ActiveMQQueue{

    @Autowired private JmsTemplate jmsTemplate;

    public MqQueue4ModifyMchUserRemove(){
        super(CS.MQ.QUEUE_MODIFY_MCH_USER_REMOVE);
    }

    /**
     * @author: pangxiaoyu
     * @date: 2021/6/7 16:16
     * @describe: 推送消息到各个节点
     */
50 51 52 53 54
    public void push(Collection<Long> userIdList) {
        if(userIdList == null || userIdList.isEmpty()){
            return ;
        }
        this.jmsTemplate.convertAndSend(this,JSONArray.toJSONString(userIdList));
D
dingzhiwei 已提交
55 56 57
    }

}