package org.springblade.utils;

import cn.hutool.setting.Setting;
import org.apache.flink.streaming.connectors.rabbitmq.common.RMQConnectionConfig;

/**
 * @author: lianghanqiang
 * @description: Rabbitmq 配置信息封装工具
 * @since: 10/27/21 -- 2:01 PM
 */
public class RabbitUtils {

	public static RMQConnectionConfig getRMQConnectionConfig(){
		Setting setting = new Setting("config/rabbit.setting");
		return new RMQConnectionConfig.Builder()
			.setHost(setting.get("host"))
			.setPort(setting.getInt("port"))
			.setUserName(setting.get("user"))
			.setPassword(setting.get("pass"))
			.setVirtualHost(setting.get("virtualHost"))
			.build();
	}

}
