Top Banner
albertlaszlorobert #VoxxedVienna Microservices with Kafka László-Róbert ALBERT
49

Voxxed Days Vienna 2017 - Microservices with Kafka

Apr 05, 2017

Download

Software

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Microservices with Kafka

László-Róbert ALBERT

Page 2: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Róbert

Page 3: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

FAULT

TOLERANCE

PE

RF

OR

MA

NC

E

RELIABILITY SECURITY

AVAILABILITY

HIGH

SCALABILITY

REPLICATION

CH

AN

GE SELF HEALING

Page 4: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Page 5: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Page 6: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Page 7: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Account

Manager

Page 8: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Core Banking

Account

Manager

Page 9: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Core Banking

Transfer

Account

Manager

Page 10: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Core Banking

Transfer

Account

Manager

Page 11: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Source: http://www.slideshare.net/dberkholz/

how-microservices-are-redefining-

modern-application-architecture

Page 12: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Source: http://www.slideshare.net/dberkholz/

how-microservices-are-redefining-

modern-application-architecture

Page 13: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Page 14: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

500 million messages / day

Page 15: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

500 million messages / day 700 billion messages / day

Page 16: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

500 million messages / day 700 billion messages / day 1.4 trillion messages / day

Page 17: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

500 million messages / day 700 billion messages / day 1.4 trillion messages / day

Page 18: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Messaging Brokers Features Kafka ActiveMQ RabbitMQ

Page 19: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Messaging Brokers Features

Support for multiple protocols

• Advanced Message Queueing Protocol

• Streaming Text Oriented Messaging Protocol

• Message Queuing Telemetry Transport

• Etc

Kafka ActiveMQ RabbitMQ

Page 20: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Messaging Brokers Features

Support for multiple protocols

• Advanced Message Queueing Protocol

• Streaming Text Oriented Messaging Protocol

• Message Queuing Telemetry Transport

• Etc

Kafka ActiveMQ RabbitMQ

Java Messaging System

Page 21: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Messaging Brokers Features

Support for multiple protocols

• Advanced Message Queueing Protocol

• Streaming Text Oriented Messaging Protocol

• Message Queuing Telemetry Transport

• Etc

Kafka ActiveMQ RabbitMQ

Java Messaging System

Java Authentication and Authorization Service

Simple Authentication and Security Layer

Page 22: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Messaging Brokers Features

Support for multiple protocols

• Advanced Message Queueing Protocol

• Streaming Text Oriented Messaging Protocol

• Message Queuing Telemetry Transport

• Etc

Kafka ActiveMQ RabbitMQ

Java Messaging System

Java Authentication and Authorization Service

Simple Authentication and Security Layer

Transactions

Page 23: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Messaging Brokers Features

Support for multiple protocols

• Advanced Message Queueing Protocol

• Streaming Text Oriented Messaging Protocol

• Message Queuing Telemetry Transport

• Etc

Kafka ActiveMQ RabbitMQ

Java Messaging System

Java Authentication and Authorization Service

Simple Authentication and Security Layer

Transactions

Filtering

Page 24: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Messaging Brokers Features

Support for multiple protocols

• Advanced Message Queueing Protocol

• Streaming Text Oriented Messaging Protocol

• Message Queuing Telemetry Transport

• Etc

Kafka ActiveMQ RabbitMQ

Java Messaging System

Java Authentication and Authorization Service

Simple Authentication and Security Layer

Transactions

Filtering

Persistence

Page 25: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna 2

6

Features

Perf

orm

an

ce

Page 26: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Messaging Brokers Performance

Message producing

2

7

Message consumption

LinkedIn – Kafka: a Distributed Messaging System for Log Processing

Page 27: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Features

Perf

orm

an

ce

Page 28: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Page 29: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Page 30: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Page 31: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

System Availability & Performance

Page 32: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

System Availability & Performance

Page 33: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Scalability

3

4

Page 34: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Scalability

3

5

Page 35: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna 3

6

Page 36: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Producer

© ING 2016

// build a 'default' factory based on your-implicit-kafka-producer.properties

// - the properties file contains the list of brokers to connect to

ProducerFactory factory = ProducerFactory.builder().build();

// create a message producer with a Payload that sends the messages to topic ‘test’

Producer<Message<Payload>> producer =

factory.createMessageProducer("test", Payload.class);

// send a Message { header: Map<String, String>; payload: Payload }

producer.send(

Message.<Payload> builder()

.header("applicationId", "sample-producer")

.header("timestamp", now())

.payload(new Payload("/some/file/path"))

.build()

);

Page 37: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Producer

your-implicit-producer.properties

your-security.properties

Page 38: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

KafkaAppender

Page 39: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Consumer // build a 'default' factory – your-implicit-kafka-consumer.properties

// - the properties contains the list of brokers from which it will receive messages

ConsumerFactory factory = ConsumerFactory.builder().build();

// obtain a consumer instance that can process Message<Payload> messages

Consumer<Message<Payload>> consumer = factory.createMessageConsumer(Payload.class);

// prepare the message (Message { header: Map<String, String>; payload: Payload } ) handler

ReceiverHandler<Message<Payload>> messageReceiver =

new ReceiverHandler<Message<Payload>>() {

@Override

public void onReceive(Message<Payload> message) {

System.out.printf("message received: %s%n", message);

}

};

// register the handler to receive messages from the topic named “test”

consumer.registerHandler("test", messageReceiver);

© ING 2016

Page 40: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Consumer

your-implicit-consumer.properties

your-security.properties

Page 41: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Serialize

Page 42: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Filter

Page 43: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Transformer

Page 44: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Forward & Dispatch

Page 45: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Replay

Page 46: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Features

Perf

orm

an

ce

Page 47: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Features

FIL

TE

RIN

G

DIS

PA

TC

H

Perf

orm

an

ce

Page 48: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Features F

ILT

ER

ING

D

ISP

AT

CH

Perf

orm

an

ce

Page 49: Voxxed Days Vienna 2017 - Microservices with Kafka

albertlaszlorobert #VoxxedVienna

Use microservices with Kafka

… code ahead of the curve

Vienna • 16 March 2017

László-Róbert ALBERT https://www.linkedin.com/in/albertlaszlorobert