示例#1
0
        public GatewayHelper(GatewayConfiguration config)
        {
            this.GatewayConfig = config;
            Operators          = (from o in config.Operators select(OperatorType) Enum.Parse(typeof(OperatorType), o)).ToList();

            SendMQHelper = new MQHelper.RabbitMQHelper(AppConfig.MQHost, AppConfig.MQVHost, AppConfig.MQUserName, AppConfig.MQPassword);
            SendMQHelper.BindQueue(config.Gateway, AppConfig.MaxPriority, config.Gateway);
        }
示例#2
0
        public Form1()
        {
            InitializeComponent();

            string host     = System.Configuration.ConfigurationManager.AppSettings["MQHost"];
            string vhost    = System.Configuration.ConfigurationManager.AppSettings["MQVHost"];
            string username = System.Configuration.ConfigurationManager.AppSettings["MQName"];
            string password = System.Configuration.ConfigurationManager.AppSettings["MQPassword"];

            SendMQHelper    = new MQHelper.RabbitMQHelper(host, vhost, username, password);
            RecieveMQHelper = new MQHelper.RabbitMQHelper(host, vhost, username, password);
            RecieveMQHelper.OnSubsribeMessageRecieve += OnSubsribeMessageRecieve;
            SendMQHelper.BindQueue("exchange", 10, "test");
        }