lith %!s(int64=4) %!d(string=hai) anos
pai
achega
a206a06604

+ 5 - 0
dotnet/Doc/PublishFile/Sers单体压测/ServiceCenter/appsettings.json

@@ -286,10 +286,15 @@
 
     /* 日志配置,可不指定 */
     "Logger": {
+      /* print the log to Log/*.txt default:true  */
+      "PrintToTxt": true,
       /* print the log to console. default:false  */
       "PrintToConsole": true
     },
 
+    /* 队列类型。可为 BlockingCollection(默认)、 ConsumerCache_BlockingCollection(高性能) 、ActionBlock、BufferBlock  */
+    "ConsumerType": "ConsumerCache_BlockingCollection",
+
 
     /* 序列化配置,可不指定 */
     "Serialization": {

+ 3 - 0
dotnet/Gateway/App.Gateway/appsettings.json

@@ -162,6 +162,9 @@
       "PrintToConsole": true
     },
 
+    /* 队列类型。可为 BlockingCollection(默认)、 ConsumerCache_BlockingCollection(高性能) 、ActionBlock、BufferBlock  */
+    "ConsumerType": "ConsumerCache_BlockingCollection",
+
 
     /* 序列化配置,可不指定 */
     "Serialization": {

+ 57 - 3
dotnet/Library/Sers/Sers.Core/Sers.Core/Util/Consumer/ConsumerFactory.cs

@@ -1,14 +1,68 @@
-using System;
+using Vit.Core.Util.ConfigurationManager;
 
 namespace Sers.Core.Util.Consumer
 {
     public class ConsumerFactory
     {
 
+        /// <summary>
+        /// 队列类型。可为 BlockingCollection(默认)、 ConsumerCache_BlockingCollection(高性能) 、ActionBlock、BufferBlock 
+        /// </summary>
+        public static string consumerType = ConfigurationManager.Instance.GetByPath<string>("Vit.ConsumerType");
+
         public static IConsumer<T> CreateConsumer<T>() 
         {
-            //return new Consumer_BlockingCollection<T>();
-            return new ConsumerCache<T, Consumer_BlockingCollection<T>>();
+
+            //return new ConsumerCache<T, Consumer_BlockingCollection<T>>();
+            IConsumer<T> consumer;
+            switch (consumerType)
+            {
+                case "ActionBlock":
+                    consumer = new Consumer_ActionBlock<T>();  // 16 16 700万     24 24 900-1000万
+                    break;
+                case "BufferBlock":
+                    consumer = new Consumer_BufferBlock<T>();   //2 36 800-1000万
+                    break;
+                case "BlockingCollection":
+                    consumer = new Consumer_BlockingCollection<T>();  //16 16 440万          2  2  800万
+                    break;
+
+
+                case "Disruptor":
+                    consumer = new Consumer_Disruptor<T>(); // 16 16 800万
+                    break;
+                case "WorkerPool":
+                    consumer = new Consumer_WorkerPool<T>(); //16 16 800-900万
+                    break;
+
+                case "ConsumerCache_ActionBlock":
+                    consumer = new ConsumerCache<T, Consumer_ActionBlock<T>>(); // 16 16  4000-4200万
+                    break;
+                case "ConsumerCache_BufferBlock":
+                    consumer = new ConsumerCache<T, Consumer_BufferBlock<T>>(); // 16 16  1500-1600万
+                    break;
+                case "ConsumerCache_BlockingCollection":
+                    consumer = new ConsumerCache<T, Consumer_BlockingCollection<T>>(); //16 16 4200-4500万
+                    break;
+
+
+
+                case "ConsumerCache_WorkerPool":
+                    consumer = new ConsumerCache<T, Consumer_WorkerPool<T>>(); //750万  异常
+                    break;
+                case "WorkerPoolCache":
+                    consumer = new Consumer_WorkerPoolCache<T>();        //940万 异常
+                    break;
+                case "WorkerPoolCascade":
+                    consumer = new Consumer_WorkerPoolCascade<T>();   //1400万 异常
+                    break;
+
+                default:
+                    consumer = new Consumer_BlockingCollection<T>();
+                    break;
+            }
+
+            return consumer;
         }
     }
 }

+ 1 - 1
dotnet/Library/Sers/Sers.Core/Sers.Core/Util/Consumer/Consumer_Disruptor.cs

@@ -21,7 +21,7 @@ namespace Sers.Core.Util.Consumer
     /// </summary>
     /// <typeparam name="T"></typeparam>
     public class Consumer_Disruptor<T> : IConsumer<T>
-        where T: class,new()
+        //where T: class,new()
     {
 
         /// <summary>

+ 3 - 0
dotnet/Library/Vit/Vit.WebHost/appsettings.json

@@ -60,6 +60,9 @@
       "PrintToConsole": true
     },
 
+    /* 队列类型。可为 BlockingCollection(默认)、 ConsumerCache_BlockingCollection(高性能) 、ActionBlock、BufferBlock  */
+    "ConsumerType": "ConsumerCache_BlockingCollection",
+
 
     /* 序列化配置,可不指定 */
     "Serialization": {

+ 3 - 0
dotnet/ServiceCenter/App.Gover.Gateway/appsettings.json

@@ -162,6 +162,9 @@
       "PrintToConsole": true
     },
 
+    /* 队列类型。可为 BlockingCollection(默认)、 ConsumerCache_BlockingCollection(高性能) 、ActionBlock、BufferBlock  */
+    "ConsumerType": "ConsumerCache_BlockingCollection",
+
 
     /* 序列化配置,可不指定 */
     "Serialization": {

+ 2 - 0
dotnet/ServiceCenter/App.ServiceCenter/appsettings.json

@@ -515,6 +515,8 @@
       "PrintToConsole": true
     },
 
+    /* 队列类型。可为 BlockingCollection(默认)、 ConsumerCache_BlockingCollection(高性能) 、ActionBlock、BufferBlock  */
+    "ConsumerType": "ConsumerCache_BlockingCollection",
 
     /* 序列化配置,可不指定 */
     "Serialization": {

+ 3 - 0
dotnet/ServiceStation/Demo/SersLoader/Did.SersLoader.Demo/appsettings.json

@@ -336,6 +336,9 @@
       "PrintToConsole": true
     },
 
+    /* 队列类型。可为 BlockingCollection(默认)、 ConsumerCache_BlockingCollection(高性能) 、ActionBlock、BufferBlock  */
+    "ConsumerType": "ConsumerCache_BlockingCollection",
+
 
     /* 序列化配置,可不指定 */
     "Serialization": {

+ 3 - 0
dotnet/ServiceStation/Demo/Serslot/Did.Serslot.Demo/appsettings.json

@@ -196,6 +196,9 @@
       "PrintToConsole": true
     },
 
+    /* 队列类型。可为 BlockingCollection(默认)、 ConsumerCache_BlockingCollection(高性能) 、ActionBlock、BufferBlock  */
+    "ConsumerType": "ConsumerCache_BlockingCollection",
+
 
     /* 序列化配置,可不指定 */
     "Serialization": {