public void runtest(Object invokeEntity)
        {
            try
            {
                mongodbHelper = new ZC.DBUtils.MongodbHelper(System.Configuration.ConfigurationManager.AppSettings["mgdwhost"].ToString());
            }
            catch (Exception ex)
            {
                File.AppendAllText("error.txt", ex.Message);
            }

            //// 处理mongodb查询日志
            consumerQuery = RocketMqHelper.CreateDefaultMQPushConsumer <MongoDBQueryListener>("MongoDB_Query", MessageModel.CLUSTERING, "MongoDB", "Query");

            consumerUpdateVersion = RocketMqHelper.CreateDefaultMQPushConsumer <MongoDBUpdateVersionListener>("MongoDB_UpdateVersion", MessageModel.CLUSTERING, "MongoDB", "UpdateVersion");

            while (true)
            {
                Thread.Sleep(2000);
            }
        }
Beispiel #2
0
            public void TestMq()
            {
                ConcurrentDictionary <string, int> Dic = new ConcurrentDictionary <string, int>();

                Dic.TryAdd("ff", 1);
                Dic["ff"]++;
                Dic["ff"] = 22;

                string testTopic = "testtopic123455ssss";
                var    producer1 = RocketMqHelper.CreateDefaultMQProducer("aaaaa");

                producer1.send(new org.apache.rocketmq.common.message.Message(testTopic, Encoding.UTF8.GetBytes("张三dddd")));


                var cusomer1 = RocketMqHelper.CreateDefaultMQPushConsumer <AAMessageListenerConcurrently>("ddd");

                cusomer1.subscribe(testTopic, "*");



                Thread.Sleep(1000000);
            }
Beispiel #3
0
            public void TestMq()
            {
                var producer1 = RocketMqHelper.CreateDefaultMQProducer("aaaaa");
                var producer2 = RocketMqHelper.CreateDefaultMQProducer("aaaaa");
                var producer3 = RocketMqHelper.CreateDefaultMQProducer("aaaaa");

                producer3.send(new org.apache.rocketmq.common.message.Message("123456", Encoding.UTF8.GetBytes("张三dddd")));

                producer3.send(new org.apache.rocketmq.common.message.Message("123456", Encoding.UTF8.GetBytes("李四3333")));
                producer3.send(new org.apache.rocketmq.common.message.Message("123456", Encoding.UTF8.GetBytes("张三dddd")));

                producer3.send(new org.apache.rocketmq.common.message.Message("123456", Encoding.UTF8.GetBytes("李四3333")));
                var cusomer1 = RocketMqHelper.CreateDefaultMQPushConsumer <AAMessageListenerConcurrently>("ddd");

                var cusomer2 = RocketMqHelper.CreateDefaultMQPushConsumer <AAMessageListenerConcurrently>("ddd");
                var cusomer3 = RocketMqHelper.CreateDefaultMQPushConsumer <AAMessageListenerConcurrently>("ddd");
                var cusomer4 = RocketMqHelper.CreateDefaultMQPushConsumer <AAMessageListenerConcurrently>("ddd");

                cusomer1.subscribe("123456", "*");

                Thread.Sleep(1000000);
            }
Beispiel #4
0
 public MessageTopshelf()
 {
     consumer = RocketMqHelper.CreateDefaultMQPushConsumer <UploadOssMessageListener>(MqConst.UploadOssCusomerGroup);
 }
Beispiel #5
0
 public MessageTopshelf()
 {
     consumer = RocketMqHelper.CreateDefaultMQPushConsumer <SyncMessageListener>(MqConst.UserSyncMessageCusomerGroup);
 }