SlideShare a Scribd company logo
13
Most read
19
Most read
20
Most read
End-to-end Streaming
Between gRPC Services via Kafka
John Fallows
2
From Northern Ireland, UK
California, USA
Now
Experience John Fallows
CTO @ Aklivity
Serial Entrepreneur
HTML5 Contributor
WebSocket Pioneer
25+ years Java
Author Pro JSF & Ajax
JMS, Kafka, gRPC, MQTT, …
grpc-kafka who am i?
grpc-kafka what is grpc?
❖ open source RPC (Remote Procedure Call) framework
❖ protocol buffers for service definitions
package example;
service EchoService
{
rpc EchoUnary(EchoMessage) returns (EchoMessage);
}
message EchoMessage
{
string message = 1;
}
grpc-kafka why grpc?
❖ strong contract for service definitions
❖ code generation for many languages
❖ protobuf over http/2 optimizes communication
❖ unified http/2 connection per client
grpc-kafka grpc challenges
❖ load balancing, client vs proxy, connection vs rpc
❖ limited browser support, requires proxy
❖ binary message format is not human readable
❖ lack of edge caching
grpc-kafka compare grpc vs kafka
service
service
service
⚙
service
⚙
service
⚙
service
❖ contract
❖ coupling
❖ communication
❖ codec
grpc-kafka integrate grpc + kafka (open source zilla)
Every network and application data flow is a stream.
Streams are composed to create efficient protocol translation pipelines.
shared memory
tcpin
tlsin
httpin
grpcin
kafkaout
tcpout
● Garbage free
● Wait free
● Elastic scalability
● Sliding window flow control
● Multi-core CPU friendly
● Extensible by design
⚙
grpc-kafka unary rpc
package example;
service EchoService
{
rpc EchoUnary(EchoMessage) returns (EchoMessage);
rpc EchoBidiStream(stream EchoMessage) returns (stream EchoMessage);
}
message EchoMessage
{
string message = 1;
}
server
(unary)
grpc-kafka unary rpc
grpc
kafka
kafka
grpc
zilla zilla
kafka
client
(unary)
POST POST
(correlated)
grpc-kafka bidi streaming rpc
package example;
service EchoService
{
rpc EchoUnary(EchoMessage) returns (EchoMessage);
rpc EchoBidiStream(stream EchoMessage) returns (stream EchoMessage);
}
message EchoMessage
{
string message = 1;
}
server
(bidi)
grpc-kafka bidi streaming rpc
grpc
kafka
kafka
grpc
zilla zilla
kafka
client
(bidi)
POST POST
demo
grpc end-to-end streaming via kafka
grpc-kafka integration impact (observe)
HEADERS
:method POST
:path /example.EchoService/EchoBidiStream
content-type: application/grpc
1: {"Hello, world"}
topic: echo-requests
zilla:service example.EchoService
zilla:method EchoBidiStream
zilla:reply-to echo-responses
zilla:correlation-id <UUID>
1: {"Hello, world"}
null
1: {"Hello, again"} 1: {"Hello, again"}
EOS
HEADERS
:status 200
content-type: application/grpc
1: {"Hello, world"}
1: {"Hello, again"}
topic: echo-responses
zilla:service example.EchoService
zilla:method EchoBidiStream
zilla:correlation-id <UUID>
1: {"Hello, world"}
null
1: {"Hello, again"}
TRAILERS
:grpc-status 0
HEADERS
:method POST
:path /example.EchoService/EchoBidiStream
content-type: application/grpc
1: {"Hello, world"}
1: {"Hello, again"}
EOS
HEADERS
:status 200
content-type: application/grp
1: {"Hello, world"}
1: {"Hello, again"}
TRAILERS
:grpc-status 0
grpc-kafka integration impact (reach)
topic: echo-requests
zilla:service example.EchoService
zilla:method EchoBidiStream
zilla:reply-to echo-responses
zilla:correlation-id <UUID>
1: {"Hello, world"}
null
1: {"Hello, again"}
HEADERS
:status 200
content-type: application/grpc
1: {"Hello, world"}
1: {"Hello, again"}
topic: echo-responses
zilla:service example.EchoService
zilla:method EchoBidiStream
zilla:correlation-id <UUID>
1: {"Hello, world"}
null
1: {"Hello, again"}
TRAILERS
:grpc-status 0
HEADERS
:method POST
:path /example.EchoService/EchoBidiStream
content-type: application/grpc
1: {"Hello, world"}
1: {"Hello, again"}
EOS
event
driven
micro
service
grpc-kafka integration impact (migrate)
HEADERS
:method POST
:path /example.EchoService/EchoBidiStream
content-type: application/grpc
1: {"Hello, world"}
topic: echo-requests
zilla:service example.EchoService
zilla:method EchoBidiStream
zilla:reply-to echo-responses
zilla:correlation-id <UUID>
1: {"Hello, world"}
null
1: {"Hello, again"} 1: {"Hello, again"}
EOS
topic: echo-responses
zilla:service example.EchoService
zilla:method EchoBidiStream
zilla:correlation-id <UUID>
1: {"Hello, world"}
null
1: {"Hello, again"}
HEADERS
:status 200
content-type: application/grp
1: {"Hello, world"}
1: {"Hello, again"}
TRAILERS
:grpc-status 0
event
driven
micro
service
grpc-kafka beyond request-response
❖ grpc server streaming from kafka (fanout)
❖ grpc server streaming from kafka (fanout, reliable)
❖ grpc client streaming to kafka (oneway)
❖ grpc client streaming to kafka (oneway, reliable)
grpc-kafka server streaming (fanout)
package example;
import "google/protobuf/empty.proto";
service FanoutService
{
rpc FanoutServerStream(google.protobuf.Empty) returns (stream FanoutMessage);
}
message FanoutMessage
{
string message = 1;
}
grpc-kafka server streaming (fanout)
grpc
kafka
zilla kafka
client
(server streaming)
POST
event
driven
micro
service
grpc-kafka server streaming (fanout, reliable)
HEADERS
:method POST
:path /example.FanoutService/…
content-type: application/grpc
EOS
HEADERS
:status 200
content-type: application/grpc
1: {"Hello, world"}
32767: 0xfda8c…
grpc
kafka
zilla kafka
client
1: {"Hello, again"}
32767: 0xe1ac…
✖
grpc-kafka server streaming (fanout, recovery)
HEADERS
:method POST
:path /example.FanoutService/…
content-type: application/grpc
last-message-id-bin: base64(0xfda8c…)
EOS
HEADERS
:status 200
content-type: application/grp
grpc
kafka
zilla kafka
client
1: {"Hello, again"}
32767: 0xe1ac…
✔
demo
grpc reliable server streaming via kafka
grpc-kafka zilla examples
❖ grpc.kafka.echo
Echoes messages sent to a Kafka topic via gRPC from a gRPC client
❖ grpc.kafka.proxy
Correlates gRPC requests and responses over separate Kafka topics
❖ grpc.kafka.fanout
Streams messages published to a Kafka topic, applying conflation
based on log compaction
❖ …
github.com/aklivity/zilla-examples
grpc-kafka multi-protocol
www.aklivity.io
github.com/aklivity/zilla ★
Q & A
pssst…we have 😎 socks at Booth S11
Stream Data Anywhere.

More Related Content

PPT
Graphql presentation
PDF
GraphQL vs REST
PDF
REST vs GraphQL
PDF
Intro to GraphQL
PDF
Spring Framework - AOP
PDF
What is REST API? REST API Concepts and Examples | Edureka
PDF
MySQL 8.0 EXPLAIN ANALYZE
PDF
REST APIs with Spring
Graphql presentation
GraphQL vs REST
REST vs GraphQL
Intro to GraphQL
Spring Framework - AOP
What is REST API? REST API Concepts and Examples | Edureka
MySQL 8.0 EXPLAIN ANALYZE
REST APIs with Spring

What's hot (20)

PPTX
Introduction to GraphQL
PPSX
Rest api standards and best practices
PPTX
GraphQL Introduction
PDF
Spring Data JPA
PPTX
React Hooks
PPTX
Introduction to GraphQL
PPTX
Intro GraphQL
PPTX
REST API
PDF
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
PPTX
Introduction to graphQL
PPTX
REST API Design & Development
PPTX
Building flexible ETL pipelines with Apache Camel on Quarkus
PPTX
Spring data jpa
PPTX
Introduction to GraphQL Presentation.pptx
PDF
JPA and Hibernate
PPTX
What is gRPC introduction gRPC Explained
PPTX
Introduction to Spring Boot
PPTX
Token Authentication in ASP.NET Core
PPTX
Understanding REST APIs in 5 Simple Steps
PPTX
An intro to GraphQL
Introduction to GraphQL
Rest api standards and best practices
GraphQL Introduction
Spring Data JPA
React Hooks
Introduction to GraphQL
Intro GraphQL
REST API
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
Introduction to graphQL
REST API Design & Development
Building flexible ETL pipelines with Apache Camel on Quarkus
Spring data jpa
Introduction to GraphQL Presentation.pptx
JPA and Hibernate
What is gRPC introduction gRPC Explained
Introduction to Spring Boot
Token Authentication in ASP.NET Core
Understanding REST APIs in 5 Simple Steps
An intro to GraphQL
Ad

Similar to End-to-end Streaming Between gRPC Services Via Kafka with John Fallows (20)

PDF
Inter-Process Communication in Microservices using gRPC
PDF
grpc-Malmo.pdf
PDF
"gRPC-Web: It’s All About Communication": Devoxx Belgium 2019
PDF
Microservices Communication Patterns with gRPC
PDF
"gRPC-Web: It’s All About Communication": Devoxx Ukraine 2019
PDF
"gRPC-Web: It’s All About Communication": Devoxx Ukraine 2019
PDF
gRPC & Kubernetes
PPTX
CocoaConf: The Language of Mobile Software is APIs
PPTX
Introduction to gRPC. Advantages and Disadvantages
PDF
Fast and Reliable Swift APIs with gRPC
PPTX
gRPC - Fastest Data Transfer Protocol
PDF
gRPC - RPC rebirth?
PDF
gRPC - czyli jak skutecznie rozmawiać (rg-dev#14)
PDF
Running gRPC Services for Serving Legacy API on Kubernetes
PDF
Creating Connector to Bridge the Worlds of Kafka and gRPC at Wework (Anoop Di...
PDF
GRPC 101 - DevFest Belgium 2016
PDF
Building Microservices with gRPC and NATS
PDF
REST API vs gRPC, which one should you use in breaking a monolith [Kdg.net 2018]
PDF
Microservices Integration Patterns with Kafka
PPTX
Microservices in a Streaming World
Inter-Process Communication in Microservices using gRPC
grpc-Malmo.pdf
"gRPC-Web: It’s All About Communication": Devoxx Belgium 2019
Microservices Communication Patterns with gRPC
"gRPC-Web: It’s All About Communication": Devoxx Ukraine 2019
"gRPC-Web: It’s All About Communication": Devoxx Ukraine 2019
gRPC & Kubernetes
CocoaConf: The Language of Mobile Software is APIs
Introduction to gRPC. Advantages and Disadvantages
Fast and Reliable Swift APIs with gRPC
gRPC - Fastest Data Transfer Protocol
gRPC - RPC rebirth?
gRPC - czyli jak skutecznie rozmawiać (rg-dev#14)
Running gRPC Services for Serving Legacy API on Kubernetes
Creating Connector to Bridge the Worlds of Kafka and gRPC at Wework (Anoop Di...
GRPC 101 - DevFest Belgium 2016
Building Microservices with gRPC and NATS
REST API vs gRPC, which one should you use in breaking a monolith [Kdg.net 2018]
Microservices Integration Patterns with Kafka
Microservices in a Streaming World
Ad

More from HostedbyConfluent (20)

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

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Spectroscopy.pptx food analysis technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPT
Teaching material agriculture food technology
PDF
KodekX | Application Modernization Development
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Chapter 3 Spatial Domain Image Processing.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
sap open course for s4hana steps from ECC to s4
PDF
cuic standard and advanced reporting.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Encapsulation theory and applications.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Spectroscopy.pptx food analysis technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Advanced methodologies resolving dimensionality complications for autism neur...
Empathic Computing: Creating Shared Understanding
Reach Out and Touch Someone: Haptics and Empathic Computing
Teaching material agriculture food technology
KodekX | Application Modernization Development
Dropbox Q2 2025 Financial Results & Investor Presentation
Chapter 3 Spatial Domain Image Processing.pdf
The AUB Centre for AI in Media Proposal.docx
Network Security Unit 5.pdf for BCA BBA.
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
sap open course for s4hana steps from ECC to s4
cuic standard and advanced reporting.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Understanding_Digital_Forensics_Presentation.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx

End-to-end Streaming Between gRPC Services Via Kafka with John Fallows

  • 1. End-to-end Streaming Between gRPC Services via Kafka John Fallows
  • 2. 2 From Northern Ireland, UK California, USA Now Experience John Fallows CTO @ Aklivity Serial Entrepreneur HTML5 Contributor WebSocket Pioneer 25+ years Java Author Pro JSF & Ajax JMS, Kafka, gRPC, MQTT, … grpc-kafka who am i?
  • 3. grpc-kafka what is grpc? ❖ open source RPC (Remote Procedure Call) framework ❖ protocol buffers for service definitions package example; service EchoService { rpc EchoUnary(EchoMessage) returns (EchoMessage); } message EchoMessage { string message = 1; }
  • 4. grpc-kafka why grpc? ❖ strong contract for service definitions ❖ code generation for many languages ❖ protobuf over http/2 optimizes communication ❖ unified http/2 connection per client
  • 5. grpc-kafka grpc challenges ❖ load balancing, client vs proxy, connection vs rpc ❖ limited browser support, requires proxy ❖ binary message format is not human readable ❖ lack of edge caching
  • 6. grpc-kafka compare grpc vs kafka service service service ⚙ service ⚙ service ⚙ service ❖ contract ❖ coupling ❖ communication ❖ codec
  • 7. grpc-kafka integrate grpc + kafka (open source zilla) Every network and application data flow is a stream. Streams are composed to create efficient protocol translation pipelines. shared memory tcpin tlsin httpin grpcin kafkaout tcpout ● Garbage free ● Wait free ● Elastic scalability ● Sliding window flow control ● Multi-core CPU friendly ● Extensible by design ⚙
  • 8. grpc-kafka unary rpc package example; service EchoService { rpc EchoUnary(EchoMessage) returns (EchoMessage); rpc EchoBidiStream(stream EchoMessage) returns (stream EchoMessage); } message EchoMessage { string message = 1; }
  • 9. server (unary) grpc-kafka unary rpc grpc kafka kafka grpc zilla zilla kafka client (unary) POST POST (correlated)
  • 10. grpc-kafka bidi streaming rpc package example; service EchoService { rpc EchoUnary(EchoMessage) returns (EchoMessage); rpc EchoBidiStream(stream EchoMessage) returns (stream EchoMessage); } message EchoMessage { string message = 1; }
  • 11. server (bidi) grpc-kafka bidi streaming rpc grpc kafka kafka grpc zilla zilla kafka client (bidi) POST POST
  • 13. grpc-kafka integration impact (observe) HEADERS :method POST :path /example.EchoService/EchoBidiStream content-type: application/grpc 1: {"Hello, world"} topic: echo-requests zilla:service example.EchoService zilla:method EchoBidiStream zilla:reply-to echo-responses zilla:correlation-id <UUID> 1: {"Hello, world"} null 1: {"Hello, again"} 1: {"Hello, again"} EOS HEADERS :status 200 content-type: application/grpc 1: {"Hello, world"} 1: {"Hello, again"} topic: echo-responses zilla:service example.EchoService zilla:method EchoBidiStream zilla:correlation-id <UUID> 1: {"Hello, world"} null 1: {"Hello, again"} TRAILERS :grpc-status 0 HEADERS :method POST :path /example.EchoService/EchoBidiStream content-type: application/grpc 1: {"Hello, world"} 1: {"Hello, again"} EOS HEADERS :status 200 content-type: application/grp 1: {"Hello, world"} 1: {"Hello, again"} TRAILERS :grpc-status 0
  • 14. grpc-kafka integration impact (reach) topic: echo-requests zilla:service example.EchoService zilla:method EchoBidiStream zilla:reply-to echo-responses zilla:correlation-id <UUID> 1: {"Hello, world"} null 1: {"Hello, again"} HEADERS :status 200 content-type: application/grpc 1: {"Hello, world"} 1: {"Hello, again"} topic: echo-responses zilla:service example.EchoService zilla:method EchoBidiStream zilla:correlation-id <UUID> 1: {"Hello, world"} null 1: {"Hello, again"} TRAILERS :grpc-status 0 HEADERS :method POST :path /example.EchoService/EchoBidiStream content-type: application/grpc 1: {"Hello, world"} 1: {"Hello, again"} EOS event driven micro service
  • 15. grpc-kafka integration impact (migrate) HEADERS :method POST :path /example.EchoService/EchoBidiStream content-type: application/grpc 1: {"Hello, world"} topic: echo-requests zilla:service example.EchoService zilla:method EchoBidiStream zilla:reply-to echo-responses zilla:correlation-id <UUID> 1: {"Hello, world"} null 1: {"Hello, again"} 1: {"Hello, again"} EOS topic: echo-responses zilla:service example.EchoService zilla:method EchoBidiStream zilla:correlation-id <UUID> 1: {"Hello, world"} null 1: {"Hello, again"} HEADERS :status 200 content-type: application/grp 1: {"Hello, world"} 1: {"Hello, again"} TRAILERS :grpc-status 0 event driven micro service
  • 16. grpc-kafka beyond request-response ❖ grpc server streaming from kafka (fanout) ❖ grpc server streaming from kafka (fanout, reliable) ❖ grpc client streaming to kafka (oneway) ❖ grpc client streaming to kafka (oneway, reliable)
  • 17. grpc-kafka server streaming (fanout) package example; import "google/protobuf/empty.proto"; service FanoutService { rpc FanoutServerStream(google.protobuf.Empty) returns (stream FanoutMessage); } message FanoutMessage { string message = 1; }
  • 18. grpc-kafka server streaming (fanout) grpc kafka zilla kafka client (server streaming) POST event driven micro service
  • 19. grpc-kafka server streaming (fanout, reliable) HEADERS :method POST :path /example.FanoutService/… content-type: application/grpc EOS HEADERS :status 200 content-type: application/grpc 1: {"Hello, world"} 32767: 0xfda8c… grpc kafka zilla kafka client 1: {"Hello, again"} 32767: 0xe1ac… ✖
  • 20. grpc-kafka server streaming (fanout, recovery) HEADERS :method POST :path /example.FanoutService/… content-type: application/grpc last-message-id-bin: base64(0xfda8c…) EOS HEADERS :status 200 content-type: application/grp grpc kafka zilla kafka client 1: {"Hello, again"} 32767: 0xe1ac… ✔
  • 21. demo grpc reliable server streaming via kafka
  • 22. grpc-kafka zilla examples ❖ grpc.kafka.echo Echoes messages sent to a Kafka topic via gRPC from a gRPC client ❖ grpc.kafka.proxy Correlates gRPC requests and responses over separate Kafka topics ❖ grpc.kafka.fanout Streams messages published to a Kafka topic, applying conflation based on log compaction ❖ … github.com/aklivity/zilla-examples
  • 24. www.aklivity.io github.com/aklivity/zilla ★ Q & A pssst…we have 😎 socks at Booth S11 Stream Data Anywhere.