I used below Method but it is using large amount of CPU so i want to use Actor.Ask instead of below method can anyone help me how to use Actor.Ask
KafkaConsumer.PlainSource(
consumerSettings, subscription)
.RunForeach(result =>
{
_ActorRef.Tell(result.Message.Value);
}, materializer);
You should refactor this to use a
SelectAsyncstage in Akka.Streams:This will give you backpressure support and will only allow up to 10 concurrent
Task<TResponse>s to be outstanding at any given time. WithSelectAsyncinvocation order is preserved - so the results from those tasks will be delivered downstream in the original order in which they were invoked. If you don't care about the order, useSelectAsyncUnorderedinstead for additional throughput.