How to read Kafka Message Key from Spring cloud streams?

How to read Kafka Message Key from Spring cloud streams?

<strong><em>enter code here</em></strong> I am using spring cloud streams to consume a message from Kafka.

enter code here I am using spring cloud streams to consume a message from Kafka.

Is it possible to read the Kafka Message Key from the code?

I have a Kafka topic that generally has 2 types of messages. The action to be taken varies depending on the message key. I see the spring documentation has only the following to read the message. Here, I need to specify the actual mapping of the message (Greetings class here). However, I need a way through which I can read the message key and determine the deserializable Pojo

public class GreetingsListener {

@StreamListener(GreetingsProcessor.INPUT)
public void handleGreetings(@Payload Greetings request) {

}


spring apache

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Apache Ignite With Spring Data

In this tutorial, we will learn how to integrate Spring Data API with Apache Ignite. To learn about Apache Ignite do check What is Apache Ignite?

Spring | Spring JDBC Tutorial | Java Spring Tutorial Spring Training

Spring | Spring JDBC Tutorial | Java Spring Tutorial Spring Training . Spring Framework Certification Training This post Spring JDBC Tutorial video will help you

Spring Live | Introduction to Spring Framework | Java Spring Tutorial | Spring Training

Spring Live , Introduction to Spring Framework, Java Spring Tutorial ,Spring Training .Spring Framework Certification Training "Introduction to Spring Framework"

Spring Boot Tutorials - Spring Boot Full Course

Spring Boot Tutorials | Full Course - What is Spring? Spring Boot is an open source Java-based framework used to create a Micro Service. Spring Boot contains a comprehensive infrastructure support for developing a micro service and enables you to develop enterprise-ready applications that you can “just run”.

Build Runnable Jar of Spring Boot App using Apache Maven

In this video you will learn to create executable Jar file of Spring Boot Application using Apache Maven. This jar file you can run as stand alone application and you can deploy this jar file anywhere.