---
title: "Discussion on \"Kafka Producer - C# Sync vs Async\" | Hashnode"
description: "Discussion on \"Kafka Producer - C# Sync vs Async\". To Sync or not to Sync in dotnet"
url: "https://hashnode.com/posts/kafka-producer-sync-vs-async/63d169ba8835308a18994333"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Kafka Producer - C# Sync vs Async](https://concurrentflows.com/kafka-producer-sync-vs-async?utm_source=hashnode&utm_medium=feed)

To Sync or not to Sync in dotnet

Jan 25, 2023 · 5 min read · concurrentflows.com  
Updated Jan 27, 2023  
Read the article

-   [#csharp](https://hashnode.com/tag/csharp)
-   [#apache-kafka](https://hashnode.com/tag/apache-kafka)
-   [#confluent-kafka](https://hashnode.com/tag/confluent-kafka)
-   [#event-driven-architecture](https://hashnode.com/tag/event-driven-architecture)
-   [#event-streaming](https://hashnode.com/tag/event-streaming)

## Written by

[Joshua Steward](https://hashnode.com/@jsteward)

@jsteward · Arizona, US

  
[View profile](https://hashnode.com/@jsteward)

Solution Architect

Engineering leader specializing in distributed event driven architectures, with a proven track record of building and mentoring high performing teams. My core expertise lies in dotnet/C#, modern messaging platforms, and Microsoft Azure, where I've architected and implemented highly scalable and available solutions. Explore my insights and deep dives into event driven architecture, patterns, and practices on my platform https://concurrentflows.com/. Having led engineering teams in collaborative and remote-first environments, I prioritize mentorship, clear communication, and aligning technical roadmaps with stakeholder needs. My leadership foundation was strengthened through experience as a Sergeant in the U.S. Marine Corps, where I honed skills in team building and operational excellence.

## Responses 1

Markdown supported · ⌘↵ to post

[VyOR](https://hashnode.com/@VyOR)

[Jun 5, 2024](https://hashnode.com/posts/kafka-producer-sync-vs-async/63d169ba8835308a18994333/comment/6660cf97c04b7e81d44d942e)

Not fair test, because during async you are awaiting delivery result, but with sync not (actually fire and forget). Call flush after sync produce to await callback get called

[VyOR](https://hashnode.com/@VyOR)

[Jun 5, 2024](https://hashnode.com/posts/kafka-producer-sync-vs-async/63d169ba8835308a18994333/comment/6660cf97c04b7e81d44d942e#reply-6660d3d3c9425cb4afa50dd8)

Result with flush | Method | Mean | Error | StdDev | Allocated | |------------------- |---------:|---------:|---------:|----------:| | KafkaProducerSync | 15.90 ms | 0.216 ms | 0.192 ms | 6.32 KB | | KafkaProducerAsync | 15.55 ms | 0.214 ms | 0.200 ms | 6.77 KB |
