@@ -17,6 +17,7 @@ namespace AkkaDotModule.Kafka
1717 public class ProducerSystem
1818 {
1919 private ActorSystem producerSystem ;
20+
2021 private ActorMaterializer materializer_producer ;
2122
2223 private Dictionary < string , ProducerSettings < Null , string > > producerList = new Dictionary < string , ProducerSettings < Null , string > > ( ) ;
@@ -36,21 +37,7 @@ public void Start(ProducerAkkaOption producerAkkaOption)
3637 var producer = ProducerSettings < Null , string > . Create ( producerSystem , null , null )
3738 . WithBootstrapServers ( producerAkkaOption . BootstrapServers ) ;
3839
39- if ( producerAkkaOption . SecurityOption != null )
40- {
41- KafkaSecurityOption kafkaSecurityOption = producerAkkaOption . SecurityOption ;
42- /*
43- producer = producer
44- .WithProperty("security.protocol", kafkaSecurityOption.SecurityProtocol)
45- .WithProperty("sasl.mechanism", kafkaSecurityOption.SaslMechanism)
46- .WithProperty("sasl.username", kafkaSecurityOption.SaslUsername)
47- .WithProperty("sasl.password", kafkaSecurityOption.SaslPassword);
48- //.WithProperty("kafka-clients.ssl.calocation", kafkaSecurityOption.SslCaLocation);
49- */
50- } ;
51-
5240 producerList [ producerAkkaOption . ProducerName ] = producer ;
53-
5441 }
5542
5643 public void SinkMessage ( string producerName , string topic , List < string > message , int tps )
@@ -59,7 +46,7 @@ public void SinkMessage(string producerName, string topic,List<string> message,i
5946
6047 Source < string , NotUsed > source = Source . From ( message ) ;
6148 source
62- . Throttle ( tps , TimeSpan . FromSeconds ( 1 ) , 1 , ThrottleMode . Shaping ) //TPS
49+ . Throttle ( tps , TimeSpan . FromSeconds ( 1 ) , 100 , ThrottleMode . Shaping ) //TPS
6350 . Select ( c =>
6451 {
6552 return c ;
0 commit comments