<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/developing-real-time-event-processing-with-micronaut-and-kafka-streams-a-step-by-step-guide-ngulbl70j" -->

---
title: Developing Real-Time Event Processing With Micronaut and...
description: A step-by-step guide to building a real-time word counting application using Micronaut and Kafka Streams in Java. Covers why this combination is effective...
canonical: https://daily.dev/posts/developing-real-time-event-processing-with-micronaut-and-kafka-streams-a-step-by-step-guide-ngulbl70j
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Developing Real-Time Event Processing With Micronaut and Kafka Streams: A Step-by-Step Guide | daily.dev
og:description: A step-by-step guide to building a real-time word counting application using Micronaut and Kafka Streams in Java. Covers why this combination is effective...
og:url: https://daily.dev/posts/developing-real-time-event-processing-with-micronaut-and-kafka-streams-a-step-by-step-guide-ngulbl70j
og:image: https://api.daily.dev/og/posts/nguLBL70J.png
og:image:alt: Developing Real-Time Event Processing With Micronaut and Kafka Streams: A Step-by-Step Guide
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Developing Real-Time Event Processing With Micronaut and Kafka Streams: A Step-by-Step Guide

**[DevOps.com](https://daily.dev/sources/devops)** · 7 min read · 0 upvotes · 0 comments

## Summary

A step-by-step guide to building a real-time word counting application using Micronaut and Kafka Streams in Java. Covers why this combination is effective (compile-time DI, no separate stream processing cluster), project setup with Docker Compose, Kafka Streams topology construction, REST API integration for message ingestion and querying, and common pitfalls like Jackson time serialization issues and null message values when using @KafkaClient. The same patterns apply to financial transactions, IoT data, or user behavior processing.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://devops.com/developing-real-time-event-processing-with-micronaut-and-kafka-streams-a-step-by-step-guide>

## Questions this post answers

### Why does my Kafka Streams application receive null values even though messages appear to be sent successfully via Micronaut's @KafkaClient?

Micronaut's @KafkaClient interface can serialize messages in a way that arrives as null values inside the Kafka Streams processor. Using a direct KafkaProducer<String, String> instead ensures reliable JSON string serialization and avoids this issue, so message ingestion controllers should send records through a manually configured producer rather than the declarative client interface.

_Developers debugging Kafka producer serialization issues can find similar gotchas curated on daily.dev._

### How do I fix a JsonMappingException when deserializing java.time.Instant fields in a Micronaut Kafka Streams application?

Add the jackson-datatype-jsr310 dependency to the project and register the module with the ObjectMapper. Without it, Java 8 time types like java.time.Instant used in message models cannot be deserialized, causing a JsonMappingException when Kafka Streams processes incoming records.

_daily.dev surfaces practical fixes like this for developers wiring up Java serialization with Kafka._

### Do I need a separate cluster to run Kafka Streams applications?

No, Kafka Streams runs as a library embedded directly inside the application rather than requiring a separate processing cluster. This reduces operational overhead while still providing exactly-once processing guarantees, automatic scaling by adding instances, and fault-tolerant state recovery, all within a single JVM alongside a Micronaut REST API.

_Teams weighing embedded versus clustered stream processing can track these architecture trade-offs on daily.dev._

## Similar posts on daily.dev

- [Build a Real-Time E-Commerce Analytics API from Kafka in 15 Minutes](https://daily.dev/posts/build-a-real-time-e-commerce-analytics-api-from-kafka-in-15-minutes-7pkrc958n) · Tinybird · 40 upvotes · 0 comments
- [How to Build Real-Time Data Monetization Systems](https://daily.dev/posts/how-to-build-real-time-data-monetization-systems-vvhzkzryo) · Confluent Blog · 6 upvotes · 0 comments
- [How Kafka Simplifies Application Integration and Modernization](https://daily.dev/posts/how-kafka-simplifies-application-integration-and-modernization-bhey2mlff) · The New Stack · 1 upvotes · 0 comments
- [From REST to Events: Coordinating Microservices with Kafka in Go](https://daily.dev/posts/from-rest-to-events-coordinating-microservices-with-kafka-in-go-hulkv6ltm) · Medium · 3 upvotes · 0 comments

---

Tags: [#java](https://daily.dev/tags/java), [#kafka](https://daily.dev/tags/kafka), [#apache-kafka](https://daily.dev/tags/apache-kafka)

[View this post on daily.dev](https://daily.dev/posts/developing-real-time-event-processing-with-micronaut-and-kafka-streams-a-step-by-step-guide-ngulbl70j)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Developing Real-Time Event Processing With Micronaut and Kafka Streams: A Step-by-Step Guide","url":"https://daily.dev/posts/developing-real-time-event-processing-with-micronaut-and-kafka-streams-a-step-by-step-guide-ngulbl70j","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/developing-real-time-event-processing-with-micronaut-and-kafka-streams-a-step-by-step-guide-ngulbl70j"},"datePublished":"2026-07-09T07:52:44.574Z","dateModified":"2026-09-13T18:50:42.919Z","description":"A step-by-step guide to building a real-time word counting application using Micronaut and Kafka Streams in Java. Covers why this combination is effective...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/05e7f124f847b4eec8fa7c8a21173e13?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/05e7f124f847b4eec8fa7c8a21173e13?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"DevOps.com","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"DevOps.com","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/db8f2265cff0416c878c6e7e92bb8715","url":"https://daily.dev/sources/devops"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/developing-real-time-event-processing-with-micronaut-and-kafka-streams-a-step-by-step-guide-ngulbl70j","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"java,kafka,apache-kafka","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"DevOps.com","item":"https://daily.dev/sources/devops"},{"@type":"ListItem","position":3,"name":"Developing Real-Time Event Processing With Micronaut and Kafka Streams: A Step-by-Step Guide"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/developing-real-time-event-processing-with-micronaut-and-kafka-streams-a-step-by-step-guide-ngulbl70j#faq","mainEntity":[{"@type":"Question","name":"Why does my Kafka Streams application receive null values even though messages appear to be sent successfully via Micronaut's @KafkaClient?","acceptedAnswer":{"@type":"Answer","text":"Micronaut's @KafkaClient interface can serialize messages in a way that arrives as null values inside the Kafka Streams processor. Using a direct KafkaProducer<String, String> instead ensures reliable JSON string serialization and avoids this issue, so message ingestion controllers should send records through a manually configured producer rather than the declarative client interface. Developers debugging Kafka producer serialization issues can find similar gotchas curated on daily.dev."}},{"@type":"Question","name":"How do I fix a JsonMappingException when deserializing java.time.Instant fields in a Micronaut Kafka Streams application?","acceptedAnswer":{"@type":"Answer","text":"Add the jackson-datatype-jsr310 dependency to the project and register the module with the ObjectMapper. Without it, Java 8 time types like java.time.Instant used in message models cannot be deserialized, causing a JsonMappingException when Kafka Streams processes incoming records. daily.dev surfaces practical fixes like this for developers wiring up Java serialization with Kafka."}},{"@type":"Question","name":"Do I need a separate cluster to run Kafka Streams applications?","acceptedAnswer":{"@type":"Answer","text":"No, Kafka Streams runs as a library embedded directly inside the application rather than requiring a separate processing cluster. This reduces operational overhead while still providing exactly-once processing guarantees, automatic scaling by adding instances, and fault-tolerant state recovery, all within a single JVM alongside a Micronaut REST API. Teams weighing embedded versus clustered stream processing can track these architecture trade-offs on daily.dev."}}]}
```

