SlideShare a Scribd company logo
1 of 33
Download to read offline
Confidential │ ©2021 VMware, Inc.
Walking through the Spring
Stack for Apache Kafka
Kafka Summit London
April 25-26, 2022
Confidential │ ©2022 VMware, Inc. 2
About me...
Soby Chacko
Committer - Spring Cloud Stream/Spring
Cloud Data Flow at VMware
Tech lead for Spring Cloud Stream
Kafka/Kafka Streams binders
Twitter: @sobychacko
Github: github.com/sobychacko
Confidential │ ©2022 VMware, Inc. 3
Agenda
● Comprehensive look at the Apache Kafka
ecosystem in Spring
● Demo Applications
● Questions
Confidential │ ©2022 VMware, Inc. 4
Spring Stack for Apache Kafka
Spring Boot
Spring for Apache Kafka
Spring Integration Kafka
Spring Cloud Stream Binders for Kafka
and Kafka Streams
Reactor Kafka
Apache Kafka Java Client / Kafka Streams Client
Confidential │ ©2022 VMware, Inc. 5
Spring for Apache Kafka - Top Level Ideas
➔ Foundational library for Apache Kafka in Spring
➔ Spring friendly programming abstractions
➔ Many features that allow developers to focus on the business logic
➔ Provides abstractions for low-level infrastructure concerns
➔ Leverages and builds upon Apache Kafka Java Client / Kafka
Streams
Confidential │ ©2022 VMware, Inc. 6
Spring for Apache Kafka - Topic Management
@Bean
public KafkaAdmin admin() {
Map<String, Object> configs = new HashMap<>();
configs.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
return new KafkaAdmin(configs);
}
@Bean
public NewTopic myTopic() {
return TopicBuilder.name("my-topic")
.partitions(10)
.replicas(3)
.compact()
.build();
}
@Bean
public KafkaAdmin.NewTopics bunchOfTopics() {
return new KafkaAdmin.NewTopics(
TopicBuilder.name("topic1")
.build(),
TopicBuilder.name("topic2")
.replicas(1)
.build(),
TopicBuilder.name("topic3")
.partitions(3)
.build());
}
Confidential │ ©2022 VMware, Inc. 7
Publishing Records using KafkaTemplate API
KafkaTemplate provides a wide variety of template methods to publish records
ListenableFuture<SendResult<K, V>> sendDefault(K key, V data);
ListenableFuture<SendResult<K, V>> send(String topic, K key, V data);
ListenableFuture<SendResult<K, V>> send(String topic, Integer partition, K key, V data);
Confidential │ ©2022 VMware, Inc. 8
Async Send Example
ListenableFuture<SendResult<Integer, String>> future =
template.send("topic", 1, "data");
future.addCallback(new KafkaSendCallback<Integer, String>() {
@Override
public void onSuccess(SendResult<Integer, String> result) {...}
@Override
public void onFailure(KafkaProducerException ex) {
ProducerRecord<Integer, String> failed = ex.getFailedProducerRecord();
...
}
});
Confidential │ ©2022 VMware, Inc. 9
Producer Factory
● KafkaTemplate uses the producer factory for creating the producer
● Spring Boot auto-configures a producer factory bean
● Applications can provide custom producer factories
@Bean
public ProducerFactory<?, ?> kafkaProducerFactory() {
DefaultKafkaProducerFactory<?, ?> factory = new DefaultKafkaProducerFactory<>(
Map.of(...))
…
return factory;
}
Confidential │ ©2022 VMware, Inc. 10
Consuming Records using KafkaListener
● @KafkaListener annotation provides a lot of flexible options to consume records
from Kafka topics
● @EnableKafka annotation
@KafkaListener(id = "my-group", topics = "my-topic")
public void listen(String in) {
logger.info("Data Received : " + in);
}
Basic KafkaListener
Confidential │ ©2022 VMware, Inc. 11
KafkaListener with More Options
See the reference docs for all the available options of KafkaListener.
@KafkaListener(id = "my-group", topicPartitions =
@TopicPartition(topic = "my-topic", partitionOffsets = {
@PartitionOffset(partition = "0-2", initialOffset = "0"),
@PartitionOffset(partition = "6-9", initialOffset = "0")}),
concurrency = ${config.concurrency}
properties = "key.deserializer:LongDeserializer")
public void listen(String in, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) Long key,
@Header(KafkaHeaders.RECEIVED_PARTITION_ID) int part,
@Header(KafkaHeaders.OFFSET) int offset) {
logger.info( "Data Received : {} with key {} from partition {} and offset {}.",
in, key,part,offset);
}
Confidential │ ©2022 VMware, Inc. 12
KafkaListener on a Class
@KafkaListener(id = "multi", topics = "myTopic")
static class MultiListenerBean {
@KafkaHandler
public void listen1(String foo) {
...
}
@KafkaHandler
public void listen2(Integer bar) {
...
}
@KafkaHandler(isDefault = true)
public void listenDefault(Object object) {
...
}
}
Confidential │ ©2022 VMware, Inc. 13
MessageListenerContainer
● Behind the scenes, KafkaListener uses a MessageListener
Container for accomplishing various tasks such as polling,
committing, error handling etc.
● KafkaMessageListenerContainer - Single listener thread
● ConcurrentKafkaMessageListenerContainer - Multiple listeners
● Spring Boot auto-configures a factory for creating a message listener
container
Confidential │ ©2022 VMware, Inc. 14
MessageListeners
● Spring for Apache Kafka provides various types of message listeners
● Record and Batch based Message Listeners
● onMessage(...) method that gives access to the consumer record
● You can provide your own implementation to the container
● MessageListener
● AcknowledgingMessageListener
● ConsumerAwareMessageListener
● AcknowledgingConsumerAwareMessageListener
● BatchMessageListener
● BatchAcknowledgingMessageListener
● BatchConsumerAwareMessageListener
● BatchAcknowledgingConsumerAwareMessageListener
Confidential │ ©2022 VMware, Inc. 15
Committing the Offsets
● By default, enable.auto.commit is disabled in Spring for Apache
Kafka and the framework is responsible for committing the offsets
● A number of options are available for commits which the applications
can configure on the container through the AckMode property of
ContainerProperties
– RECORD, BATCH, TIME, COUNT, MANUAL,
MANUAL_IMMEDIATE
● Default AckMode is the BATCH
Confidential │ ©2022 VMware, Inc. 16
KafkaListener Example of Manually Acknowledging
@KafkaListener(id = "cat",
topics = "myTopic",
containerFactory =
"kafkaManualAckListenerContainerFactory")
public void listen(String data, Acknowledgment ack) {
…
ack.acknowledge();
}
Confidential │ ©2022 VMware, Inc. 17
Seeking Offsets
● Listener must implement the ConsumerSeekAware interface
● Framework provides a convenient AbstractConsumerSeekAware
● Using the callbacks, the application can do arbitrary seeks such as
seekToBeginning, seekToEnd, seekToRelative, seekToTimestamp
etc.
void registerSeekCallback(ConsumerSeekCallback callback);
void onPartitionsAssigned(Map<TopicPartition, Long> assignments,
ConsumerSeekCallback callback);
void onPartitionsRevoked(Collection<TopicPartition> partitions);
void onIdleContainer(Map<TopicPartition, Long> assignments,
ConsumerSeekCallback callback);
Confidential │ ©2022 VMware, Inc. 18
Container Error Handling
● Container Error Handler - CommonErrorHandler interface
● Default implementation - DefaultErrorHandler
● By default, DefaultErrorHandler provides 10 max attempts and no backoff
● You can provide a custom bean that overrides these defaults
@Bean
public DefaultErrorHandler errorHandler(
DeadletterPublishingRecoverer recoverer) {
DefaultErrorHandler handler = new DefaultErrorHandler(recoverer,
new FixedBackOff(2_000, 2));
handler.addNotRetryableExceptions(IllegalArgumentException.class);
return handler;
}
Confidential │ ©2022 VMware, Inc. 19
ErrorHandlingDeserializer
● Convenient way to catch deserialization errors
● ErrorHandlingDeserializer has delegates to the actual key/value
deserializers
● When deserialization fails, the proper headers are populated with
the exception and the raw data that failed
● Then normal container error handling rules apply
Confidential │ ©2022 VMware, Inc. 20
Extensive Error Handling Options
● Spring for Apache Kafka provides much more features, options and flexibility for
error handling. See the reference documentation for more information.
https://docs.spring.io/spring-kafka/docs/current/reference/html/#annotation-error-handling
● Non Blocking Retries - A feature in active development. See the documentation
section for more details.
https://docs.spring.io/spring-kafka/docs/current/reference/html/#retry-topic
Confidential │ ©2022 VMware, Inc. 21
Testing using EmbeddedKafka Broker
● spring-kafka-test provides a convenient way to test with an embedded broker
● EmbeddedKafka annotation and EmbeddedKafkaBroker for Spring test context with JUnit 5
● For non-spring test context, use the EmbeddedKafkaCondition with JUnit 5
● For JUnit4, use EmbeddedKafkaRule, which is a JUnit4 ClassRule
● More details at:
https://docs.spring.io/spring-kafka/docs/current/reference/html/#embedded-kafka-annotation
@SpringBootTest
@EmbeddedKafka(topics = "my-topic", bootstrapServersProperty =
"spring.kafka.bootstrap-servers")
class SpringKafkaApp1Tests {
@Test
void test(EmbeddedKafkaBroker broker) {
// ...
}
}
Confidential │ ©2022 VMware, Inc. 22
Advanced Spring for Apache Kafka features
● Request/Reply Semantics -
https://docs.spring.io/spring-kafka/docs/current/reference/html/#replyi
ng-template
● Transactions -
https://docs.spring.io/spring-kafka/docs/current/reference/html/#trans
actions
● Kafka Streams Support -
https://docs.spring.io/spring-kafka/docs/current/reference/html/#strea
ms-kafka-streams
Confidential │ ©2022 VMware, Inc. 23
Spring Integration Overview
● Messages and Channels
● Integration Flows
- Spring Integration is used to create complex EIP flows
- Kafka flows can tap into larger flows
● Provides Java Config and DSL
Confidential │ ©2022 VMware, Inc. 24
Spring Integration Kafka Support
● Outbound Channel Adapter – KafkaProducerMessageHandler
● Kafka Message Driven Channel Adapter
● Inbound Channel Adapter - Provides a KafkaMessageSource which
is a pollable channel adapter implementation.
● Outbound Gateway - for request/reply operations
● Inbound Gateway - for request/reply operations
See more details in the reference docs for Spring Integration at
https://docs.spring.io/spring-integration/docs/current/reference/html/kafka.html#kafka
Confidential │ ©2022 VMware, Inc. 25
Spring Cloud Stream Overview
● General purpose framework for writing event driven/stream
processing micro services
● Programming model based on Spring Cloud Function - Java
8 Functions/Function Composition
● Apache Kafka support is built on top of Spring Boot, Spring
for Apache Kafka, Spring Integration and Kafka Streams
Confidential │ ©2022 VMware, Inc. 26
Spring Cloud Stream Kafka Application Architecture
Spring Boot Application
Spring Cloud Stream App Core
Kafka/Kafka Streams Binder
Inputs (Message
Channel/Kafka
Streams)
Outputs(Message
Channel/Kafka
Streams)
Kafka Broker
Spring Integration/Kafka Streams
Spring for Apache Kafka
Confidential │ ©2022 VMware, Inc. 27
Spring Cloud Stream - Kafka Binder
● Auto provisioning of topics
● Producer/Consumer Binding
● Message Converters/Native Serialization
● DLQ Support
● Health checks for the binder
Confidential │ ©2022 VMware, Inc. 28
Spring Cloud Stream Kafka Binder Programming Model
@SpringBootApplication
…
@Bean
public Supplier<Long> currentTime() {
return System::currentTimeMillis;
}
@Bean
public Function<Long, String> convertToUTC() {
return localTime -> formatUTC();
}
@Bean
public Consumer<String> print() {
System.out::println;
}
Confidential │ ©2022 VMware, Inc. 29
Spring Cloud Stream - Kafka Streams Binder
● Built on the Kafka Streams foundations from Spring for Apache
Kafka - StreamsBuilderFactoryBean
● Kafka Streams processors written as Java functions
● KStream, KTable and GlobalKTable bindings
● Serde inference on input/output
● Interactive Query Support
● Multiple functions in the same application
● Function composition
Confidential │ ©2022 VMware, Inc. 30
Examples of Spring Cloud Stream Kafka Streams Functions
@Bean
public Function<KStream<Object, String>, KStream<String, Long>> wordCount()
{
return input -> input
.flatMapValues(value ->
Arrays.asList(value.toLowerCase().split("W+")))
.map((key, value) -> new KeyValue<>(value, value))
.groupByKey()
.windowedBy(TimeWindows.of(Duration.ofSeconds(WINDOW_SIZE_SECONDS)))
.count()
.toStream()
.map((key, value) -> new KeyValue<>(key.key(), value));
}
@Bean
public Consumer<KStream<Object, Long>> logWordCounts() {
return kstream -> kstream.foreach((key, value) -> {
logger.info(String.format("Word counts for: %s t %d", key, value));
});
}
Confidential │ ©2022 VMware, Inc. 31
Resources
Spring for Apache Kafka
Project Site Reference Docs GitHub StackOverflow
Spring Integration Kafka
Project Site Reference Docs GitHub StackOverflow
Spring Cloud Stream
Project Site Reference Docs GitHub StackOverflow
Spring Boot Kafka Docs
Confidential │ ©2021 VMware, Inc. 32
Demo
https://github.com/schacko-samples/kafka-summit-london-2022
Confidential │ ©2021 VMware, Inc. 33

More Related Content

What's hot

Kafka Connect & Streams - the ecosystem around Kafka
Kafka Connect & Streams - the ecosystem around KafkaKafka Connect & Streams - the ecosystem around Kafka
Kafka Connect & Streams - the ecosystem around KafkaGuido Schmutz
 
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안SANG WON PARK
 
Can Apache Kafka Replace a Database?
Can Apache Kafka Replace a Database?Can Apache Kafka Replace a Database?
Can Apache Kafka Replace a Database?Kai Wähner
 
Kafka 101 and Developer Best Practices
Kafka 101 and Developer Best PracticesKafka 101 and Developer Best Practices
Kafka 101 and Developer Best Practicesconfluent
 
The Top 5 Apache Kafka Use Cases and Architectures in 2022
The Top 5 Apache Kafka Use Cases and Architectures in 2022The Top 5 Apache Kafka Use Cases and Architectures in 2022
The Top 5 Apache Kafka Use Cases and Architectures in 2022Kai Wähner
 
Introduction to Kafka Streams
Introduction to Kafka StreamsIntroduction to Kafka Streams
Introduction to Kafka StreamsGuozhang Wang
 
Apache Kafka Fundamentals for Architects, Admins and Developers
Apache Kafka Fundamentals for Architects, Admins and DevelopersApache Kafka Fundamentals for Architects, Admins and Developers
Apache Kafka Fundamentals for Architects, Admins and Developersconfluent
 
Kafka Tutorial - basics of the Kafka streaming platform
Kafka Tutorial - basics of the Kafka streaming platformKafka Tutorial - basics of the Kafka streaming platform
Kafka Tutorial - basics of the Kafka streaming platformJean-Paul Azar
 
Apache Kafka Architecture & Fundamentals Explained
Apache Kafka Architecture & Fundamentals ExplainedApache Kafka Architecture & Fundamentals Explained
Apache Kafka Architecture & Fundamentals Explainedconfluent
 
Kafka connect 101
Kafka connect 101Kafka connect 101
Kafka connect 101Whiteklay
 
Kafka Streams State Stores Being Persistent
Kafka Streams State Stores Being PersistentKafka Streams State Stores Being Persistent
Kafka Streams State Stores Being Persistentconfluent
 
Hello, kafka! (an introduction to apache kafka)
Hello, kafka! (an introduction to apache kafka)Hello, kafka! (an introduction to apache kafka)
Hello, kafka! (an introduction to apache kafka)Timothy Spann
 
Apache Kafka - Martin Podval
Apache Kafka - Martin PodvalApache Kafka - Martin Podval
Apache Kafka - Martin PodvalMartin Podval
 
Dissolving the Problem (Making an ACID-Compliant Database Out of Apache Kafka®)
Dissolving the Problem (Making an ACID-Compliant Database Out of Apache Kafka®)Dissolving the Problem (Making an ACID-Compliant Database Out of Apache Kafka®)
Dissolving the Problem (Making an ACID-Compliant Database Out of Apache Kafka®)confluent
 
Integrating Apache Kafka Into Your Environment
Integrating Apache Kafka Into Your EnvironmentIntegrating Apache Kafka Into Your Environment
Integrating Apache Kafka Into Your Environmentconfluent
 

What's hot (20)

Kafka Connect & Streams - the ecosystem around Kafka
Kafka Connect & Streams - the ecosystem around KafkaKafka Connect & Streams - the ecosystem around Kafka
Kafka Connect & Streams - the ecosystem around Kafka
 
Kafka 101
Kafka 101Kafka 101
Kafka 101
 
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
 
Can Apache Kafka Replace a Database?
Can Apache Kafka Replace a Database?Can Apache Kafka Replace a Database?
Can Apache Kafka Replace a Database?
 
Kafka presentation
Kafka presentationKafka presentation
Kafka presentation
 
Kafka 101 and Developer Best Practices
Kafka 101 and Developer Best PracticesKafka 101 and Developer Best Practices
Kafka 101 and Developer Best Practices
 
The Top 5 Apache Kafka Use Cases and Architectures in 2022
The Top 5 Apache Kafka Use Cases and Architectures in 2022The Top 5 Apache Kafka Use Cases and Architectures in 2022
The Top 5 Apache Kafka Use Cases and Architectures in 2022
 
Introduction to Kafka Streams
Introduction to Kafka StreamsIntroduction to Kafka Streams
Introduction to Kafka Streams
 
Apache Kafka Fundamentals for Architects, Admins and Developers
Apache Kafka Fundamentals for Architects, Admins and DevelopersApache Kafka Fundamentals for Architects, Admins and Developers
Apache Kafka Fundamentals for Architects, Admins and Developers
 
Kafka Tutorial - basics of the Kafka streaming platform
Kafka Tutorial - basics of the Kafka streaming platformKafka Tutorial - basics of the Kafka streaming platform
Kafka Tutorial - basics of the Kafka streaming platform
 
Apache Kafka Architecture & Fundamentals Explained
Apache Kafka Architecture & Fundamentals ExplainedApache Kafka Architecture & Fundamentals Explained
Apache Kafka Architecture & Fundamentals Explained
 
Apache Kafka at LinkedIn
Apache Kafka at LinkedInApache Kafka at LinkedIn
Apache Kafka at LinkedIn
 
Kafka connect 101
Kafka connect 101Kafka connect 101
Kafka connect 101
 
RabbitMQ & Kafka
RabbitMQ & KafkaRabbitMQ & Kafka
RabbitMQ & Kafka
 
Kafka Streams State Stores Being Persistent
Kafka Streams State Stores Being PersistentKafka Streams State Stores Being Persistent
Kafka Streams State Stores Being Persistent
 
Hello, kafka! (an introduction to apache kafka)
Hello, kafka! (an introduction to apache kafka)Hello, kafka! (an introduction to apache kafka)
Hello, kafka! (an introduction to apache kafka)
 
Apache Kafka - Martin Podval
Apache Kafka - Martin PodvalApache Kafka - Martin Podval
Apache Kafka - Martin Podval
 
Dissolving the Problem (Making an ACID-Compliant Database Out of Apache Kafka®)
Dissolving the Problem (Making an ACID-Compliant Database Out of Apache Kafka®)Dissolving the Problem (Making an ACID-Compliant Database Out of Apache Kafka®)
Dissolving the Problem (Making an ACID-Compliant Database Out of Apache Kafka®)
 
Kafka 101
Kafka 101Kafka 101
Kafka 101
 
Integrating Apache Kafka Into Your Environment
Integrating Apache Kafka Into Your EnvironmentIntegrating Apache Kafka Into Your Environment
Integrating Apache Kafka Into Your Environment
 

Similar to Walking through the Spring Stack for Apache Kafka with Soby Chacko | Kafka Summit London 2022

Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMware
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMwareEvent Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMware
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMwareHostedbyConfluent
 
OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...
OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...
OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...NETWAYS
 
Kubernetes 101 and Fun
Kubernetes 101 and FunKubernetes 101 and Fun
Kubernetes 101 and FunQAware GmbH
 
Deploying Flink on Kubernetes - David Anderson
 Deploying Flink on Kubernetes - David Anderson Deploying Flink on Kubernetes - David Anderson
Deploying Flink on Kubernetes - David AndersonVerverica
 
ACRN Kata Container on ACRN
ACRN Kata Container on ACRNACRN Kata Container on ACRN
ACRN Kata Container on ACRNProject ACRN
 
20180607 master your vms with vagrant
20180607 master your vms with vagrant20180607 master your vms with vagrant
20180607 master your vms with vagrantmakker_nl
 
Apache Kafka’s Transactions in the Wild! Developing an exactly-once KafkaSink...
Apache Kafka’s Transactions in the Wild! Developing an exactly-once KafkaSink...Apache Kafka’s Transactions in the Wild! Developing an exactly-once KafkaSink...
Apache Kafka’s Transactions in the Wild! Developing an exactly-once KafkaSink...HostedbyConfluent
 
Scaling an Event-Driven Architecture with IBM and Confluent | Antony Amanse a...
Scaling an Event-Driven Architecture with IBM and Confluent | Antony Amanse a...Scaling an Event-Driven Architecture with IBM and Confluent | Antony Amanse a...
Scaling an Event-Driven Architecture with IBM and Confluent | Antony Amanse a...HostedbyConfluent
 
Kubernetes for the VI Admin
Kubernetes for the VI AdminKubernetes for the VI Admin
Kubernetes for the VI AdminKendrick Coleman
 
Knative goes
 beyond serverless | Alexandre Roman
Knative goes
 beyond serverless | Alexandre RomanKnative goes
 beyond serverless | Alexandre Roman
Knative goes
 beyond serverless | Alexandre RomanKCDItaly
 
Docker Enterprise Workshop - Technical
Docker Enterprise Workshop - TechnicalDocker Enterprise Workshop - Technical
Docker Enterprise Workshop - TechnicalPatrick Chanezon
 
Improving the Accumulo User Experience
 Improving the Accumulo User Experience Improving the Accumulo User Experience
Improving the Accumulo User ExperienceAccumulo Summit
 
Ports, pods and proxies
Ports, pods and proxiesPorts, pods and proxies
Ports, pods and proxiesLibbySchulze
 
Kubernetes 101 VMworld 2019 workshop slides
Kubernetes 101 VMworld 2019 workshop slidesKubernetes 101 VMworld 2019 workshop slides
Kubernetes 101 VMworld 2019 workshop slidesSimone Morellato
 
Node.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechNode.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechChristopher Bumgardner
 
Digital Forensics and Incident Response in The Cloud Part 3
Digital Forensics and Incident Response in The Cloud Part 3Digital Forensics and Incident Response in The Cloud Part 3
Digital Forensics and Incident Response in The Cloud Part 3Velocidex Enterprises
 

Similar to Walking through the Spring Stack for Apache Kafka with Soby Chacko | Kafka Summit London 2022 (20)

Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMware
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMwareEvent Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMware
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMware
 
OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...
OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...
OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...
 
Kubernetes 101 and Fun
Kubernetes 101 and FunKubernetes 101 and Fun
Kubernetes 101 and Fun
 
Kubernetes 101 and Fun
Kubernetes 101 and FunKubernetes 101 and Fun
Kubernetes 101 and Fun
 
Deploying Flink on Kubernetes - David Anderson
 Deploying Flink on Kubernetes - David Anderson Deploying Flink on Kubernetes - David Anderson
Deploying Flink on Kubernetes - David Anderson
 
ACRN Kata Container on ACRN
ACRN Kata Container on ACRNACRN Kata Container on ACRN
ACRN Kata Container on ACRN
 
20180607 master your vms with vagrant
20180607 master your vms with vagrant20180607 master your vms with vagrant
20180607 master your vms with vagrant
 
Make Accelerator Pluggable for Container Engine
Make Accelerator Pluggable for Container EngineMake Accelerator Pluggable for Container Engine
Make Accelerator Pluggable for Container Engine
 
Apache Kafka’s Transactions in the Wild! Developing an exactly-once KafkaSink...
Apache Kafka’s Transactions in the Wild! Developing an exactly-once KafkaSink...Apache Kafka’s Transactions in the Wild! Developing an exactly-once KafkaSink...
Apache Kafka’s Transactions in the Wild! Developing an exactly-once KafkaSink...
 
Scaling an Event-Driven Architecture with IBM and Confluent | Antony Amanse a...
Scaling an Event-Driven Architecture with IBM and Confluent | Antony Amanse a...Scaling an Event-Driven Architecture with IBM and Confluent | Antony Amanse a...
Scaling an Event-Driven Architecture with IBM and Confluent | Antony Amanse a...
 
Kubernetes for the VI Admin
Kubernetes for the VI AdminKubernetes for the VI Admin
Kubernetes for the VI Admin
 
Vagrant
VagrantVagrant
Vagrant
 
Vagrant Up in 5 Easy Steps
Vagrant Up in 5 Easy StepsVagrant Up in 5 Easy Steps
Vagrant Up in 5 Easy Steps
 
Knative goes
 beyond serverless | Alexandre Roman
Knative goes
 beyond serverless | Alexandre RomanKnative goes
 beyond serverless | Alexandre Roman
Knative goes
 beyond serverless | Alexandre Roman
 
Docker Enterprise Workshop - Technical
Docker Enterprise Workshop - TechnicalDocker Enterprise Workshop - Technical
Docker Enterprise Workshop - Technical
 
Improving the Accumulo User Experience
 Improving the Accumulo User Experience Improving the Accumulo User Experience
Improving the Accumulo User Experience
 
Ports, pods and proxies
Ports, pods and proxiesPorts, pods and proxies
Ports, pods and proxies
 
Kubernetes 101 VMworld 2019 workshop slides
Kubernetes 101 VMworld 2019 workshop slidesKubernetes 101 VMworld 2019 workshop slides
Kubernetes 101 VMworld 2019 workshop slides
 
Node.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechNode.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ Benetech
 
Digital Forensics and Incident Response in The Cloud Part 3
Digital Forensics and Incident Response in The Cloud Part 3Digital Forensics and Incident Response in The Cloud Part 3
Digital Forensics and Incident Response in The Cloud Part 3
 

More from HostedbyConfluent

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Renaming a Kafka Topic | Kafka Summit London
Renaming a Kafka Topic | Kafka Summit LondonRenaming a Kafka Topic | Kafka Summit London
Renaming a Kafka Topic | Kafka Summit LondonHostedbyConfluent
 
Evolution of NRT Data Ingestion Pipeline at Trendyol
Evolution of NRT Data Ingestion Pipeline at TrendyolEvolution of NRT Data Ingestion Pipeline at Trendyol
Evolution of NRT Data Ingestion Pipeline at TrendyolHostedbyConfluent
 
Ensuring Kafka Service Resilience: A Dive into Health-Checking Techniques
Ensuring Kafka Service Resilience: A Dive into Health-Checking TechniquesEnsuring Kafka Service Resilience: A Dive into Health-Checking Techniques
Ensuring Kafka Service Resilience: A Dive into Health-Checking TechniquesHostedbyConfluent
 
Exactly-once Stream Processing with Arroyo and Kafka
Exactly-once Stream Processing with Arroyo and KafkaExactly-once Stream Processing with Arroyo and Kafka
Exactly-once Stream Processing with Arroyo and KafkaHostedbyConfluent
 
Fish Plays Pokemon | Kafka Summit London
Fish Plays Pokemon | Kafka Summit LondonFish Plays Pokemon | Kafka Summit London
Fish Plays Pokemon | Kafka Summit LondonHostedbyConfluent
 
Tiered Storage 101 | Kafla Summit London
Tiered Storage 101 | Kafla Summit LondonTiered Storage 101 | Kafla Summit London
Tiered Storage 101 | Kafla Summit LondonHostedbyConfluent
 
Building a Self-Service Stream Processing Portal: How And Why
Building a Self-Service Stream Processing Portal: How And WhyBuilding a Self-Service Stream Processing Portal: How And Why
Building a Self-Service Stream Processing Portal: How And WhyHostedbyConfluent
 
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...HostedbyConfluent
 
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...HostedbyConfluent
 
Navigating Private Network Connectivity Options for Kafka Clusters
Navigating Private Network Connectivity Options for Kafka ClustersNavigating Private Network Connectivity Options for Kafka Clusters
Navigating Private Network Connectivity Options for Kafka ClustersHostedbyConfluent
 
Apache Flink: Building a Company-wide Self-service Streaming Data Platform
Apache Flink: Building a Company-wide Self-service Streaming Data PlatformApache Flink: Building a Company-wide Self-service Streaming Data Platform
Apache Flink: Building a Company-wide Self-service Streaming Data PlatformHostedbyConfluent
 
Explaining How Real-Time GenAI Works in a Noisy Pub
Explaining How Real-Time GenAI Works in a Noisy PubExplaining How Real-Time GenAI Works in a Noisy Pub
Explaining How Real-Time GenAI Works in a Noisy PubHostedbyConfluent
 
TL;DR Kafka Metrics | Kafka Summit London
TL;DR Kafka Metrics | Kafka Summit LondonTL;DR Kafka Metrics | Kafka Summit London
TL;DR Kafka Metrics | Kafka Summit LondonHostedbyConfluent
 
A Window Into Your Kafka Streams Tasks | KSL
A Window Into Your Kafka Streams Tasks | KSLA Window Into Your Kafka Streams Tasks | KSL
A Window Into Your Kafka Streams Tasks | KSLHostedbyConfluent
 
Mastering Kafka Producer Configs: A Guide to Optimizing Performance
Mastering Kafka Producer Configs: A Guide to Optimizing PerformanceMastering Kafka Producer Configs: A Guide to Optimizing Performance
Mastering Kafka Producer Configs: A Guide to Optimizing PerformanceHostedbyConfluent
 
Data Contracts Management: Schema Registry and Beyond
Data Contracts Management: Schema Registry and BeyondData Contracts Management: Schema Registry and Beyond
Data Contracts Management: Schema Registry and BeyondHostedbyConfluent
 
Code-First Approach: Crafting Efficient Flink Apps
Code-First Approach: Crafting Efficient Flink AppsCode-First Approach: Crafting Efficient Flink Apps
Code-First Approach: Crafting Efficient Flink AppsHostedbyConfluent
 
Debezium vs. the World: An Overview of the CDC Ecosystem
Debezium vs. the World: An Overview of the CDC EcosystemDebezium vs. the World: An Overview of the CDC Ecosystem
Debezium vs. the World: An Overview of the CDC EcosystemHostedbyConfluent
 
Beyond Tiered Storage: Serverless Kafka with No Local Disks
Beyond Tiered Storage: Serverless Kafka with No Local DisksBeyond Tiered Storage: Serverless Kafka with No Local Disks
Beyond Tiered Storage: Serverless Kafka with No Local DisksHostedbyConfluent
 

More from HostedbyConfluent (20)

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Renaming a Kafka Topic | Kafka Summit London
Renaming a Kafka Topic | Kafka Summit LondonRenaming a Kafka Topic | Kafka Summit London
Renaming a Kafka Topic | Kafka Summit London
 
Evolution of NRT Data Ingestion Pipeline at Trendyol
Evolution of NRT Data Ingestion Pipeline at TrendyolEvolution of NRT Data Ingestion Pipeline at Trendyol
Evolution of NRT Data Ingestion Pipeline at Trendyol
 
Ensuring Kafka Service Resilience: A Dive into Health-Checking Techniques
Ensuring Kafka Service Resilience: A Dive into Health-Checking TechniquesEnsuring Kafka Service Resilience: A Dive into Health-Checking Techniques
Ensuring Kafka Service Resilience: A Dive into Health-Checking Techniques
 
Exactly-once Stream Processing with Arroyo and Kafka
Exactly-once Stream Processing with Arroyo and KafkaExactly-once Stream Processing with Arroyo and Kafka
Exactly-once Stream Processing with Arroyo and Kafka
 
Fish Plays Pokemon | Kafka Summit London
Fish Plays Pokemon | Kafka Summit LondonFish Plays Pokemon | Kafka Summit London
Fish Plays Pokemon | Kafka Summit London
 
Tiered Storage 101 | Kafla Summit London
Tiered Storage 101 | Kafla Summit LondonTiered Storage 101 | Kafla Summit London
Tiered Storage 101 | Kafla Summit London
 
Building a Self-Service Stream Processing Portal: How And Why
Building a Self-Service Stream Processing Portal: How And WhyBuilding a Self-Service Stream Processing Portal: How And Why
Building a Self-Service Stream Processing Portal: How And Why
 
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
 
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
 
Navigating Private Network Connectivity Options for Kafka Clusters
Navigating Private Network Connectivity Options for Kafka ClustersNavigating Private Network Connectivity Options for Kafka Clusters
Navigating Private Network Connectivity Options for Kafka Clusters
 
Apache Flink: Building a Company-wide Self-service Streaming Data Platform
Apache Flink: Building a Company-wide Self-service Streaming Data PlatformApache Flink: Building a Company-wide Self-service Streaming Data Platform
Apache Flink: Building a Company-wide Self-service Streaming Data Platform
 
Explaining How Real-Time GenAI Works in a Noisy Pub
Explaining How Real-Time GenAI Works in a Noisy PubExplaining How Real-Time GenAI Works in a Noisy Pub
Explaining How Real-Time GenAI Works in a Noisy Pub
 
TL;DR Kafka Metrics | Kafka Summit London
TL;DR Kafka Metrics | Kafka Summit LondonTL;DR Kafka Metrics | Kafka Summit London
TL;DR Kafka Metrics | Kafka Summit London
 
A Window Into Your Kafka Streams Tasks | KSL
A Window Into Your Kafka Streams Tasks | KSLA Window Into Your Kafka Streams Tasks | KSL
A Window Into Your Kafka Streams Tasks | KSL
 
Mastering Kafka Producer Configs: A Guide to Optimizing Performance
Mastering Kafka Producer Configs: A Guide to Optimizing PerformanceMastering Kafka Producer Configs: A Guide to Optimizing Performance
Mastering Kafka Producer Configs: A Guide to Optimizing Performance
 
Data Contracts Management: Schema Registry and Beyond
Data Contracts Management: Schema Registry and BeyondData Contracts Management: Schema Registry and Beyond
Data Contracts Management: Schema Registry and Beyond
 
Code-First Approach: Crafting Efficient Flink Apps
Code-First Approach: Crafting Efficient Flink AppsCode-First Approach: Crafting Efficient Flink Apps
Code-First Approach: Crafting Efficient Flink Apps
 
Debezium vs. the World: An Overview of the CDC Ecosystem
Debezium vs. the World: An Overview of the CDC EcosystemDebezium vs. the World: An Overview of the CDC Ecosystem
Debezium vs. the World: An Overview of the CDC Ecosystem
 
Beyond Tiered Storage: Serverless Kafka with No Local Disks
Beyond Tiered Storage: Serverless Kafka with No Local DisksBeyond Tiered Storage: Serverless Kafka with No Local Disks
Beyond Tiered Storage: Serverless Kafka with No Local Disks
 

Recently uploaded

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 

Recently uploaded (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 

Walking through the Spring Stack for Apache Kafka with Soby Chacko | Kafka Summit London 2022

  • 1. Confidential │ ©2021 VMware, Inc. Walking through the Spring Stack for Apache Kafka Kafka Summit London April 25-26, 2022
  • 2. Confidential │ ©2022 VMware, Inc. 2 About me... Soby Chacko Committer - Spring Cloud Stream/Spring Cloud Data Flow at VMware Tech lead for Spring Cloud Stream Kafka/Kafka Streams binders Twitter: @sobychacko Github: github.com/sobychacko
  • 3. Confidential │ ©2022 VMware, Inc. 3 Agenda ● Comprehensive look at the Apache Kafka ecosystem in Spring ● Demo Applications ● Questions
  • 4. Confidential │ ©2022 VMware, Inc. 4 Spring Stack for Apache Kafka Spring Boot Spring for Apache Kafka Spring Integration Kafka Spring Cloud Stream Binders for Kafka and Kafka Streams Reactor Kafka Apache Kafka Java Client / Kafka Streams Client
  • 5. Confidential │ ©2022 VMware, Inc. 5 Spring for Apache Kafka - Top Level Ideas ➔ Foundational library for Apache Kafka in Spring ➔ Spring friendly programming abstractions ➔ Many features that allow developers to focus on the business logic ➔ Provides abstractions for low-level infrastructure concerns ➔ Leverages and builds upon Apache Kafka Java Client / Kafka Streams
  • 6. Confidential │ ©2022 VMware, Inc. 6 Spring for Apache Kafka - Topic Management @Bean public KafkaAdmin admin() { Map<String, Object> configs = new HashMap<>(); configs.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092"); return new KafkaAdmin(configs); } @Bean public NewTopic myTopic() { return TopicBuilder.name("my-topic") .partitions(10) .replicas(3) .compact() .build(); } @Bean public KafkaAdmin.NewTopics bunchOfTopics() { return new KafkaAdmin.NewTopics( TopicBuilder.name("topic1") .build(), TopicBuilder.name("topic2") .replicas(1) .build(), TopicBuilder.name("topic3") .partitions(3) .build()); }
  • 7. Confidential │ ©2022 VMware, Inc. 7 Publishing Records using KafkaTemplate API KafkaTemplate provides a wide variety of template methods to publish records ListenableFuture<SendResult<K, V>> sendDefault(K key, V data); ListenableFuture<SendResult<K, V>> send(String topic, K key, V data); ListenableFuture<SendResult<K, V>> send(String topic, Integer partition, K key, V data);
  • 8. Confidential │ ©2022 VMware, Inc. 8 Async Send Example ListenableFuture<SendResult<Integer, String>> future = template.send("topic", 1, "data"); future.addCallback(new KafkaSendCallback<Integer, String>() { @Override public void onSuccess(SendResult<Integer, String> result) {...} @Override public void onFailure(KafkaProducerException ex) { ProducerRecord<Integer, String> failed = ex.getFailedProducerRecord(); ... } });
  • 9. Confidential │ ©2022 VMware, Inc. 9 Producer Factory ● KafkaTemplate uses the producer factory for creating the producer ● Spring Boot auto-configures a producer factory bean ● Applications can provide custom producer factories @Bean public ProducerFactory<?, ?> kafkaProducerFactory() { DefaultKafkaProducerFactory<?, ?> factory = new DefaultKafkaProducerFactory<>( Map.of(...)) … return factory; }
  • 10. Confidential │ ©2022 VMware, Inc. 10 Consuming Records using KafkaListener ● @KafkaListener annotation provides a lot of flexible options to consume records from Kafka topics ● @EnableKafka annotation @KafkaListener(id = "my-group", topics = "my-topic") public void listen(String in) { logger.info("Data Received : " + in); } Basic KafkaListener
  • 11. Confidential │ ©2022 VMware, Inc. 11 KafkaListener with More Options See the reference docs for all the available options of KafkaListener. @KafkaListener(id = "my-group", topicPartitions = @TopicPartition(topic = "my-topic", partitionOffsets = { @PartitionOffset(partition = "0-2", initialOffset = "0"), @PartitionOffset(partition = "6-9", initialOffset = "0")}), concurrency = ${config.concurrency} properties = "key.deserializer:LongDeserializer") public void listen(String in, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) Long key, @Header(KafkaHeaders.RECEIVED_PARTITION_ID) int part, @Header(KafkaHeaders.OFFSET) int offset) { logger.info( "Data Received : {} with key {} from partition {} and offset {}.", in, key,part,offset); }
  • 12. Confidential │ ©2022 VMware, Inc. 12 KafkaListener on a Class @KafkaListener(id = "multi", topics = "myTopic") static class MultiListenerBean { @KafkaHandler public void listen1(String foo) { ... } @KafkaHandler public void listen2(Integer bar) { ... } @KafkaHandler(isDefault = true) public void listenDefault(Object object) { ... } }
  • 13. Confidential │ ©2022 VMware, Inc. 13 MessageListenerContainer ● Behind the scenes, KafkaListener uses a MessageListener Container for accomplishing various tasks such as polling, committing, error handling etc. ● KafkaMessageListenerContainer - Single listener thread ● ConcurrentKafkaMessageListenerContainer - Multiple listeners ● Spring Boot auto-configures a factory for creating a message listener container
  • 14. Confidential │ ©2022 VMware, Inc. 14 MessageListeners ● Spring for Apache Kafka provides various types of message listeners ● Record and Batch based Message Listeners ● onMessage(...) method that gives access to the consumer record ● You can provide your own implementation to the container ● MessageListener ● AcknowledgingMessageListener ● ConsumerAwareMessageListener ● AcknowledgingConsumerAwareMessageListener ● BatchMessageListener ● BatchAcknowledgingMessageListener ● BatchConsumerAwareMessageListener ● BatchAcknowledgingConsumerAwareMessageListener
  • 15. Confidential │ ©2022 VMware, Inc. 15 Committing the Offsets ● By default, enable.auto.commit is disabled in Spring for Apache Kafka and the framework is responsible for committing the offsets ● A number of options are available for commits which the applications can configure on the container through the AckMode property of ContainerProperties – RECORD, BATCH, TIME, COUNT, MANUAL, MANUAL_IMMEDIATE ● Default AckMode is the BATCH
  • 16. Confidential │ ©2022 VMware, Inc. 16 KafkaListener Example of Manually Acknowledging @KafkaListener(id = "cat", topics = "myTopic", containerFactory = "kafkaManualAckListenerContainerFactory") public void listen(String data, Acknowledgment ack) { … ack.acknowledge(); }
  • 17. Confidential │ ©2022 VMware, Inc. 17 Seeking Offsets ● Listener must implement the ConsumerSeekAware interface ● Framework provides a convenient AbstractConsumerSeekAware ● Using the callbacks, the application can do arbitrary seeks such as seekToBeginning, seekToEnd, seekToRelative, seekToTimestamp etc. void registerSeekCallback(ConsumerSeekCallback callback); void onPartitionsAssigned(Map<TopicPartition, Long> assignments, ConsumerSeekCallback callback); void onPartitionsRevoked(Collection<TopicPartition> partitions); void onIdleContainer(Map<TopicPartition, Long> assignments, ConsumerSeekCallback callback);
  • 18. Confidential │ ©2022 VMware, Inc. 18 Container Error Handling ● Container Error Handler - CommonErrorHandler interface ● Default implementation - DefaultErrorHandler ● By default, DefaultErrorHandler provides 10 max attempts and no backoff ● You can provide a custom bean that overrides these defaults @Bean public DefaultErrorHandler errorHandler( DeadletterPublishingRecoverer recoverer) { DefaultErrorHandler handler = new DefaultErrorHandler(recoverer, new FixedBackOff(2_000, 2)); handler.addNotRetryableExceptions(IllegalArgumentException.class); return handler; }
  • 19. Confidential │ ©2022 VMware, Inc. 19 ErrorHandlingDeserializer ● Convenient way to catch deserialization errors ● ErrorHandlingDeserializer has delegates to the actual key/value deserializers ● When deserialization fails, the proper headers are populated with the exception and the raw data that failed ● Then normal container error handling rules apply
  • 20. Confidential │ ©2022 VMware, Inc. 20 Extensive Error Handling Options ● Spring for Apache Kafka provides much more features, options and flexibility for error handling. See the reference documentation for more information. https://docs.spring.io/spring-kafka/docs/current/reference/html/#annotation-error-handling ● Non Blocking Retries - A feature in active development. See the documentation section for more details. https://docs.spring.io/spring-kafka/docs/current/reference/html/#retry-topic
  • 21. Confidential │ ©2022 VMware, Inc. 21 Testing using EmbeddedKafka Broker ● spring-kafka-test provides a convenient way to test with an embedded broker ● EmbeddedKafka annotation and EmbeddedKafkaBroker for Spring test context with JUnit 5 ● For non-spring test context, use the EmbeddedKafkaCondition with JUnit 5 ● For JUnit4, use EmbeddedKafkaRule, which is a JUnit4 ClassRule ● More details at: https://docs.spring.io/spring-kafka/docs/current/reference/html/#embedded-kafka-annotation @SpringBootTest @EmbeddedKafka(topics = "my-topic", bootstrapServersProperty = "spring.kafka.bootstrap-servers") class SpringKafkaApp1Tests { @Test void test(EmbeddedKafkaBroker broker) { // ... } }
  • 22. Confidential │ ©2022 VMware, Inc. 22 Advanced Spring for Apache Kafka features ● Request/Reply Semantics - https://docs.spring.io/spring-kafka/docs/current/reference/html/#replyi ng-template ● Transactions - https://docs.spring.io/spring-kafka/docs/current/reference/html/#trans actions ● Kafka Streams Support - https://docs.spring.io/spring-kafka/docs/current/reference/html/#strea ms-kafka-streams
  • 23. Confidential │ ©2022 VMware, Inc. 23 Spring Integration Overview ● Messages and Channels ● Integration Flows - Spring Integration is used to create complex EIP flows - Kafka flows can tap into larger flows ● Provides Java Config and DSL
  • 24. Confidential │ ©2022 VMware, Inc. 24 Spring Integration Kafka Support ● Outbound Channel Adapter – KafkaProducerMessageHandler ● Kafka Message Driven Channel Adapter ● Inbound Channel Adapter - Provides a KafkaMessageSource which is a pollable channel adapter implementation. ● Outbound Gateway - for request/reply operations ● Inbound Gateway - for request/reply operations See more details in the reference docs for Spring Integration at https://docs.spring.io/spring-integration/docs/current/reference/html/kafka.html#kafka
  • 25. Confidential │ ©2022 VMware, Inc. 25 Spring Cloud Stream Overview ● General purpose framework for writing event driven/stream processing micro services ● Programming model based on Spring Cloud Function - Java 8 Functions/Function Composition ● Apache Kafka support is built on top of Spring Boot, Spring for Apache Kafka, Spring Integration and Kafka Streams
  • 26. Confidential │ ©2022 VMware, Inc. 26 Spring Cloud Stream Kafka Application Architecture Spring Boot Application Spring Cloud Stream App Core Kafka/Kafka Streams Binder Inputs (Message Channel/Kafka Streams) Outputs(Message Channel/Kafka Streams) Kafka Broker Spring Integration/Kafka Streams Spring for Apache Kafka
  • 27. Confidential │ ©2022 VMware, Inc. 27 Spring Cloud Stream - Kafka Binder ● Auto provisioning of topics ● Producer/Consumer Binding ● Message Converters/Native Serialization ● DLQ Support ● Health checks for the binder
  • 28. Confidential │ ©2022 VMware, Inc. 28 Spring Cloud Stream Kafka Binder Programming Model @SpringBootApplication … @Bean public Supplier<Long> currentTime() { return System::currentTimeMillis; } @Bean public Function<Long, String> convertToUTC() { return localTime -> formatUTC(); } @Bean public Consumer<String> print() { System.out::println; }
  • 29. Confidential │ ©2022 VMware, Inc. 29 Spring Cloud Stream - Kafka Streams Binder ● Built on the Kafka Streams foundations from Spring for Apache Kafka - StreamsBuilderFactoryBean ● Kafka Streams processors written as Java functions ● KStream, KTable and GlobalKTable bindings ● Serde inference on input/output ● Interactive Query Support ● Multiple functions in the same application ● Function composition
  • 30. Confidential │ ©2022 VMware, Inc. 30 Examples of Spring Cloud Stream Kafka Streams Functions @Bean public Function<KStream<Object, String>, KStream<String, Long>> wordCount() { return input -> input .flatMapValues(value -> Arrays.asList(value.toLowerCase().split("W+"))) .map((key, value) -> new KeyValue<>(value, value)) .groupByKey() .windowedBy(TimeWindows.of(Duration.ofSeconds(WINDOW_SIZE_SECONDS))) .count() .toStream() .map((key, value) -> new KeyValue<>(key.key(), value)); } @Bean public Consumer<KStream<Object, Long>> logWordCounts() { return kstream -> kstream.foreach((key, value) -> { logger.info(String.format("Word counts for: %s t %d", key, value)); }); }
  • 31. Confidential │ ©2022 VMware, Inc. 31 Resources Spring for Apache Kafka Project Site Reference Docs GitHub StackOverflow Spring Integration Kafka Project Site Reference Docs GitHub StackOverflow Spring Cloud Stream Project Site Reference Docs GitHub StackOverflow Spring Boot Kafka Docs
  • 32. Confidential │ ©2021 VMware, Inc. 32 Demo https://github.com/schacko-samples/kafka-summit-london-2022
  • 33. Confidential │ ©2021 VMware, Inc. 33