@@ -9,15 +9,19 @@ namespace MassPublish
9
9
{
10
10
public static class Program
11
11
{
12
- private const int BatchesToSend = 100 ;
13
- private const int ItemsPerBatch = 500 ;
12
+ private const int BatchesToSend = 64 ;
13
+ private const int ItemsPerBatch = 8192 ;
14
14
15
15
private static int messagesSent ;
16
16
private static int messagesReceived ;
17
17
private static AutoResetEvent doneEvent ;
18
18
19
19
public static void Main ( )
20
20
{
21
+ var r = new Random ( ) ;
22
+ byte [ ] payload = new byte [ 4096 ] ;
23
+ r . NextBytes ( payload ) ;
24
+
21
25
ThreadPool . SetMinThreads ( 16 * Environment . ProcessorCount , 16 * Environment . ProcessorCount ) ;
22
26
23
27
doneEvent = new AutoResetEvent ( false ) ;
@@ -36,7 +40,6 @@ public static void Main()
36
40
subscriber . QueueBind ( "testqueue" , "test" , "myawesome.routing.key" ) ;
37
41
subscriber . BasicConsume ( "testqueue" , true , "testconsumer" , asyncListener ) ;
38
42
39
- byte [ ] payload = new byte [ 512 ] ;
40
43
var watch = Stopwatch . StartNew ( ) ;
41
44
_ = Task . Run ( async ( ) =>
42
45
{
@@ -70,7 +73,6 @@ public static void Main()
70
73
publisher . Dispose ( ) ;
71
74
subscriber . Dispose ( ) ;
72
75
connection . Dispose ( ) ;
73
- Console . ReadLine ( ) ;
74
76
}
75
77
76
78
private static Task AsyncListener_Received ( object sender , BasicDeliverEventArgs @event )
0 commit comments