SlideShare a Scribd company logo
1 of 232
Download to read offline
‹#›© 2016 Pivotal Software, Inc. All rights reserved. ‹#›© 2016 Pivotal Software, Inc. All rights reserved.
Event Driven Microservices
with Spring Cloud Stream
Toshiaki Maki (@making)
2016-12-03 JJUG CCC 2016 Fall
#jjug_ccc #ccc_ab3
http://bit.ly/making_ccc_a3 (source code)
© 2016 Pivotal Software, Inc. All rights reserved.
Who am I ?
• Toshiaki Maki (@making) http://blog.ik.am
• Sr. Solutions Architect @Pivotal
• Spring Framework enthusiast
bit.ly/hajiboot2
© 2016 Pivotal Software, Inc. All rights reserved.
Contents
•Spring Cloud Stream (25min)
•Advanced Topic (20min)
•Spring Cloud Data Flow (2min)
•Deploy Stream Apps to Cloud Foundry (3min)
© 2016 Pivotal Software, Inc. All rights reserved.
Microservices
Frontend
Customer
Service
Email
Service
Point
Service
Post
Service
© 2016 Pivotal Software, Inc. All rights reserved.
Microservices
Frontend
Customer
Service
Email
Service
Point
Service
Post
Service
HTTP / REST?
© 2016 Pivotal Software, Inc. All rights reserved.
Microservices
Frontend
Customer
Service
Email
Service
Point
Service
Post
Service
ABC
Service
XYZ
Service
© 2016 Pivotal Software, Inc. All rights reserved.
Microservices
Frontend
Customer
Service
Email
Service
Point
Service
Post
Service
ABC
Service
XYZ
Service
© 2016 Pivotal Software, Inc. All rights reserved.
Microservices
Frontend
Customer
Service
Email
Service
Point
Service
Post
Service
ABC
Service
XYZ
Service
© 2016 Pivotal Software, Inc. All rights reserved.
Microservices
Frontend
Customer
Service
Email
Service
Point
Service
Post
Service
ABC
Service
XYZ
Service😩
© 2016 Pivotal Software, Inc. All rights reserved.
Microservices
Frontend
Customer
Service
Email
Service
Point
Service
Post
Service
ABC
Service
XYZ
Service😩
Orchestration Style
© 2016 Pivotal Software, Inc. All rights reserved.
Read Failure
Frontend
Customer
Service
Email
Service
HTTP GET
© 2016 Pivotal Software, Inc. All rights reserved.
Read Failure
Frontend
Customer
Service
Email
Service
🔥
HTTP GET
© 2016 Pivotal Software, Inc. All rights reserved.
Read Failure
Frontend
Customer
Service
Email
Service
🔥
HTTP GET
Circuit Breaker
© 2016 Pivotal Software, Inc. All rights reserved.
Read Failure
Frontend
Customer
Service
Email
Service
🔥
HTTP GET
Circuit Breaker
© 2016 Pivotal Software, Inc. All rights reserved.
Write Failure
Frontend
Customer
Service
Email
Service
HTTP POST
© 2016 Pivotal Software, Inc. All rights reserved.
Write Failure
🔥
Frontend
Customer
Service
Email
Service
HTTP POST
© 2016 Pivotal Software, Inc. All rights reserved.
Write Failure
🔥
Frontend
Customer
Service
Email
Service
😲
HTTP POST
© 2016 Pivotal Software, Inc. All rights reserved.
Event Driven MicroServices
Frontend
Customer
Service
Email
Service
Point
Service
Post
Service
© 2016 Pivotal Software, Inc. All rights reserved.
Event Driven MicroServices
Frontend
Customer
Service
Email
Service
Point
Service
Post
Service
© 2016 Pivotal Software, Inc. All rights reserved.
Event Driven MicroServices
Frontend
Customer
Service
Email
Service
Point
Service
Post
Service
Subscribe
© 2016 Pivotal Software, Inc. All rights reserved.
Event Driven MicroServices
Frontend
Customer
Service
Email
Service
Point
Service
Post
Service
Subscribe
Publish
© 2016 Pivotal Software, Inc. All rights reserved.
Event Driven MicroServices
Frontend
Customer
Service
Email
Service
Point
Service
Post
Service
Subscribe
ABC
Service
XYZ
Service
Publish
© 2016 Pivotal Software, Inc. All rights reserved.
Event Driven MicroServices
Frontend
Customer
Service
Email
Service
Point
Service
Post
Service
Subscribe
ABC
Service
XYZ
Service
Publish
© 2016 Pivotal Software, Inc. All rights reserved.
Event Driven MicroServices
Frontend
Customer
Service
Email
Service
Point
Service
Post
Service
Subscribe
ABC
Service
XYZ
Service
🤓
Publish
© 2016 Pivotal Software, Inc. All rights reserved.
Choreography Style
https://www.thoughtworks.com/insights/blog/scaling-microservices-event-stream
‹#›© 2016 Pivotal Software, Inc. All rights reserved.
Spring Cloud Stream
© 2016 Pivotal Software, Inc. All rights reserved.
Spring Cloud Stream
• Event-driven microservice framework
• Built on battle-tested components (Spring Boot / Spring
Integration)
• Opinionated primitives for streaming applications
• Persistent Pub/Sub
• Consumer Groups
• Partitioning Support
• Pluggable messaging middleware bindings
source | processor | sink
© 2016 Pivotal Software, Inc. All rights reserved.
Source | Sink
Sink
input
Source
output
© 2016 Pivotal Software, Inc. All rights reserved.
Source | Processor | Sink
Source output Processor
output
input
Sink
input
© 2016 Pivotal Software, Inc. All rights reserved.
Spring Cloud Stream Applications
Twitter Stream
Cassandra
java -jar twittersource.jar --server.port=8080
--consumerKey=XYZ --consumerSecret=ABC
--spring.cloud.stream.bindings.
output.destination=ingest
Source
Sink java -jar cassandrasink.jar --server.port=8081
--spring.cassandra.keyspace=tweet
--spring.cloud.stream.bindings.
input.destination=ingest
© 2016 Pivotal Software, Inc. All rights reserved.
Spring Cloud Stream Applications
Twitter Stream
Cassandra
java -jar twittersource.jar --server.port=8080
--consumerKey=XYZ --consumerSecret=ABC
--spring.cloud.stream.bindings.
output.destination=ingest
Source
Sink java -jar cassandrasink.jar --server.port=8081
--spring.cassandra.keyspace=tweet
--spring.cloud.stream.bindings.
input.destination=ingest
Twitter
Stream Cassandraingest
© 2016 Pivotal Software, Inc. All rights reserved.
Message Binders
• @EnableBinding
• Binder Implementations
• Production-Ready
• Rabbit MQ
• Apache Kafka
• Experimental
• JMS
• Google PubSub
© 2016 Pivotal Software, Inc. All rights reserved.
Programming Model (Sink)
@SpringBootApplication

@EnableBinding(Sink.class)

public class DemoSinkApp {
@StreamListener(Sink.INPUT)

void receive(Message<String> message) {

System.out.println("Received " + message.getPayload());

}

public static void main(String[] args) {

SpringApplication.run(DemoSinkApp.class, args);

}

}
© 2016 Pivotal Software, Inc. All rights reserved.
Programming Model (Sink)
@SpringBootApplication

@EnableBinding(Sink.class)

public class DemoSinkApp {
@StreamListener(Sink.INPUT)

void receive(Message<String> message) {

System.out.println("Received " + message.getPayload());

}

public static void main(String[] args) {

SpringApplication.run(DemoSinkApp.class, args);

}

}
public interface Sink {
String INPUT = "input";
@Input(Sink.INPUT)
SubscribableChannel input();

}
© 2016 Pivotal Software, Inc. All rights reserved.
Sink
Properties (Sink)
spring.cloud.stream.bindings.input.destination=demo-strm
demo-
strm
input
© 2016 Pivotal Software, Inc. All rights reserved.
Programming Model (Source)
@SpringBootApplication @RestController
@EnableBinding(Source.class)

public class DemoSourceApp {

@Autowired @Output(Source.OUTPUT)
MessageChannel output;
@GetMapping void send(@RequestParam String text) {

output.send(MessageBuilder.withPayload(text).build());

}

public static void main(String[] args) {

SpringApplication.run(DemoSourceApp.class, args);

}

}
© 2016 Pivotal Software, Inc. All rights reserved.
Programming Model (Source)
@SpringBootApplication @RestController
@EnableBinding(Source.class)

public class DemoSourceApp {

@Autowired @Output(Source.OUTPUT)
MessageChannel output;
@GetMapping void send(@RequestParam String text) {

output.send(MessageBuilder.withPayload(text).build());

}

public static void main(String[] args) {

SpringApplication.run(DemoSourceApp.class, args);

}

}
public interface Source {
String OUTPUT = "output";
@Output(Source.OUTPUT)
MessageChannel output();

}
© 2016 Pivotal Software, Inc. All rights reserved.
Programming Model (Source)
@SpringBootApplication @RestController
@EnableBinding(Source.class)

public class DemoSourceApp {

@Autowired Source source;
@GetMapping void send(@RequestParam String text) {

source.output()
.send(MessageBuilder.withPayload(text).build());

}

public static void main(String[] args) {

SpringApplication.run(DemoSourceApp.class, args);

}

}
© 2016 Pivotal Software, Inc. All rights reserved.
Properties (Source)
spring.cloud.stream.bindings.output.destination=demo-strm
demo-
strm
Source
output
© 2016 Pivotal Software, Inc. All rights reserved.
Properties (Source)
spring.cloud.stream.bindings.output.destination=demo-strm
spring.cloud.stream.bindings.output.contentType=applicati
on/json
demo-
strm
Source
output
© 2016 Pivotal Software, Inc. All rights reserved.
Binder (RabbitMQ)
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
</dependency>
demo-
strm
© 2016 Pivotal Software, Inc. All rights reserved.
Binder (Apache Kafka)
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-kafka</artifactId>
</dependency>
demo-
strm
© 2016 Pivotal Software, Inc. All rights reserved.
Sink
Pipeline
demo-
strm
input
Source
output
source | sink
© 2016 Pivotal Software, Inc. All rights reserved.
RabbitMQ
demo-strm
© 2016 Pivotal Software, Inc. All rights reserved.
RabbitMQ
demo-strm
Source
© 2016 Pivotal Software, Inc. All rights reserved.
RabbitMQ
demo-strm
Topic
Exchange
demo-strm
Source
© 2016 Pivotal Software, Inc. All rights reserved.
RabbitMQ
demo-strm
Topic
Exchange
demo-strm
Source
© 2016 Pivotal Software, Inc. All rights reserved.
RabbitMQ
demo-strm
Topic
Exchange
demo-strm
Source Sink
© 2016 Pivotal Software, Inc. All rights reserved.
RabbitMQ
demo-strm
Topic
Exchange
demo-strm
.anonymous.x
Queue
demo-strm
Source Sink
© 2016 Pivotal Software, Inc. All rights reserved.
RabbitMQ
demo-strm
Topic
Exchange
demo-strm
.anonymous.x
Queue
demo-strm
Source Sink
© 2016 Pivotal Software, Inc. All rights reserved.
Programming Model (Processor)
@SpringBootApplication

@EnableBinding(Processor.class)

public class DemoProcessorApp {
@StreamListener(Processor.INPUT)
@SendTo(Processor.OUTPUT)

void receive(String text) {

return "[[" + text + "]]";

}

public static void main(String[] args) {

SpringApplication.run(DemoProcessorApp.class, args);

}

}
© 2016 Pivotal Software, Inc. All rights reserved.
Properties (Processor)
spring.cloud.stream.bindings.output.destination=my-source
spring.cloud.stream.bindings.input.destination=my-source
spring.cloud.stream.bindings.output.destination=my-proc
spring.cloud.stream.bindings.input.destination=my-proc
Source
Processor
Sink
© 2016 Pivotal Software, Inc. All rights reserved.
Pipeline
my-
source
Source
output source | processor | sink
Processor
output
input
my-proc
Sink
input
© 2016 Pivotal Software, Inc. All rights reserved.
Reactive API Support by Reactor
@SpringBootApplication

@EnableBinding(Processor.class)

public class DemoProcessorRxApp {
@StreamListener @Output(Processor.OUTPUT)

public Flux<String> receive(@Input(Processor.INPUT)
Flux<String> stream) {

return stream.map(text -> "[[" + text + "]]");

}

public static void main(String[] args) {

SpringApplication.run(DemoProcessorRxApp.class, args);

}

}
© 2016 Pivotal Software, Inc. All rights reserved.
Reactive API Support by Reactor
@StreamListener @Output(Processor.OUTPUT)

public Flux<AverageData> receive(@Input(Processor.INPUT)
Flux<SensorData> stream) {

return stream.window(Duration.ofSecond(20),
Duration.ofSecond(10))
.flatMap(win -> win.groupBy(sensor -> sensor.id))
.flatMap(group -> calcAverage(group));

}
© 2016 Pivotal Software, Inc. All rights reserved.
Stream Core Features
•Persistent Pub-Sub
•Consumer Group
•Partitioning Support
© 2016 Pivotal Software, Inc. All rights reserved.
Persistent Pub-Sub
HTTP Average Top Ns1.http s1.ave
Message Broker
© 2016 Pivotal Software, Inc. All rights reserved.
Persistent Pub-Sub
HTTP Average
HDFS
Top Ns1.http s1.ave
Message Broker
© 2016 Pivotal Software, Inc. All rights reserved.
Persistent Pub-Sub
HTTP Average
HDFS
Top N
Fault
Detection
s1.http s1.ave
Message Broker
© 2016 Pivotal Software, Inc. All rights reserved.
Persistent Pub-Sub
HTTP Average
HDFS
Top N
Fault
Detection
s1.http s1.ave
Message Broker
{"id":1, "temperature":38}
© 2016 Pivotal Software, Inc. All rights reserved.
Persistent Pub-Sub
HTTP Average
HDFS
Top N
Fault
Detection
s1.http s1.ave
Message Broker
{"id":1, "temperature":38}{"id":1, "temperature":38}
© 2016 Pivotal Software, Inc. All rights reserved.
Persistent Pub-Sub
HTTP Average
HDFS
Top N
Fault
Detection
s1.http s1.ave
Message Broker
{"id":1, "temperature":38}
{"id":1, "temperature":38}
{"id":1, "temperature":38}
© 2016 Pivotal Software, Inc. All rights reserved.
Persistent Pub-Sub
HTTP Average
HDFS
Top N
Fault
Detection
s1.http s1.ave
Message Broker
{"id":1, "temperature":
{"id":1, "temperature":38} {"id":1, "temperature":38}
© 2016 Pivotal Software, Inc. All rights reserved.
HTTP Average
HDFS
Top N
Fault
Detection
s1.http s1.ave
Message Broker
Average
Average
HDFS
HDFS
© 2016 Pivotal Software, Inc. All rights reserved.
HTTP Average
HDFS
Top N
Fault
Detection
s1.http s1.ave
Message Broker
{"id":1, "temperature":38}
Average
Average
HDFS
HDFS
© 2016 Pivotal Software, Inc. All rights reserved.
HTTP Average
HDFS
Top N
Fault
Detection
s1.http s1.ave
Message Broker
{"id":1, "temperature":38}{"id":1, "temperature":38}
Average
Average
HDFS
HDFS
© 2016 Pivotal Software, Inc. All rights reserved.
HTTP Average
HDFS
Top N
Fault
Detection
s1.http s1.ave
Message Broker
{"id":1, "temperature":38}
{"id":1, "temperature":38}
Average
Average
HDFS
HDFS
{"id":1, "temperature":38}
{"id":1, "temperature":38}
{"id":1, "temperature":38}
{"id":1, "temperature":38}
© 2016 Pivotal Software, Inc. All rights reserved.
HTTP Average
HDFS
Top N
Fault
Detection
s1.http s1.ave
Message Broker
{"id":1, "temperature":38}
{"id":1, "temperature":38}
Average
Average
HDFS
HDFS
{"id":1, "temperature":38}
{"id":1, "temperature":38}
{"id":1, "temperature":38}
{"id":1, "temperature":38}
😩
© 2016 Pivotal Software, Inc. All rights reserved.
Topic
Exchange
demo-strm
demo-strm
.anonymous.1
Queue
© 2016 Pivotal Software, Inc. All rights reserved.
Topic
Exchange
demo-strm
demo-strm
.anonymous.1
Queue
© 2016 Pivotal Software, Inc. All rights reserved.
Topic
Exchange
demo-strm
demo-strm
.anonymous.1
Queue
demo-strm
.anonymous.2
© 2016 Pivotal Software, Inc. All rights reserved.
Topic
Exchange
demo-strm
demo-strm
.anonymous.1
Queue
demo-strm
.anonymous.2
Consumer Group
© 2016 Pivotal Software, Inc. All rights reserved.
Topic
Exchange
demo-strm
demo-strm
.anonymous.1
Queue
demo-strm
.anonymous.2
spring.cloud.stream.bindings.<channelName>.group=ave
Consumer Group
© 2016 Pivotal Software, Inc. All rights reserved.
Consumer Group
demo-strm
demo-strm
.ave
QueueTopic
Exchange
© 2016 Pivotal Software, Inc. All rights reserved.
Consumer Group
HTTP Average
HDFS
Top N
Fault
Detection
s1.http s1.ave
Message Broker
Average
Average
HDFS
HDFS
group=ave
group=hdfs
© 2016 Pivotal Software, Inc. All rights reserved.
Consumer Group
HTTP Average
HDFS
Top N
Fault
Detection
s1.http s1.ave
Message Broker
Average
Average
HDFS
HDFS
group=ave
group=hdfs
{"id":1, "temperature":38}
© 2016 Pivotal Software, Inc. All rights reserved.
Consumer Group
HTTP Average
HDFS
Top N
Fault
Detection
s1.http s1.ave
Message Broker
Average
Average
HDFS
HDFS
group=ave
group=hdfs
{"id":1, "temperature":38}{"id":1, "temperature":38}
© 2016 Pivotal Software, Inc. All rights reserved.
Consumer Group
HTTP Average
HDFS
Top N
Fault
Detection
s1.http s1.ave
Message Broker
Average
Average
HDFS
HDFS
group=ave
group=hdfs
{"id":1, "temperature":38}
{"id":1, "temperature":38}
© 2016 Pivotal Software, Inc. All rights reserved.
Consumer Group
HTTP Average
HDFS
Top N
Fault
Detection
s1.http s1.ave
Message Broker
Average
Average
HDFS
HDFS
group=ave
group=hdfs
{"id":1, "temperature":38}
{"id":1, "temperature":38} 🤓
© 2016 Pivotal Software, Inc. All rights reserved.
Consumer Group
HTTP Average
HDFS
Top N
Fault
Detection
s1.http s1.ave
Message Broker
Average
Average
HDFS
HDFS
group=ave
group=hdfs
{"id":1, "temperature":38}
{"id":1, "temperature":38} 🤓
consumer group subscriptions
are durable 😁
© 2016 Pivotal Software, Inc. All rights reserved.
Durability
demo-strm
demo-strm
.ave
QueueTopic
Exchange
© 2016 Pivotal Software, Inc. All rights reserved.
Durability
demo-strm
demo-strm
.ave
QueueTopic
Exchange
© 2016 Pivotal Software, Inc. All rights reserved.
Durability
demo-strm
demo-strm
.ave
Queue
🏀
Topic
Exchange
© 2016 Pivotal Software, Inc. All rights reserved.
Durability
demo-strm
demo-strm
.ave
Queue
🏀
Topic
Exchange
© 2016 Pivotal Software, Inc. All rights reserved.
Durability
demo-strm
demo-strm
.ave
Queue
🚑
🏀
Topic
Exchange
© 2016 Pivotal Software, Inc. All rights reserved.
Durability
demo-strm
demo-strm
.ave
Queue
🚑
🏀
Topic
Exchange
© 2016 Pivotal Software, Inc. All rights reserved.
Durability
demo-strm
demo-strm
.ave
Queue
🏀
Topic
Exchange
© 2016 Pivotal Software, Inc. All rights reserved.
Customer
Service
Email
Service
Point
Service
Post
Service
Source
Sink
© 2016 Pivotal Software, Inc. All rights reserved.
Customer
Service
Email
Service
Point
Service
Post
Service
Source
Sink
spring.cloud.stream.bindings.output.destination=customer
spring.cloud.stream.bindings.output.contentType=applicatio
n/json
© 2016 Pivotal Software, Inc. All rights reserved.
Customer
Service
Email
Service
Point
Service
Post
Service
Subscribe
Source
Sink
© 2016 Pivotal Software, Inc. All rights reserved.
Customer
Service
Email
Service
Point
Service
Post
Service
Subscribe
Source
Sink
group=point-service
group=email-service
group=post-service
© 2016 Pivotal Software, Inc. All rights reserved.
Customer
Service
Email
Service
Point
Service
Post
Service
Subscribe
Source
Sink
group=point-service
group=email-service
group=post-service
spring.cloud.stream.bindings.input.destination=customer
spring.cloud.stream.bindings.input.group=point-service
© 2016 Pivotal Software, Inc. All rights reserved.
Customer
Service
Email
Service
Point
Service
Post
Service
Subscribe
Source
Sink
group=point-service
group=email-service
group=post-service
spring.cloud.stream.bindings.input.destination=customer
spring.cloud.stream.bindings.input.group=point-service
spring.cloud.stream.bindings.input.destination=customer
spring.cloud.stream.bindings.input.group=email-service
© 2016 Pivotal Software, Inc. All rights reserved.
Customer
Service
Email
Service
Point
Service
Post
Service
Subscribe
Source
Sink
group=point-service
group=email-service
group=post-service
spring.cloud.stream.bindings.input.destination=customer
spring.cloud.stream.bindings.input.group=point-service
spring.cloud.stream.bindings.input.destination=customer
spring.cloud.stream.bindings.input.group=email-service
spring.cloud.stream.bindings.input.destination=customer
spring.cloud.stream.bindings.input.group=post-service
© 2016 Pivotal Software, Inc. All rights reserved.
customer
Customer Service
output
Point Service
input
Email Service
input
Post Service
input
© 2016 Pivotal Software, Inc. All rights reserved.
customer
customer
.point-
service
Queue
Consumer Group
customer
.email-
service
customer
.post-
service
Topic
Exchange
© 2016 Pivotal Software, Inc. All rights reserved.
HTTP
Average
s1.http
Average
© 2016 Pivotal Software, Inc. All rights reserved.
HTTP
Average
s1.http
Average
{"id":1, "temperature":38}
{"id":2, "temperature":41}
{"id":2, "temperature":42}
{"id":1, "temperature":37}
© 2016 Pivotal Software, Inc. All rights reserved.
HTTP
Average
s1.http
Average
{"id":1, "temperature":38}
{"id":2, "temperature":41}
{"id":2, "temperature":42}
{"id":1, "temperature":37}
© 2016 Pivotal Software, Inc. All rights reserved.
HTTP
Average
s1.http
Average
{"id":1, "temperature":38}
{"id":2, "temperature":41}
{"id":2, "temperature":42}
{"id":1, "temperature":37}
© 2016 Pivotal Software, Inc. All rights reserved.
HTTP
Average
s1.http
Average
{"id":1, "temperature":38}
{"id":2, "temperature":41}
{"id":2, "temperature":42}
{"id":1, "temperature":37}
© 2016 Pivotal Software, Inc. All rights reserved.
HTTP
Average
s1.http
Average
{"id":1, "temperature":38}
{"id":2, "temperature":41}
{"id":2, "temperature":42}
{"id":1, "temperature":37}
© 2016 Pivotal Software, Inc. All rights reserved.
HTTP
Average
s1.http
Average
{"id":1, "temperature":38}
{"id":2, "temperature":41}
{"id":2, "temperature":42}
{"id":1, "temperature":37}
😩
© 2016 Pivotal Software, Inc. All rights reserved.
HTTP
Average
s1.http
Average
{"id":1, "temperature":38}
{"id":2, "temperature":41}
{"id":2, "temperature":42}
{"id":1, "temperature":37}
😩
Partitioning Support(Stateful Stream)
© 2016 Pivotal Software, Inc. All rights reserved.
HTTP
Average
s1.http
Average
{"id":1, "temperature":38}
{"id":2, "temperature":41}
{"id":2, "temperature":42}
{"id":1, "temperature":37}
😩
spring.cloud.stream.bindings.<channelName>.producer.par
titionKeyExpression=payload.id
Partitioning Support(Stateful Stream)
© 2016 Pivotal Software, Inc. All rights reserved.
Partitioning Support(Stateful Stream)
HTTP
Average
s1.http
Average
© 2016 Pivotal Software, Inc. All rights reserved.
Partitioning Support(Stateful Stream)
HTTP
Average
s1.http
Average
{"id":1, "temperature":38}
{"id":2, "temperature":41}
{"id":2, "temperature":42}
{"id":1, "temperature":37}
© 2016 Pivotal Software, Inc. All rights reserved.
Partitioning Support(Stateful Stream)
HTTP
Average
s1.http
Average
{"id":1, "temperature":38}
{"id":2, "temperature":41}
{"id":2, "temperature":42}
{"id":1, "temperature":37}
© 2016 Pivotal Software, Inc. All rights reserved.
Partitioning Support(Stateful Stream)
HTTP
Average
s1.http
Average
{"id":1, "temperature":38}
{"id":2, "temperature":41}
{"id":2, "temperature":42}
{"id":1, "temperature":37}
© 2016 Pivotal Software, Inc. All rights reserved.
Partitioning Support(Stateful Stream)
HTTP
Average
s1.http
Average
{"id":1, "temperature":38}
{"id":2, "temperature":41}
{"id":2, "temperature":42}
{"id":1, "temperature":37}
© 2016 Pivotal Software, Inc. All rights reserved.
Partitioning Support(Stateful Stream)
HTTP
Average
s1.http
Average
{"id":1, "temperature":38}
{"id":2, "temperature":41}
{"id":2, "temperature":42}
{"id":1, "temperature":37}
© 2016 Pivotal Software, Inc. All rights reserved.
Partitioning Support(Stateful Stream)
HTTP
Average
s1.http
Average
{"id":1, "temperature":38}
{"id":2, "temperature":41}
{"id":2, "temperature":42}
{"id":1, "temperature":37}
🤓
© 2016 Pivotal Software, Inc. All rights reserved.
Test Support
Source
output
Sink
input
© 2016 Pivotal Software, Inc. All rights reserved.
Test Support
Source
output
Sink
input
TestSupportBinder
© 2016 Pivotal Software, Inc. All rights reserved.
Test Support
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-test-support</artifactId>
<scope>test</scope>
</dependency>
© 2016 Pivotal Software, Inc. All rights reserved.
Unit Test (Sink)
@RunWith(SpringRunner.class)

@SpringBootTest(webEnvironment = WebEnvironment.NONE)

public class DemoSinkAppTest {
@Autowired Sink sink;
@Rule public OutputCapture capture = new OutputCapture();
@Test public void testReceive() {
sink.input()
.send(MessageBuilder.withPayload("foo").build());
assertThat(capture.toString())
.isEqualsTo("Received foo");

}
}
© 2016 Pivotal Software, Inc. All rights reserved.
Unit Test (Source)
@RunWith(SpringRunner.class)

@SpringBootTest(webEnvironment = WebEnvironment.NONE)

public class DemoSourceAppTest {
@Autowired DemoSourceApp app;
@Autowired MessageCollector collector;
@Autowired Source source;
@Test public void testSend() {
app.send("foo");
Message<String> message = collector
.forChannel(source.output()).poll();
assertThat(message.getPayload()).isEqualsTo("foo"); 

}}
‹#›© 2016 Pivotal Software, Inc. All rights reserved.
Advanced Topics
© 2016 Pivotal Software, Inc. All rights reserved.
Advanced Topics
•Multi Binding
•Distributed Tracing
•Error Handling
•Consumer Driven Contract
© 2016 Pivotal Software, Inc. All rights reserved.
Multi Bindings
© 2016 Pivotal Software, Inc. All rights reserved.
customer
Customer Service
output
Email Service
input
© 2016 Pivotal Software, Inc. All rights reserved.
customer
Customer Service
output
Email Service
input
CustomerCreateEvent
© 2016 Pivotal Software, Inc. All rights reserved.
customer
Customer Service
output
Email Service
input
© 2016 Pivotal Software, Inc. All rights reserved.
customer
Customer Service
output
Email Service
input
CustomerDeleteEvent
© 2016 Pivotal Software, Inc. All rights reserved.
customer
Customer Service
output
Email Service
input
CustomerDeleteEvent
ClassCastException!!
© 2016 Pivotal Software, Inc. All rights reserved.
create
Email Service
create-
input
delete-
input
Customer Service
create-
output
delete-
output
delete
CustomerCreateEvent
CustomerDeleteEvent
© 2016 Pivotal Software, Inc. All rights reserved.
public interface CustomerEventSource {
String CREATE_OUTPUT = "create-output";
String DELETE_OUTPUT = "delete-output";
@Output(CustomerEventSource.CREATE_OUTPUT)
MessageChannel createOutput();
@Output(CustomerEventSource.DELETE_OUTPUT)
MessageChannel deleteOutput();

}
Multi Bindings
© 2016 Pivotal Software, Inc. All rights reserved.
@Component

public class CustomerService {

@Autowired CustomerEventSource source;
public void create(...) {
source.createOutput().send(...);
}
public void delete() {
source.deleteOutput().send(...);
}

}
@SpringBootApplication
@EnableBinding(CustomerEventSource.class)

public class CustomerServiceApplication { /* ... */ }
© 2016 Pivotal Software, Inc. All rights reserved.
@Component

public class CustomerService {

@Autowired CustomerEventSource source;
public void create(...) {
source.createOutput().send(...);
}
public void delete() {
source.deleteOutput().send(...);
}

}
@SpringBootApplication
@EnableBinding(CustomerEventSource.class)

public class CustomerServiceApplication { /* ... */ }
spring.cloud.stream.bindings.create-output.destination
=create
spring.cloud.stream.bindings.delete-output.destination
=delete
© 2016 Pivotal Software, Inc. All rights reserved.
public interface CustomerEventSink {
String CREATE_INPUT = "create-input";
String DELETE_INPUT = "delete-input";
@Input(CustomerEventSink.CREATE_INPUT)
SubscribableChannel createInput();
@Input(CustomerEventSink.DELETE_INPUT)
SubscribableChannel deleteInput();

}
Multi Bindings
© 2016 Pivotal Software, Inc. All rights reserved.
@Component

public class PointService {
@StreamListener(CustomerEventSink.CREATE_INPUT)
public void handleCreate(CustomerCreateEvent event) {
}
@StreamListener(CustomerEventSink.DELETE_INPUT)
public void handleDelete(CustomerDeleteEvent event) {
}

}
@SpringBootApplication
@EnableBinding(CustomerEventSink.class)

public class PointServiceApplication { /* ... */ }
© 2016 Pivotal Software, Inc. All rights reserved.
@Component

public class PointService {
@StreamListener(CustomerEventSink.CREATE_INPUT)
public void handleCreate(CustomerCreateEvent event) {
}
@StreamListener(CustomerEventSink.DELETE_INPUT)
public void handleDelete(CustomerDeleteEvent event) {
}

}
@SpringBootApplication
@EnableBinding(CustomerEventSink.class)

public class PointServiceApplication { /* ... */ }
spring.cloud.stream.bindings.create-input.destination
=create
spring.cloud.stream.bindings.create-input.group
=point-service
spring.cloud.stream.bindings.delete-intput.destination
=delete
spring.cloud.stream.bindings.delete-input.group
=point-service
© 2016 Pivotal Software, Inc. All rights reserved.
create
create
.point-
service
Queue
delete delete
.point-
service
Topic
Exchange
© 2016 Pivotal Software, Inc. All rights reserved.
Frontend
Customer
Service
Email
Service
Point
Service
Post
Service
Subscribe
ABC
Service
XYZ
Service
© 2016 Pivotal Software, Inc. All rights reserved.
Frontend
Customer
Service
Email
Service
Point
Service
Post
Service
Subscribe
ABC
Service
XYZ
Service
🕝
© 2016 Pivotal Software, Inc. All rights reserved.
Frontend
Customer
Service
Email
Service
Point
Service
Post
Service
Subscribe
ABC
Service
XYZ
Service🤔
🕝
© 2016 Pivotal Software, Inc. All rights reserved.
Frontend
Customer
Service
Email
Service
Point
Service
Post
Service
Subscribe
ABC
Service
XYZ
Service🤔
🕝
🕵 🕵
🕵
🕵 🕵
🕵🕵
© 2016 Pivotal Software, Inc. All rights reserved.
Frontend
Customer
Service
Email
Service
Point
Service
Post
Service
Subscribe
ABC
Service
XYZ
Service🤔
🕝
🕵 🕵
🕵
🕵 🕵
🕵🕵
© 2016 Pivotal Software, Inc. All rights reserved.
Frontend
Customer
Service
Email
Service
Point
Service
Post
Service
Subscribe
ABC
Service
XYZ
Service🤔
🕝
🕵 🕵
🕵
🕵 🕵
🕵🕵
TraceID, SpanID
© 2016 Pivotal Software, Inc. All rights reserved.
Spring Cloud Sleuth
• Distributed tracing solution for Spring Cloud
• Interactions with external systems should be instrumented
automatically
• Capture data simply in logs, or by sending it to Zipkin via
RestTemplate / Spring Cloud Stream / ...
© 2016 Pivotal Software, Inc. All rights reserved.
Spring Cloud Sleuth Stream
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-slueth</artifactId>
</dependency>
© 2016 Pivotal Software, Inc. All rights reserved.
Spring Cloud Sleuth Stream
customer
Customer Service
output
Email Service
input
© 2016 Pivotal Software, Inc. All rights reserved.
Spring Cloud Sleuth Stream
customer
Customer Service
output
Email Service
input
sleuth sleuth
© 2016 Pivotal Software, Inc. All rights reserved.
Zipkin Stream Server
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin-stream</artifactId>
</dependency>
© 2016 Pivotal Software, Inc. All rights reserved.
Zipkin Stream Server
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin-stream</artifactId>
</dependency>
@SpringBootApplication

@EnableZipkinStreamServer

public class ZipkinStreamServer {

public static void main(String[] args) {

SpringApplication.run(DemoSinkApp.class, args);

}

}
© 2016 Pivotal Software, Inc. All rights reserved.
Zipkin Stream Server
customer
Customer Service
output
Email Service
input
sleuth sleuth
© 2016 Pivotal Software, Inc. All rights reserved.
Zipkin Stream Server
customer
Customer Service
output
Email Service
input
sleuth sleuth
sleuth
sleuth
© 2016 Pivotal Software, Inc. All rights reserved.
Zipkin Stream Server
customer
Customer Service
output
Email Service
input
sleuth sleuth
sleuth
sleuth
© 2016 Pivotal Software, Inc. All rights reserved.
Zipkin Stream Server
customer
Customer Service
output
Email Service
input
sleuth sleuth
sleuth
sleuth
© 2016 Pivotal Software, Inc. All rights reserved.
Zipkin Stream Server
customer
Customer Service
output
Email Service
input
sleuth sleuth
sleuth
sleuth
TraceID,SpanID TraceID,SpanID
© 2016 Pivotal Software, Inc. All rights reserved.
Zipkin Stream Server
customer
Customer Service
output
Email Service
input
sleuth sleuth
sleuth
sleuth
© 2016 Pivotal Software, Inc. All rights reserved.
Zipkin UI
© 2016 Pivotal Software, Inc. All rights reserved.
Zipkin UI
Trace
© 2016 Pivotal Software, Inc. All rights reserved.
Zipkin UI
Trace
Span
© 2016 Pivotal Software, Inc. All rights reserved.
© 2016 Pivotal Software, Inc. All rights reserved.
Error Handling
•Depends on the message binder
implementation
•(Ex.) RabbitMQ binder routes the failed
message to the Dead-Letter
Queue(DLQ). No mechanism to handle
DLQs.
© 2016 Pivotal Software, Inc. All rights reserved.
Dead-Letter Queue Processing
demo-strm
Topic
Exchange
demo-strm
.ave
Source Sink
RabbitMQBinder
© 2016 Pivotal Software, Inc. All rights reserved.
Dead-Letter Queue Processing
demo-strm
Topic
Exchange
demo-strm
.ave
Source Sink
DLX
RabbitMQBinder
© 2016 Pivotal Software, Inc. All rights reserved.
Dead-Letter Queue Processing
demo-strm
Topic
Exchange
demo-strm
.ave
Source Sink
DLX
RabbitMQBinder
spring.cloud.stream.bindings.input.destination=demo-strm
spring.cloud.stream.bindings.input.group=ave
spring.cloud.stream.rabbit.bindings.input.consumer.autoBi
ndDlq=true
© 2016 Pivotal Software, Inc. All rights reserved.
Dead-Letter Queue Processing
demo-strm
Topic
Exchange
demo-strm
.ave
Source Sink
DLX
demo-strm
.ave.dlq
RabbitMQBinder
spring.cloud.stream.bindings.input.destination=demo-strm
spring.cloud.stream.bindings.input.group=ave
spring.cloud.stream.rabbit.bindings.input.consumer.autoBi
ndDlq=true
© 2016 Pivotal Software, Inc. All rights reserved.
Dead-Letter Queue Processing
demo-strm
Topic
Exchange
demo-strm
.ave
Source Sink
DLX
demo-strm
.ave.dlq
RabbitMQBinder
© 2016 Pivotal Software, Inc. All rights reserved.
Dead-Letter Queue Processing
demo-strm
Topic
Exchange
demo-strm
.ave
Source Sink
DLX
demo-strm
.ave.dlq
RabbitMQBinder
© 2016 Pivotal Software, Inc. All rights reserved.
Dead-Letter Queue Processing
demo-strm
Topic
Exchange
demo-strm
.ave
Source Sink
DLX
demo-strm
.ave.dlq
RabbitMQBinder
© 2016 Pivotal Software, Inc. All rights reserved.
Dead-Letter Queue Processing
demo-strm
Topic
Exchange
demo-strm
.ave
Source Sink
DLX
demo-strm
.ave.dlq
RabbitMQBinder
🔥
© 2016 Pivotal Software, Inc. All rights reserved.
Dead-Letter Queue Processing
demo-strm
Topic
Exchange
demo-strm
.ave
Source Sink
DLX
demo-strm
.ave.dlq
RabbitMQBinder
🔥 Retry 3 times
by default
© 2016 Pivotal Software, Inc. All rights reserved.
Dead-Letter Queue Processing
demo-strm
Topic
Exchange
demo-strm
.ave
Source Sink
DLX
demo-strm
.ave.dlq
RabbitMQBinder
🔥 Retry 3 times
by default
© 2016 Pivotal Software, Inc. All rights reserved.
© 2016 Pivotal Software, Inc. All rights reserved.
© 2016 Pivotal Software, Inc. All rights reserved.
© 2016 Pivotal Software, Inc. All rights reserved.
© 2016 Pivotal Software, Inc. All rights reserved.
© 2016 Pivotal Software, Inc. All rights reserved.
Handling DLQ
@Component

public class DlqHander {
@RabbitListener(queues = "customer.email-service.dlq")
public void handle(Message event) {
// Re-deliver if you want
}

}
© 2016 Pivotal Software, Inc. All rights reserved.
DLQ Recovery Center 😛
https://github.com/making-demo-scst/dlq-recover-service
© 2016 Pivotal Software, Inc. All rights reserved.
Trace everything
© 2016 Pivotal Software, Inc. All rights reserved.
customer
Customer Service
output
Point Service
input
Email Service
input
Post Service
input
© 2016 Pivotal Software, Inc. All rights reserved.
customer
Customer Service
output
Point Service
input
Email Service
input
Post Service
input
© 2016 Pivotal Software, Inc. All rights reserved.
customer
Customer Service
output
Point Service
input
Email Service
input
Post Service
input
© 2016 Pivotal Software, Inc. All rights reserved.
customer
Customer Service
output
Point Service
input
Email Service
input
Post Service
input
© 2016 Pivotal Software, Inc. All rights reserved.
customer
Customer Service
output
Point Service
input
Email Service
input
Post Service
input
© 2016 Pivotal Software, Inc. All rights reserved.
customer
Customer Service
output
Point Service
input
Email Service
input
Post Service
input
😗Breaking Change
© 2016 Pivotal Software, Inc. All rights reserved.
customer
Customer Service
output
Point Service
input
Email Service
input
Post Service
input
😗Breaking Change
© 2016 Pivotal Software, Inc. All rights reserved.
customer
Customer Service
output
Point Service
input
Email Service
input
Post Service
input
😗Breaking Change
© 2016 Pivotal Software, Inc. All rights reserved.
customer
Customer Service
output
Point Service
input
Email Service
input
Post Service
input
😗Breaking Change
© 2016 Pivotal Software, Inc. All rights reserved.
customer
Customer Service
output
😗Breaking Change 😡
😡
😡
😨
© 2016 Pivotal Software, Inc. All rights reserved.
Consumer Driven Contracts
•Consumer shares "expectation" with
Producer via "Contract" (≈ DSL)
•The contract violation should be detected by
generated tests on the producer side.
© 2016 Pivotal Software, Inc. All rights reserved.
Consumer Driven Contracts
•Consumer shares "expectation" with
Producer via "Contract" (≈ DSL)
•The contract violation should be detected by
generated tests on the producer side.
ContractConsumer Producer
© 2016 Pivotal Software, Inc. All rights reserved.
Flow of Consumer Driven Contracts
Consumer Producer
© 2016 Pivotal Software, Inc. All rights reserved.
Flow of Consumer Driven Contracts
Consumer Producer
Contract
© 2016 Pivotal Software, Inc. All rights reserved.
Flow of Consumer Driven Contracts
Consumer Producer
Contract
© 2016 Pivotal Software, Inc. All rights reserved.
Flow of Consumer Driven Contracts
Consumer Producer
Contract
Acceptance
Test
© 2016 Pivotal Software, Inc. All rights reserved.
Flow of Consumer Driven Contracts
Consumer Producer
Contract
Acceptance
Test
© 2016 Pivotal Software, Inc. All rights reserved.
Flow of Consumer Driven Contracts
Consumer Producer
Contract
Acceptance
Test
✅
© 2016 Pivotal Software, Inc. All rights reserved.
Flow of Consumer Driven Contracts
Consumer Producer
Contract
Acceptance
Test
Stub
✅
© 2016 Pivotal Software, Inc. All rights reserved.
Flow of Consumer Driven Contracts
Consumer Producer
Contract
Acceptance
Test
Stub
✅
© 2016 Pivotal Software, Inc. All rights reserved.
Flow of Consumer Driven Contracts
Consumer Producer
Contract
Acceptance
Test
Stub
Unit Test
✅
© 2016 Pivotal Software, Inc. All rights reserved.
Flow of Consumer Driven Contracts
Consumer Producer
Contract
Acceptance
Test
Stub
Unit Test
✅✅
© 2016 Pivotal Software, Inc. All rights reserved.
Spring Cloud Contract
•A CDC Solution for JVM apps (especially Spring)
•Contract DSL using Groovy
•Generates Acceptance test (JUnit or Spock) for producer
•Generates Stub for consumer
•WireMock Support for REST Test
•Messaging Support (Spring Integration, Spring Cloud
Stream and Apache Camel)
© 2016 Pivotal Software, Inc. All rights reserved.
Contract DSL
Contract.make {
label 'create-customer'
input {
}
outputMessage {
sentTo('demo-strm')
headers({header('Content-Type':'...')})

body('''{"name":"@making"}''')
}}
shouldCreateCustomer.groovy
© 2016 Pivotal Software, Inc. All rights reserved.
Contract DSL
Contract.make {
label 'create-customer'
input {
}
outputMessage {
sentTo('demo-strm')
headers({header('Content-Type':'...')})

body('''{"name":"@making"}''')
}}
shouldCreateCustomer.groovy
Created by
Consumer
© 2016 Pivotal Software, Inc. All rights reserved.
Prepare Parent Test Class
@RunWith(SpringRunner.class)

@SpringBootTest(webEnvironment = WebEnvironment.NONE)
@AutoConfigureMessageVerifier

public abstract class MsgTestBase {
@Autowired CustomerService service;
protected void create() {
service.create("@making"); 

}
}
© 2016 Pivotal Software, Inc. All rights reserved.
Prepare Parent Test Class
@RunWith(SpringRunner.class)

@SpringBootTest(webEnvironment = WebEnvironment.NONE)
@AutoConfigureMessageVerifier

public abstract class MsgTestBase {
@Autowired CustomerService service;
protected void create() {
service.create("@making"); 

}
}
Created by
Producer
© 2016 Pivotal Software, Inc. All rights reserved.
Contract DSL
Contract.make {
label 'create-customer'
input {
triggeredBy('create()')
}
outputMessage {
sentTo('demo-strm')
headers({header('Content-Type':'...')})

body('''{"name":"@making"}''')
}}
shouldCreateCustomer.groovy
© 2016 Pivotal Software, Inc. All rights reserved.
Contract DSL
Contract.make {
label 'create-customer'
input {
triggeredBy('create()')
}
outputMessage {
sentTo('demo-strm')
headers({header('Content-Type':'...')})

body('''{"name":"@making"}''')
}}
shouldCreateCustomer.groovy
Updated by
Producer
© 2016 Pivotal Software, Inc. All rights reserved.
Generated Acceptance Test
public class ContractVerifierTest extends MsgTestBase {
// ...
@Test public void validate_shouldCreateCustomer() {
create();
ContractVerifierMessage res = verifierMessaging
.receive("customer");

assertThat(res).isNotNull();
DocumentContext parsedJson = JsonPath.parse(
objectMapper.writeValueAsString(res.getPayload()));
assertThatJson(parsedJson).field("name")
.isEqualTo("@making");

}}
© 2016 Pivotal Software, Inc. All rights reserved.
Spring Cloud Contract Maven Plugin
mvn spring-cloud-contract:generateTests
mvn spring-cloud-contract:convert
mvn spring-cloud-contract:generateStubs
Acceptance Test
WireMock stub file (only for REST)
Stub jar file
© 2016 Pivotal Software, Inc. All rights reserved.
Consumer Side Test
@RunWith(SpringRunner.class)

@SpringBootTest(webEnvironment = WebEnvironment.NONE)
@AutoConfigureStubRunner(ids = "com.example:customer-
service", workOffline = true)

public class PointServiceConsumerTest {
@Autowired StubTrigger stubTrigger;
// ...
@Test public void testCreateCustomer() {
stubTrigger.trigger("create-customer");
// assert that the message is received ...

}
}
© 2016 Pivotal Software, Inc. All rights reserved.
Check sample code
•http://bit.ly/making_ccc_a3
© 2016 Pivotal Software, Inc. All rights reserved.
(FYI) CQRS and Event Sourcing
• https://spring.io/blog/2016/11/08/cqrs-and-event-sourcing-
with-jakub-pilimon
• https://github.com/pilloPl/event-source-cqrs-sample
‹#›© 2016 Pivotal Software, Inc. All rights reserved.
Data Microservices
with Spring Cloud Data Flow
© 2016 Pivotal Software, Inc. All rights reserved.
Data Microservices
$ cat book.txt | tr ' ' '¥ ' | tr '[:upper:]' '[:lower:]' |
tr -d '[:punct:]' |
grep -v '[^a-z]‘ |
sort | uniq -c | sort -rn | head
© 2016 Pivotal Software, Inc. All rights reserved.
Data Microservices
$ cat book.txt | tr ' ' '¥ ' | tr '[:upper:]' '[:lower:]' |
tr -d '[:punct:]' |
grep -v '[^a-z]‘ |
sort | uniq -c | sort -rn | head
© 2016 Pivotal Software, Inc. All rights reserved.
Data Microservices
$ cat book.txt | tr ' ' '¥ ' | tr '[:upper:]' '[:lower:]' |
tr -d '[:punct:]' |
grep -v '[^a-z]‘ |
sort | uniq -c | sort -rn | head
Microservice for each data processing
© 2016 Pivotal Software, Inc. All rights reserved.
Data Microservices
$ cat book.txt | tr ' ' '¥ ' | tr '[:upper:]' '[:lower:]' |
tr -d '[:punct:]' |
grep -v '[^a-z]‘ |
sort | uniq -c | sort -rn | head
Microservice for each data processing
© 2016 Pivotal Software, Inc. All rights reserved.
Data Microservices
$ cat book.txt | tr ' ' '¥ ' | tr '[:upper:]' '[:lower:]' |
tr -d '[:punct:]' |
grep -v '[^a-z]‘ |
sort | uniq -c | sort -rn | head
Microservice for each data processing
bound with
Message Brokers
© 2016 Pivotal Software, Inc. All rights reserved.
Data Microservices
$ cat book.txt | tr ' ' '¥ ' | tr '[:upper:]' '[:lower:]' |
tr -d '[:punct:]' |
grep -v '[^a-z]‘ |
sort | uniq -c | sort -rn | head
Microservice for each data processing
bound with
Message Brokers
© 2016 Pivotal Software, Inc. All rights reserved.
Data Microservices
$ cat book.txt | tr ' ' '¥ ' | tr '[:upper:]' '[:lower:]' |
tr -d '[:punct:]' |
grep -v '[^a-z]‘ |
sort | uniq -c | sort -rn | head
Microservice for each data processing
bound with
Message Brokers
on the modern platform such as Cloud Foundry
© 2016 Pivotal Software, Inc. All rights reserved.
Data Microservices
$ cat book.txt | tr ' ' '¥ ' | tr '[:upper:]' '[:lower:]' |
tr -d '[:punct:]' |
grep -v '[^a-z]‘ |
sort | uniq -c | sort -rn | head
Microservice for each data processing
bound with
Message Brokers
on the modern platform such as Cloud Foundry
© 2016 Pivotal Software, Inc. All rights reserved.
Data Microservices
$ cat book.txt | tr ' ' '¥ ' | tr '[:upper:]' '[:lower:]' |
tr -d '[:punct:]' |
grep -v '[^a-z]‘ |
sort | uniq -c | sort -rn | head
Microservice for each data processing
bound with
Message Brokers
on the modern platform such as Cloud Foundry
© 2016 Pivotal Software, Inc. All rights reserved.
Spring Cloud Data Flow
• Microservices-based Distributed Data Pipelines
•Long Lived Stream Applications
•Short Lived Task Applications
© 2016 Pivotal Software, Inc. All rights reserved.
Spring Cloud Data Flow
• Microservices-based Distributed Data Pipelines
•Long Lived Stream Applications
•Short Lived Task Applications
Spring Cloud Stream
© 2016 Pivotal Software, Inc. All rights reserved.
Spring Cloud Data Flow
• Microservices-based Distributed Data Pipelines
•Long Lived Stream Applications
•Short Lived Task Applications
Spring Cloud Stream
Spring Cloud Task
© 2016 Pivotal Software, Inc. All rights reserved.
Spring Cloud Data Flow
• Microservices-based Distributed Data Pipelines
•Long Lived Stream Applications
•Short Lived Task Applications
Spring Cloud Stream
Spring Cloud Task
Orchestration
Layer
© 2016 Pivotal Software, Inc. All rights reserved.
Check my slide
• http://www.slideshare.net/makingx/data-microservices-with-
spring-cloud-stream-task-and-data-flow-jsug-springday
‹#›© 2016 Pivotal Software, Inc. All rights reserved.
Deploy Stream Apps
to Cloud Foundry
© 2016 Pivotal Software, Inc. All rights reserved.
Cloud Foundry
•https://www.cloudfoundry.org/
•Cloud Native Platform
•OSS
•Spring ❤ Cloud Foundry
•Support Multi IaaS 

(AWS, Azure, GCP, vSphere, OpenStack)
© 2016 Pivotal Software, Inc. All rights reserved.
Cloud Foundry everywhere
Public Cloud Foundry
Private Cloud Foundry
Development
OSS ver Pivotal
Cloud Foundry
on
Premise
on
Public Cloud
© 2016 Pivotal Software, Inc. All rights reserved.
PCF Dev
• https://docs.pivotal.io/pcf-dev
• Cloud Foundry on your laptop
• Included
• Redis / RabbitMQ / MySQL
• Spring Cloud Services
• Install with cf dev start
© 2016 Pivotal Software, Inc. All rights reserved.
Pivotal Web Services
•https://run.pivotal.io/
•Public Cloud Foundry managed by Pivotal
•$0.03/GB-hr (≈ ¥2200/GB-month)
•$87 of free trial credit.
© 2016 Pivotal Software, Inc. All rights reserved.
Deploy Spring Cloud Stream Apps
cf push my-source my-source.jar --no-start
cf bind-service my-source my-binder
cf start my-source
cf push my-sink my-sink.jar --no-start
cf bind-service my-sink my-binder
cf start my-sink
# in case of PCF Dev
cf create-service p-rabbitmq standard my-binder
# in case of Pivotal Web Services
cf create-service cloudamqp lemur my-binder
© 2016 Pivotal Software, Inc. All rights reserved.
Sample Application http://bit.ly/making_ccc_a3
Pivotal Web Services / PCF Dev
Frontend
Customer
Service
Email
Service
Point
Service
Post
ServiceZipkin
Server
MySQL
SendGrid
MySQL
MySQL
DLQ
Recovery
RabbitMQ
HTTP
© 2016 Pivotal Software, Inc. All rights reserved.
Tutorial
https://github.com/Pivotal-Japan/spring-cloud-stream-tutorial
© 2016 Pivotal Software, Inc. All rights reserved.
Thanks!!
• https://cloud.spring.io/spring-cloud-stream/
• https://cloud.spring.io/spring-cloud-dataflow/
• https://cloud.spring.io/spring-cloud-sleuth/
• http://zipkin.io/
• https://cloud.spring.io/spring-cloud-contract/
• https://projects.spring.io/spring-amqp/
• https://run.pivotal.io/

More Related Content

What's hot

20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model  20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model Amazon Web Services Japan
 
iOSにおけるパフォーマンス計測
iOSにおけるパフォーマンス計測iOSにおけるパフォーマンス計測
iOSにおけるパフォーマンス計測Toshiyuki Hirata
 
Kinesis + Elasticsearchでつくるさいきょうのログ分析基盤
Kinesis + Elasticsearchでつくるさいきょうのログ分析基盤Kinesis + Elasticsearchでつくるさいきょうのログ分析基盤
Kinesis + Elasticsearchでつくるさいきょうのログ分析基盤Amazon Web Services Japan
 
Spring Boot + Netflix Eureka
Spring Boot + Netflix EurekaSpring Boot + Netflix Eureka
Spring Boot + Netflix Eureka心 谷本
 
さくっと理解するSpring bootの仕組み
さくっと理解するSpring bootの仕組みさくっと理解するSpring bootの仕組み
さくっと理解するSpring bootの仕組みTakeshi Ogawa
 
なぜ「マイクロサービス“化”」が必要なのか
なぜ「マイクロサービス“化”」が必要なのかなぜ「マイクロサービス“化”」が必要なのか
なぜ「マイクロサービス“化”」が必要なのかYusuke Suzuki
 
モノリスからマイクロサービスへの移行 ~ストラングラーパターンの検証~(Spring Fest 2020講演資料)
モノリスからマイクロサービスへの移行 ~ストラングラーパターンの検証~(Spring Fest 2020講演資料)モノリスからマイクロサービスへの移行 ~ストラングラーパターンの検証~(Spring Fest 2020講演資料)
モノリスからマイクロサービスへの移行 ~ストラングラーパターンの検証~(Spring Fest 2020講演資料)NTT DATA Technology & Innovation
 
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデートAmazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデートAmazon Web Services Japan
 
マイクロサービス 4つの分割アプローチ
マイクロサービス 4つの分割アプローチマイクロサービス 4つの分割アプローチ
マイクロサービス 4つの分割アプローチ増田 亨
 
Azure API Management 俺的マニュアル
Azure API Management 俺的マニュアルAzure API Management 俺的マニュアル
Azure API Management 俺的マニュアル貴志 上坂
 
PostgreSQLの行レベルセキュリティと SpringAOPでマルチテナントの ユーザー間情報漏洩を防止する (JJUG CCC 2021 Spring)
PostgreSQLの行レベルセキュリティと SpringAOPでマルチテナントの ユーザー間情報漏洩を防止する (JJUG CCC 2021 Spring)PostgreSQLの行レベルセキュリティと SpringAOPでマルチテナントの ユーザー間情報漏洩を防止する (JJUG CCC 2021 Spring)
PostgreSQLの行レベルセキュリティと SpringAOPでマルチテナントの ユーザー間情報漏洩を防止する (JJUG CCC 2021 Spring)Koichiro Matsuoka
 
20190514 AWS Black Belt Online Seminar Amazon API Gateway
20190514 AWS Black Belt Online Seminar Amazon API Gateway 20190514 AWS Black Belt Online Seminar Amazon API Gateway
20190514 AWS Black Belt Online Seminar Amazon API Gateway Amazon Web Services Japan
 
分散トレーシングAWS:X-Rayとの上手い付き合い方
分散トレーシングAWS:X-Rayとの上手い付き合い方分散トレーシングAWS:X-Rayとの上手い付き合い方
分散トレーシングAWS:X-Rayとの上手い付き合い方Recruit Lifestyle Co., Ltd.
 
Spring Boot ユーザの方のための Quarkus 入門
Spring Boot ユーザの方のための Quarkus 入門Spring Boot ユーザの方のための Quarkus 入門
Spring Boot ユーザの方のための Quarkus 入門tsukasamannen
 
Amazon EKS への道 ~ EKS 再入門 ~
Amazon EKS への道 ~ EKS 再入門 ~Amazon EKS への道 ~ EKS 再入門 ~
Amazon EKS への道 ~ EKS 再入門 ~Hideaki Aoyagi
 
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
20190220 AWS Black Belt Online Seminar Amazon S3 / GlacierAmazon Web Services Japan
 
Containers Docker Kind Kubernetes Istio
Containers Docker Kind Kubernetes IstioContainers Docker Kind Kubernetes Istio
Containers Docker Kind Kubernetes IstioAraf Karsh Hamid
 

What's hot (20)

20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model  20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
 
iOSにおけるパフォーマンス計測
iOSにおけるパフォーマンス計測iOSにおけるパフォーマンス計測
iOSにおけるパフォーマンス計測
 
Kinesis + Elasticsearchでつくるさいきょうのログ分析基盤
Kinesis + Elasticsearchでつくるさいきょうのログ分析基盤Kinesis + Elasticsearchでつくるさいきょうのログ分析基盤
Kinesis + Elasticsearchでつくるさいきょうのログ分析基盤
 
Spring Boot + Netflix Eureka
Spring Boot + Netflix EurekaSpring Boot + Netflix Eureka
Spring Boot + Netflix Eureka
 
さくっと理解するSpring bootの仕組み
さくっと理解するSpring bootの仕組みさくっと理解するSpring bootの仕組み
さくっと理解するSpring bootの仕組み
 
なぜ「マイクロサービス“化”」が必要なのか
なぜ「マイクロサービス“化”」が必要なのかなぜ「マイクロサービス“化”」が必要なのか
なぜ「マイクロサービス“化”」が必要なのか
 
モノリスからマイクロサービスへの移行 ~ストラングラーパターンの検証~(Spring Fest 2020講演資料)
モノリスからマイクロサービスへの移行 ~ストラングラーパターンの検証~(Spring Fest 2020講演資料)モノリスからマイクロサービスへの移行 ~ストラングラーパターンの検証~(Spring Fest 2020講演資料)
モノリスからマイクロサービスへの移行 ~ストラングラーパターンの検証~(Spring Fest 2020講演資料)
 
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデートAmazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
 
Serverless時代のJavaについて
Serverless時代のJavaについてServerless時代のJavaについて
Serverless時代のJavaについて
 
マイクロサービス 4つの分割アプローチ
マイクロサービス 4つの分割アプローチマイクロサービス 4つの分割アプローチ
マイクロサービス 4つの分割アプローチ
 
Azure API Management 俺的マニュアル
Azure API Management 俺的マニュアルAzure API Management 俺的マニュアル
Azure API Management 俺的マニュアル
 
PostgreSQLの行レベルセキュリティと SpringAOPでマルチテナントの ユーザー間情報漏洩を防止する (JJUG CCC 2021 Spring)
PostgreSQLの行レベルセキュリティと SpringAOPでマルチテナントの ユーザー間情報漏洩を防止する (JJUG CCC 2021 Spring)PostgreSQLの行レベルセキュリティと SpringAOPでマルチテナントの ユーザー間情報漏洩を防止する (JJUG CCC 2021 Spring)
PostgreSQLの行レベルセキュリティと SpringAOPでマルチテナントの ユーザー間情報漏洩を防止する (JJUG CCC 2021 Spring)
 
20190514 AWS Black Belt Online Seminar Amazon API Gateway
20190514 AWS Black Belt Online Seminar Amazon API Gateway 20190514 AWS Black Belt Online Seminar Amazon API Gateway
20190514 AWS Black Belt Online Seminar Amazon API Gateway
 
分散トレーシングAWS:X-Rayとの上手い付き合い方
分散トレーシングAWS:X-Rayとの上手い付き合い方分散トレーシングAWS:X-Rayとの上手い付き合い方
分散トレーシングAWS:X-Rayとの上手い付き合い方
 
20191125 Container Security
20191125 Container Security20191125 Container Security
20191125 Container Security
 
Spring Boot ユーザの方のための Quarkus 入門
Spring Boot ユーザの方のための Quarkus 入門Spring Boot ユーザの方のための Quarkus 入門
Spring Boot ユーザの方のための Quarkus 入門
 
Amazon EKS への道 ~ EKS 再入門 ~
Amazon EKS への道 ~ EKS 再入門 ~Amazon EKS への道 ~ EKS 再入門 ~
Amazon EKS への道 ~ EKS 再入門 ~
 
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
 
TLS, HTTP/2演習
TLS, HTTP/2演習TLS, HTTP/2演習
TLS, HTTP/2演習
 
Containers Docker Kind Kubernetes Istio
Containers Docker Kind Kubernetes IstioContainers Docker Kind Kubernetes Istio
Containers Docker Kind Kubernetes Istio
 

Viewers also liked

SpringOne 2GX 2014 参加報告 & Spring 4.1について #jsug
SpringOne 2GX 2014 参加報告 & Spring 4.1について #jsugSpringOne 2GX 2014 参加報告 & Spring 4.1について #jsug
SpringOne 2GX 2014 参加報告 & Spring 4.1について #jsugToshiaki Maki
 
Data Microservices with Spring Cloud Stream, Task, and Data Flow #jsug #spri...
Data Microservices with Spring Cloud Stream, Task,  and Data Flow #jsug #spri...Data Microservices with Spring Cloud Stream, Task,  and Data Flow #jsug #spri...
Data Microservices with Spring Cloud Stream, Task, and Data Flow #jsug #spri...Toshiaki Maki
 
ビッグじゃなくても使えるSpark Streaming
ビッグじゃなくても使えるSpark Streamingビッグじゃなくても使えるSpark Streaming
ビッグじゃなくても使えるSpark Streamingchibochibo
 
Java トラブル解析支援ツール HeapStats のご紹介
Java トラブル解析支援ツール HeapStats のご紹介Java トラブル解析支援ツール HeapStats のご紹介
Java トラブル解析支援ツール HeapStats のご紹介Shinya Takebayashi
 
サーバーレスでシステムを開発する時に⼤切な事
サーバーレスでシステムを開発する時に⼤切な事サーバーレスでシステムを開発する時に⼤切な事
サーバーレスでシステムを開発する時に⼤切な事Hiroyuki Hiki
 
マイクロサービスに必要な技術要素はすべてSpring Cloudにある #DO07
マイクロサービスに必要な技術要素はすべてSpring Cloudにある #DO07マイクロサービスに必要な技術要素はすべてSpring Cloudにある #DO07
マイクロサービスに必要な技術要素はすべてSpring Cloudにある #DO07Toshiaki Maki
 
AWSでアプリ開発するなら 知っておくべこと
AWSでアプリ開発するなら 知っておくべことAWSでアプリ開発するなら 知っておくべこと
AWSでアプリ開発するなら 知っておくべことKeisuke Nishitani
 
ぱぱっと理解するSpring Cloudの基本
ぱぱっと理解するSpring Cloudの基本ぱぱっと理解するSpring Cloudの基本
ぱぱっと理解するSpring Cloudの基本kazuki kumagai
 
SIerもはじめる わたしたちのDevOps #jjug_ccc
SIerもはじめる わたしたちのDevOps #jjug_cccSIerもはじめる わたしたちのDevOps #jjug_ccc
SIerもはじめる わたしたちのDevOps #jjug_cccMizuki Ugajin
 
形式手法で捗る!インフラ構成の設計と検証
形式手法で捗る!インフラ構成の設計と検証形式手法で捗る!インフラ構成の設計と検証
形式手法で捗る!インフラ構成の設計と検証y_taka_23
 
Spring 5に備えるリアクティブプログラミング入門
Spring 5に備えるリアクティブプログラミング入門Spring 5に備えるリアクティブプログラミング入門
Spring 5に備えるリアクティブプログラミング入門Takuya Iwatsuka
 
3000社の業務データ絞り込みを支える技術
3000社の業務データ絞り込みを支える技術3000社の業務データ絞り込みを支える技術
3000社の業務データ絞り込みを支える技術Ryo Mitoma
 
WalB: Real-time and Incremental Backup System for Block Devices
WalB: Real-time and Incremental Backup System for Block DevicesWalB: Real-time and Incremental Backup System for Block Devices
WalB: Real-time and Incremental Backup System for Block Devicesuchan_nos
 
離れた場所でも最高のチームワークを実現する方法 ーサイボウズ開発チームのリモートワーク事例ー
離れた場所でも最高のチームワークを実現する方法 ーサイボウズ開発チームのリモートワーク事例ー離れた場所でも最高のチームワークを実現する方法 ーサイボウズ開発チームのリモートワーク事例ー
離れた場所でも最高のチームワークを実現する方法 ーサイボウズ開発チームのリモートワーク事例ーTeppei Sato
 
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜Jumpei Miyata
 
あなたの開発チームには、チームワークがあふれていますか?
 あなたの開発チームには、チームワークがあふれていますか? あなたの開発チームには、チームワークがあふれていますか?
あなたの開発チームには、チームワークがあふれていますか?Yusuke Amano
 
DDD x CQRS 更新系と参照系で異なるORMを併用して上手くいった話
DDD x CQRS   更新系と参照系で異なるORMを併用して上手くいった話DDD x CQRS   更新系と参照系で異なるORMを併用して上手くいった話
DDD x CQRS 更新系と参照系で異なるORMを併用して上手くいった話Koichiro Matsuoka
 
Spring Bootの本当の理解ポイント #jjug
Spring Bootの本当の理解ポイント #jjugSpring Bootの本当の理解ポイント #jjug
Spring Bootの本当の理解ポイント #jjugMasatoshi Tada
 

Viewers also liked (19)

SpringOne 2GX 2014 参加報告 & Spring 4.1について #jsug
SpringOne 2GX 2014 参加報告 & Spring 4.1について #jsugSpringOne 2GX 2014 参加報告 & Spring 4.1について #jsug
SpringOne 2GX 2014 参加報告 & Spring 4.1について #jsug
 
Data Microservices with Spring Cloud Stream, Task, and Data Flow #jsug #spri...
Data Microservices with Spring Cloud Stream, Task,  and Data Flow #jsug #spri...Data Microservices with Spring Cloud Stream, Task,  and Data Flow #jsug #spri...
Data Microservices with Spring Cloud Stream, Task, and Data Flow #jsug #spri...
 
ビッグじゃなくても使えるSpark Streaming
ビッグじゃなくても使えるSpark Streamingビッグじゃなくても使えるSpark Streaming
ビッグじゃなくても使えるSpark Streaming
 
Java トラブル解析支援ツール HeapStats のご紹介
Java トラブル解析支援ツール HeapStats のご紹介Java トラブル解析支援ツール HeapStats のご紹介
Java トラブル解析支援ツール HeapStats のご紹介
 
サーバーレスでシステムを開発する時に⼤切な事
サーバーレスでシステムを開発する時に⼤切な事サーバーレスでシステムを開発する時に⼤切な事
サーバーレスでシステムを開発する時に⼤切な事
 
マイクロサービスに必要な技術要素はすべてSpring Cloudにある #DO07
マイクロサービスに必要な技術要素はすべてSpring Cloudにある #DO07マイクロサービスに必要な技術要素はすべてSpring Cloudにある #DO07
マイクロサービスに必要な技術要素はすべてSpring Cloudにある #DO07
 
AWSでアプリ開発するなら 知っておくべこと
AWSでアプリ開発するなら 知っておくべことAWSでアプリ開発するなら 知っておくべこと
AWSでアプリ開発するなら 知っておくべこと
 
ぱぱっと理解するSpring Cloudの基本
ぱぱっと理解するSpring Cloudの基本ぱぱっと理解するSpring Cloudの基本
ぱぱっと理解するSpring Cloudの基本
 
SIerもはじめる わたしたちのDevOps #jjug_ccc
SIerもはじめる わたしたちのDevOps #jjug_cccSIerもはじめる わたしたちのDevOps #jjug_ccc
SIerもはじめる わたしたちのDevOps #jjug_ccc
 
形式手法で捗る!インフラ構成の設計と検証
形式手法で捗る!インフラ構成の設計と検証形式手法で捗る!インフラ構成の設計と検証
形式手法で捗る!インフラ構成の設計と検証
 
Spring 5に備えるリアクティブプログラミング入門
Spring 5に備えるリアクティブプログラミング入門Spring 5に備えるリアクティブプログラミング入門
Spring 5に備えるリアクティブプログラミング入門
 
形態素解析
形態素解析形態素解析
形態素解析
 
3000社の業務データ絞り込みを支える技術
3000社の業務データ絞り込みを支える技術3000社の業務データ絞り込みを支える技術
3000社の業務データ絞り込みを支える技術
 
WalB: Real-time and Incremental Backup System for Block Devices
WalB: Real-time and Incremental Backup System for Block DevicesWalB: Real-time and Incremental Backup System for Block Devices
WalB: Real-time and Incremental Backup System for Block Devices
 
離れた場所でも最高のチームワークを実現する方法 ーサイボウズ開発チームのリモートワーク事例ー
離れた場所でも最高のチームワークを実現する方法 ーサイボウズ開発チームのリモートワーク事例ー離れた場所でも最高のチームワークを実現する方法 ーサイボウズ開発チームのリモートワーク事例ー
離れた場所でも最高のチームワークを実現する方法 ーサイボウズ開発チームのリモートワーク事例ー
 
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
 
あなたの開発チームには、チームワークがあふれていますか?
 あなたの開発チームには、チームワークがあふれていますか? あなたの開発チームには、チームワークがあふれていますか?
あなたの開発チームには、チームワークがあふれていますか?
 
DDD x CQRS 更新系と参照系で異なるORMを併用して上手くいった話
DDD x CQRS   更新系と参照系で異なるORMを併用して上手くいった話DDD x CQRS   更新系と参照系で異なるORMを併用して上手くいった話
DDD x CQRS 更新系と参照系で異なるORMを併用して上手くいった話
 
Spring Bootの本当の理解ポイント #jjug
Spring Bootの本当の理解ポイント #jjugSpring Bootの本当の理解ポイント #jjug
Spring Bootの本当の理解ポイント #jjug
 

Similar to EVENT DRIVEN MICROSERVICES WITH SPRING CLOUD STREAM

Spring Cloud Servicesの紹介 #pcf_tokyo
Spring Cloud Servicesの紹介 #pcf_tokyoSpring Cloud Servicesの紹介 #pcf_tokyo
Spring Cloud Servicesの紹介 #pcf_tokyoToshiaki Maki
 
How to Architect and Develop Cloud Native Applications
How to Architect and Develop Cloud Native ApplicationsHow to Architect and Develop Cloud Native Applications
How to Architect and Develop Cloud Native ApplicationsSufyaan Kazi
 
Cloud Foundy Java Client V 2.0 #cf_tokyo
Cloud Foundy Java Client V 2.0 #cf_tokyoCloud Foundy Java Client V 2.0 #cf_tokyo
Cloud Foundy Java Client V 2.0 #cf_tokyoToshiaki Maki
 
From Zero to Hero with REST and OAuth2 #jjug
From Zero to Hero with REST and OAuth2 #jjugFrom Zero to Hero with REST and OAuth2 #jjug
From Zero to Hero with REST and OAuth2 #jjugToshiaki Maki
 
今すぐ始めるCloud Foundry #hackt #hackt_k
今すぐ始めるCloud Foundry #hackt #hackt_k今すぐ始めるCloud Foundry #hackt #hackt_k
今すぐ始めるCloud Foundry #hackt #hackt_kToshiaki Maki
 
Pivotal Cloud Foundry: A Technical Overview
Pivotal Cloud Foundry: A Technical OverviewPivotal Cloud Foundry: A Technical Overview
Pivotal Cloud Foundry: A Technical OverviewVMware Tanzu
 
Pivotal Cloud Foundry: A Technical Overview
Pivotal Cloud Foundry: A Technical OverviewPivotal Cloud Foundry: A Technical Overview
Pivotal Cloud Foundry: A Technical OverviewVMware Tanzu
 
Pivotal microservices spring_pcf_skillsmatter.pptx
Pivotal microservices spring_pcf_skillsmatter.pptxPivotal microservices spring_pcf_skillsmatter.pptx
Pivotal microservices spring_pcf_skillsmatter.pptxSufyaan Kazi
 
To Microservices and Beyond
To Microservices and BeyondTo Microservices and Beyond
To Microservices and BeyondMatt Stine
 
Spring Framework 5.0による Reactive Web Application #JavaDayTokyo
Spring Framework 5.0による Reactive Web Application #JavaDayTokyoSpring Framework 5.0による Reactive Web Application #JavaDayTokyo
Spring Framework 5.0による Reactive Web Application #JavaDayTokyoToshiaki Maki
 
How to build unified Batch & Streaming Pipelines with Apache Beam and Dataflow
How to build unified Batch & Streaming Pipelines with Apache Beam and DataflowHow to build unified Batch & Streaming Pipelines with Apache Beam and Dataflow
How to build unified Batch & Streaming Pipelines with Apache Beam and DataflowDaniel Zivkovic
 
CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...
CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...
CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...Amazon Web Services
 
Product Release Webinar- WSO2 Developer Studio 3.5
Product Release Webinar- WSO2 Developer Studio 3.5Product Release Webinar- WSO2 Developer Studio 3.5
Product Release Webinar- WSO2 Developer Studio 3.5WSO2
 
Cloud-Native Streaming and Event-Driven Microservices
Cloud-Native Streaming and Event-Driven MicroservicesCloud-Native Streaming and Event-Driven Microservices
Cloud-Native Streaming and Event-Driven MicroservicesVMware Tanzu
 
Building CI-CD Pipelines for Serverless Applications
Building CI-CD Pipelines for Serverless ApplicationsBuilding CI-CD Pipelines for Serverless Applications
Building CI-CD Pipelines for Serverless ApplicationsAmazon Web Services
 
Grow your SharePoint development platform with SharePoint Framework
Grow your SharePoint development platform with SharePoint FrameworkGrow your SharePoint development platform with SharePoint Framework
Grow your SharePoint development platform with SharePoint FrameworkDipti Chhatrapati
 
Spring on PAS - Fabio Marinelli
Spring on PAS - Fabio MarinelliSpring on PAS - Fabio Marinelli
Spring on PAS - Fabio MarinelliVMware Tanzu
 
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...Kai Wähner
 
Platform as Art: A Developer’s Perspective
Platform as Art: A Developer’s PerspectivePlatform as Art: A Developer’s Perspective
Platform as Art: A Developer’s PerspectiveBrian Deitte
 
Manchester geek night pcf 101
Manchester geek night   pcf 101Manchester geek night   pcf 101
Manchester geek night pcf 101Sufyaan Kazi
 

Similar to EVENT DRIVEN MICROSERVICES WITH SPRING CLOUD STREAM (20)

Spring Cloud Servicesの紹介 #pcf_tokyo
Spring Cloud Servicesの紹介 #pcf_tokyoSpring Cloud Servicesの紹介 #pcf_tokyo
Spring Cloud Servicesの紹介 #pcf_tokyo
 
How to Architect and Develop Cloud Native Applications
How to Architect and Develop Cloud Native ApplicationsHow to Architect and Develop Cloud Native Applications
How to Architect and Develop Cloud Native Applications
 
Cloud Foundy Java Client V 2.0 #cf_tokyo
Cloud Foundy Java Client V 2.0 #cf_tokyoCloud Foundy Java Client V 2.0 #cf_tokyo
Cloud Foundy Java Client V 2.0 #cf_tokyo
 
From Zero to Hero with REST and OAuth2 #jjug
From Zero to Hero with REST and OAuth2 #jjugFrom Zero to Hero with REST and OAuth2 #jjug
From Zero to Hero with REST and OAuth2 #jjug
 
今すぐ始めるCloud Foundry #hackt #hackt_k
今すぐ始めるCloud Foundry #hackt #hackt_k今すぐ始めるCloud Foundry #hackt #hackt_k
今すぐ始めるCloud Foundry #hackt #hackt_k
 
Pivotal Cloud Foundry: A Technical Overview
Pivotal Cloud Foundry: A Technical OverviewPivotal Cloud Foundry: A Technical Overview
Pivotal Cloud Foundry: A Technical Overview
 
Pivotal Cloud Foundry: A Technical Overview
Pivotal Cloud Foundry: A Technical OverviewPivotal Cloud Foundry: A Technical Overview
Pivotal Cloud Foundry: A Technical Overview
 
Pivotal microservices spring_pcf_skillsmatter.pptx
Pivotal microservices spring_pcf_skillsmatter.pptxPivotal microservices spring_pcf_skillsmatter.pptx
Pivotal microservices spring_pcf_skillsmatter.pptx
 
To Microservices and Beyond
To Microservices and BeyondTo Microservices and Beyond
To Microservices and Beyond
 
Spring Framework 5.0による Reactive Web Application #JavaDayTokyo
Spring Framework 5.0による Reactive Web Application #JavaDayTokyoSpring Framework 5.0による Reactive Web Application #JavaDayTokyo
Spring Framework 5.0による Reactive Web Application #JavaDayTokyo
 
How to build unified Batch & Streaming Pipelines with Apache Beam and Dataflow
How to build unified Batch & Streaming Pipelines with Apache Beam and DataflowHow to build unified Batch & Streaming Pipelines with Apache Beam and Dataflow
How to build unified Batch & Streaming Pipelines with Apache Beam and Dataflow
 
CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...
CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...
CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...
 
Product Release Webinar- WSO2 Developer Studio 3.5
Product Release Webinar- WSO2 Developer Studio 3.5Product Release Webinar- WSO2 Developer Studio 3.5
Product Release Webinar- WSO2 Developer Studio 3.5
 
Cloud-Native Streaming and Event-Driven Microservices
Cloud-Native Streaming and Event-Driven MicroservicesCloud-Native Streaming and Event-Driven Microservices
Cloud-Native Streaming and Event-Driven Microservices
 
Building CI-CD Pipelines for Serverless Applications
Building CI-CD Pipelines for Serverless ApplicationsBuilding CI-CD Pipelines for Serverless Applications
Building CI-CD Pipelines for Serverless Applications
 
Grow your SharePoint development platform with SharePoint Framework
Grow your SharePoint development platform with SharePoint FrameworkGrow your SharePoint development platform with SharePoint Framework
Grow your SharePoint development platform with SharePoint Framework
 
Spring on PAS - Fabio Marinelli
Spring on PAS - Fabio MarinelliSpring on PAS - Fabio Marinelli
Spring on PAS - Fabio Marinelli
 
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
 
Platform as Art: A Developer’s Perspective
Platform as Art: A Developer’s PerspectivePlatform as Art: A Developer’s Perspective
Platform as Art: A Developer’s Perspective
 
Manchester geek night pcf 101
Manchester geek night   pcf 101Manchester geek night   pcf 101
Manchester geek night pcf 101
 

More from Toshiaki Maki

From Spring Boot 2.2 to Spring Boot 2.3 #jsug
From Spring Boot 2.2 to Spring Boot 2.3 #jsugFrom Spring Boot 2.2 to Spring Boot 2.3 #jsug
From Spring Boot 2.2 to Spring Boot 2.3 #jsugToshiaki Maki
 
Concourse x Spinnaker #concourse_tokyo
Concourse x Spinnaker #concourse_tokyoConcourse x Spinnaker #concourse_tokyo
Concourse x Spinnaker #concourse_tokyoToshiaki Maki
 
Serverless with Spring Cloud Function, Knative and riff #SpringOneTour #s1t
Serverless with Spring Cloud Function, Knative and riff #SpringOneTour #s1tServerless with Spring Cloud Function, Knative and riff #SpringOneTour #s1t
Serverless with Spring Cloud Function, Knative and riff #SpringOneTour #s1tToshiaki Maki
 
決済システムの内製化への旅 - SpringとPCFで作るクラウドネイティブなシステム開発 #jsug #sf_h1
決済システムの内製化への旅 - SpringとPCFで作るクラウドネイティブなシステム開発 #jsug #sf_h1決済システムの内製化への旅 - SpringとPCFで作るクラウドネイティブなシステム開発 #jsug #sf_h1
決済システムの内製化への旅 - SpringとPCFで作るクラウドネイティブなシステム開発 #jsug #sf_h1Toshiaki Maki
 
Spring Boot Actuator 2.0 & Micrometer #jjug_ccc #ccc_a1
Spring Boot Actuator 2.0 & Micrometer #jjug_ccc #ccc_a1Spring Boot Actuator 2.0 & Micrometer #jjug_ccc #ccc_a1
Spring Boot Actuator 2.0 & Micrometer #jjug_ccc #ccc_a1Toshiaki Maki
 
Spring Boot Actuator 2.0 & Micrometer
Spring Boot Actuator 2.0 & MicrometerSpring Boot Actuator 2.0 & Micrometer
Spring Boot Actuator 2.0 & MicrometerToshiaki Maki
 
Open Service Broker APIとKubernetes Service Catalog #k8sjp
Open Service Broker APIとKubernetes Service Catalog #k8sjpOpen Service Broker APIとKubernetes Service Catalog #k8sjp
Open Service Broker APIとKubernetes Service Catalog #k8sjpToshiaki Maki
 
Spring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsugSpring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsugToshiaki Maki
 
Introduction to Spring WebFlux #jsug #sf_a1
Introduction to Spring WebFlux #jsug #sf_a1Introduction to Spring WebFlux #jsug #sf_a1
Introduction to Spring WebFlux #jsug #sf_a1Toshiaki Maki
 
BOSH / CF Deployment in modern ways #cf_tokyo
BOSH / CF Deployment in modern ways #cf_tokyoBOSH / CF Deployment in modern ways #cf_tokyo
BOSH / CF Deployment in modern ways #cf_tokyoToshiaki Maki
 
Why PCF is the best platform for Spring Boot
Why PCF is the best platform for Spring BootWhy PCF is the best platform for Spring Boot
Why PCF is the best platform for Spring BootToshiaki Maki
 
Zipkin Components #zipkin_jp
Zipkin Components #zipkin_jpZipkin Components #zipkin_jp
Zipkin Components #zipkin_jpToshiaki Maki
 
実例で学ぶ、明日から使えるSpring Boot Tips #jsug
実例で学ぶ、明日から使えるSpring Boot Tips #jsug実例で学ぶ、明日から使えるSpring Boot Tips #jsug
実例で学ぶ、明日から使えるSpring Boot Tips #jsugToshiaki Maki
 
Spring ❤️ Kotlin #jjug
Spring ❤️ Kotlin #jjugSpring ❤️ Kotlin #jjug
Spring ❤️ Kotlin #jjugToshiaki Maki
 
Managing your Docker image continuously with Concourse CI
Managing your Docker image continuously with Concourse CIManaging your Docker image continuously with Concourse CI
Managing your Docker image continuously with Concourse CIToshiaki Maki
 
Short Lived Tasks in Cloud Foundry #cfdtokyo
Short Lived Tasks in Cloud Foundry #cfdtokyoShort Lived Tasks in Cloud Foundry #cfdtokyo
Short Lived Tasks in Cloud Foundry #cfdtokyoToshiaki Maki
 
Team Support in Concourse CI 2.0 #concourse_tokyo
Team Support in Concourse CI 2.0 #concourse_tokyoTeam Support in Concourse CI 2.0 #concourse_tokyo
Team Support in Concourse CI 2.0 #concourse_tokyoToshiaki Maki
 
Consumer Driven Contractsで REST API/マイクロサービスをテスト #m3tech
Consumer Driven Contractsで REST API/マイクロサービスをテスト #m3techConsumer Driven Contractsで REST API/マイクロサービスをテスト #m3tech
Consumer Driven Contractsで REST API/マイクロサービスをテスト #m3techToshiaki Maki
 
Implement Service Broker with Spring Boot #cf_tokyo
Implement Service Broker with Spring Boot #cf_tokyoImplement Service Broker with Spring Boot #cf_tokyo
Implement Service Broker with Spring Boot #cf_tokyoToshiaki Maki
 
#jjug_ccc #ccc_gh5 What's new in Spring Framework 4.3 / Boot 1.4 + Pivotal's ...
#jjug_ccc #ccc_gh5 What's new in Spring Framework 4.3 / Boot 1.4 + Pivotal's ...#jjug_ccc #ccc_gh5 What's new in Spring Framework 4.3 / Boot 1.4 + Pivotal's ...
#jjug_ccc #ccc_gh5 What's new in Spring Framework 4.3 / Boot 1.4 + Pivotal's ...Toshiaki Maki
 

More from Toshiaki Maki (20)

From Spring Boot 2.2 to Spring Boot 2.3 #jsug
From Spring Boot 2.2 to Spring Boot 2.3 #jsugFrom Spring Boot 2.2 to Spring Boot 2.3 #jsug
From Spring Boot 2.2 to Spring Boot 2.3 #jsug
 
Concourse x Spinnaker #concourse_tokyo
Concourse x Spinnaker #concourse_tokyoConcourse x Spinnaker #concourse_tokyo
Concourse x Spinnaker #concourse_tokyo
 
Serverless with Spring Cloud Function, Knative and riff #SpringOneTour #s1t
Serverless with Spring Cloud Function, Knative and riff #SpringOneTour #s1tServerless with Spring Cloud Function, Knative and riff #SpringOneTour #s1t
Serverless with Spring Cloud Function, Knative and riff #SpringOneTour #s1t
 
決済システムの内製化への旅 - SpringとPCFで作るクラウドネイティブなシステム開発 #jsug #sf_h1
決済システムの内製化への旅 - SpringとPCFで作るクラウドネイティブなシステム開発 #jsug #sf_h1決済システムの内製化への旅 - SpringとPCFで作るクラウドネイティブなシステム開発 #jsug #sf_h1
決済システムの内製化への旅 - SpringとPCFで作るクラウドネイティブなシステム開発 #jsug #sf_h1
 
Spring Boot Actuator 2.0 & Micrometer #jjug_ccc #ccc_a1
Spring Boot Actuator 2.0 & Micrometer #jjug_ccc #ccc_a1Spring Boot Actuator 2.0 & Micrometer #jjug_ccc #ccc_a1
Spring Boot Actuator 2.0 & Micrometer #jjug_ccc #ccc_a1
 
Spring Boot Actuator 2.0 & Micrometer
Spring Boot Actuator 2.0 & MicrometerSpring Boot Actuator 2.0 & Micrometer
Spring Boot Actuator 2.0 & Micrometer
 
Open Service Broker APIとKubernetes Service Catalog #k8sjp
Open Service Broker APIとKubernetes Service Catalog #k8sjpOpen Service Broker APIとKubernetes Service Catalog #k8sjp
Open Service Broker APIとKubernetes Service Catalog #k8sjp
 
Spring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsugSpring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsug
 
Introduction to Spring WebFlux #jsug #sf_a1
Introduction to Spring WebFlux #jsug #sf_a1Introduction to Spring WebFlux #jsug #sf_a1
Introduction to Spring WebFlux #jsug #sf_a1
 
BOSH / CF Deployment in modern ways #cf_tokyo
BOSH / CF Deployment in modern ways #cf_tokyoBOSH / CF Deployment in modern ways #cf_tokyo
BOSH / CF Deployment in modern ways #cf_tokyo
 
Why PCF is the best platform for Spring Boot
Why PCF is the best platform for Spring BootWhy PCF is the best platform for Spring Boot
Why PCF is the best platform for Spring Boot
 
Zipkin Components #zipkin_jp
Zipkin Components #zipkin_jpZipkin Components #zipkin_jp
Zipkin Components #zipkin_jp
 
実例で学ぶ、明日から使えるSpring Boot Tips #jsug
実例で学ぶ、明日から使えるSpring Boot Tips #jsug実例で学ぶ、明日から使えるSpring Boot Tips #jsug
実例で学ぶ、明日から使えるSpring Boot Tips #jsug
 
Spring ❤️ Kotlin #jjug
Spring ❤️ Kotlin #jjugSpring ❤️ Kotlin #jjug
Spring ❤️ Kotlin #jjug
 
Managing your Docker image continuously with Concourse CI
Managing your Docker image continuously with Concourse CIManaging your Docker image continuously with Concourse CI
Managing your Docker image continuously with Concourse CI
 
Short Lived Tasks in Cloud Foundry #cfdtokyo
Short Lived Tasks in Cloud Foundry #cfdtokyoShort Lived Tasks in Cloud Foundry #cfdtokyo
Short Lived Tasks in Cloud Foundry #cfdtokyo
 
Team Support in Concourse CI 2.0 #concourse_tokyo
Team Support in Concourse CI 2.0 #concourse_tokyoTeam Support in Concourse CI 2.0 #concourse_tokyo
Team Support in Concourse CI 2.0 #concourse_tokyo
 
Consumer Driven Contractsで REST API/マイクロサービスをテスト #m3tech
Consumer Driven Contractsで REST API/マイクロサービスをテスト #m3techConsumer Driven Contractsで REST API/マイクロサービスをテスト #m3tech
Consumer Driven Contractsで REST API/マイクロサービスをテスト #m3tech
 
Implement Service Broker with Spring Boot #cf_tokyo
Implement Service Broker with Spring Boot #cf_tokyoImplement Service Broker with Spring Boot #cf_tokyo
Implement Service Broker with Spring Boot #cf_tokyo
 
#jjug_ccc #ccc_gh5 What's new in Spring Framework 4.3 / Boot 1.4 + Pivotal's ...
#jjug_ccc #ccc_gh5 What's new in Spring Framework 4.3 / Boot 1.4 + Pivotal's ...#jjug_ccc #ccc_gh5 What's new in Spring Framework 4.3 / Boot 1.4 + Pivotal's ...
#jjug_ccc #ccc_gh5 What's new in Spring Framework 4.3 / Boot 1.4 + Pivotal's ...
 

Recently uploaded

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
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
 
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
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
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
 
"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
 
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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
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
 
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
 
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
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 

Recently uploaded (20)

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.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!
 
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
 
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
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
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
 
"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
 
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)
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
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
 
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
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
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
 

EVENT DRIVEN MICROSERVICES WITH SPRING CLOUD STREAM

  • 1. ‹#›© 2016 Pivotal Software, Inc. All rights reserved. ‹#›© 2016 Pivotal Software, Inc. All rights reserved. Event Driven Microservices with Spring Cloud Stream Toshiaki Maki (@making) 2016-12-03 JJUG CCC 2016 Fall #jjug_ccc #ccc_ab3 http://bit.ly/making_ccc_a3 (source code)
  • 2. © 2016 Pivotal Software, Inc. All rights reserved. Who am I ? • Toshiaki Maki (@making) http://blog.ik.am • Sr. Solutions Architect @Pivotal • Spring Framework enthusiast bit.ly/hajiboot2
  • 3. © 2016 Pivotal Software, Inc. All rights reserved. Contents •Spring Cloud Stream (25min) •Advanced Topic (20min) •Spring Cloud Data Flow (2min) •Deploy Stream Apps to Cloud Foundry (3min)
  • 4. © 2016 Pivotal Software, Inc. All rights reserved. Microservices Frontend Customer Service Email Service Point Service Post Service
  • 5. © 2016 Pivotal Software, Inc. All rights reserved. Microservices Frontend Customer Service Email Service Point Service Post Service HTTP / REST?
  • 6. © 2016 Pivotal Software, Inc. All rights reserved. Microservices Frontend Customer Service Email Service Point Service Post Service ABC Service XYZ Service
  • 7. © 2016 Pivotal Software, Inc. All rights reserved. Microservices Frontend Customer Service Email Service Point Service Post Service ABC Service XYZ Service
  • 8. © 2016 Pivotal Software, Inc. All rights reserved. Microservices Frontend Customer Service Email Service Point Service Post Service ABC Service XYZ Service
  • 9. © 2016 Pivotal Software, Inc. All rights reserved. Microservices Frontend Customer Service Email Service Point Service Post Service ABC Service XYZ Service😩
  • 10. © 2016 Pivotal Software, Inc. All rights reserved. Microservices Frontend Customer Service Email Service Point Service Post Service ABC Service XYZ Service😩 Orchestration Style
  • 11. © 2016 Pivotal Software, Inc. All rights reserved. Read Failure Frontend Customer Service Email Service HTTP GET
  • 12. © 2016 Pivotal Software, Inc. All rights reserved. Read Failure Frontend Customer Service Email Service 🔥 HTTP GET
  • 13. © 2016 Pivotal Software, Inc. All rights reserved. Read Failure Frontend Customer Service Email Service 🔥 HTTP GET Circuit Breaker
  • 14. © 2016 Pivotal Software, Inc. All rights reserved. Read Failure Frontend Customer Service Email Service 🔥 HTTP GET Circuit Breaker
  • 15. © 2016 Pivotal Software, Inc. All rights reserved. Write Failure Frontend Customer Service Email Service HTTP POST
  • 16. © 2016 Pivotal Software, Inc. All rights reserved. Write Failure 🔥 Frontend Customer Service Email Service HTTP POST
  • 17. © 2016 Pivotal Software, Inc. All rights reserved. Write Failure 🔥 Frontend Customer Service Email Service 😲 HTTP POST
  • 18. © 2016 Pivotal Software, Inc. All rights reserved. Event Driven MicroServices Frontend Customer Service Email Service Point Service Post Service
  • 19. © 2016 Pivotal Software, Inc. All rights reserved. Event Driven MicroServices Frontend Customer Service Email Service Point Service Post Service
  • 20. © 2016 Pivotal Software, Inc. All rights reserved. Event Driven MicroServices Frontend Customer Service Email Service Point Service Post Service Subscribe
  • 21. © 2016 Pivotal Software, Inc. All rights reserved. Event Driven MicroServices Frontend Customer Service Email Service Point Service Post Service Subscribe Publish
  • 22. © 2016 Pivotal Software, Inc. All rights reserved. Event Driven MicroServices Frontend Customer Service Email Service Point Service Post Service Subscribe ABC Service XYZ Service Publish
  • 23. © 2016 Pivotal Software, Inc. All rights reserved. Event Driven MicroServices Frontend Customer Service Email Service Point Service Post Service Subscribe ABC Service XYZ Service Publish
  • 24. © 2016 Pivotal Software, Inc. All rights reserved. Event Driven MicroServices Frontend Customer Service Email Service Point Service Post Service Subscribe ABC Service XYZ Service 🤓 Publish
  • 25. © 2016 Pivotal Software, Inc. All rights reserved. Choreography Style https://www.thoughtworks.com/insights/blog/scaling-microservices-event-stream
  • 26. ‹#›© 2016 Pivotal Software, Inc. All rights reserved. Spring Cloud Stream
  • 27. © 2016 Pivotal Software, Inc. All rights reserved. Spring Cloud Stream • Event-driven microservice framework • Built on battle-tested components (Spring Boot / Spring Integration) • Opinionated primitives for streaming applications • Persistent Pub/Sub • Consumer Groups • Partitioning Support • Pluggable messaging middleware bindings source | processor | sink
  • 28. © 2016 Pivotal Software, Inc. All rights reserved. Source | Sink Sink input Source output
  • 29. © 2016 Pivotal Software, Inc. All rights reserved. Source | Processor | Sink Source output Processor output input Sink input
  • 30. © 2016 Pivotal Software, Inc. All rights reserved. Spring Cloud Stream Applications Twitter Stream Cassandra java -jar twittersource.jar --server.port=8080 --consumerKey=XYZ --consumerSecret=ABC --spring.cloud.stream.bindings. output.destination=ingest Source Sink java -jar cassandrasink.jar --server.port=8081 --spring.cassandra.keyspace=tweet --spring.cloud.stream.bindings. input.destination=ingest
  • 31. © 2016 Pivotal Software, Inc. All rights reserved. Spring Cloud Stream Applications Twitter Stream Cassandra java -jar twittersource.jar --server.port=8080 --consumerKey=XYZ --consumerSecret=ABC --spring.cloud.stream.bindings. output.destination=ingest Source Sink java -jar cassandrasink.jar --server.port=8081 --spring.cassandra.keyspace=tweet --spring.cloud.stream.bindings. input.destination=ingest Twitter Stream Cassandraingest
  • 32. © 2016 Pivotal Software, Inc. All rights reserved. Message Binders • @EnableBinding • Binder Implementations • Production-Ready • Rabbit MQ • Apache Kafka • Experimental • JMS • Google PubSub
  • 33. © 2016 Pivotal Software, Inc. All rights reserved. Programming Model (Sink) @SpringBootApplication
 @EnableBinding(Sink.class)
 public class DemoSinkApp { @StreamListener(Sink.INPUT)
 void receive(Message<String> message) {
 System.out.println("Received " + message.getPayload());
 }
 public static void main(String[] args) {
 SpringApplication.run(DemoSinkApp.class, args);
 }
 }
  • 34. © 2016 Pivotal Software, Inc. All rights reserved. Programming Model (Sink) @SpringBootApplication
 @EnableBinding(Sink.class)
 public class DemoSinkApp { @StreamListener(Sink.INPUT)
 void receive(Message<String> message) {
 System.out.println("Received " + message.getPayload());
 }
 public static void main(String[] args) {
 SpringApplication.run(DemoSinkApp.class, args);
 }
 } public interface Sink { String INPUT = "input"; @Input(Sink.INPUT) SubscribableChannel input();
 }
  • 35. © 2016 Pivotal Software, Inc. All rights reserved. Sink Properties (Sink) spring.cloud.stream.bindings.input.destination=demo-strm demo- strm input
  • 36. © 2016 Pivotal Software, Inc. All rights reserved. Programming Model (Source) @SpringBootApplication @RestController @EnableBinding(Source.class)
 public class DemoSourceApp {
 @Autowired @Output(Source.OUTPUT) MessageChannel output; @GetMapping void send(@RequestParam String text) {
 output.send(MessageBuilder.withPayload(text).build());
 }
 public static void main(String[] args) {
 SpringApplication.run(DemoSourceApp.class, args);
 }
 }
  • 37. © 2016 Pivotal Software, Inc. All rights reserved. Programming Model (Source) @SpringBootApplication @RestController @EnableBinding(Source.class)
 public class DemoSourceApp {
 @Autowired @Output(Source.OUTPUT) MessageChannel output; @GetMapping void send(@RequestParam String text) {
 output.send(MessageBuilder.withPayload(text).build());
 }
 public static void main(String[] args) {
 SpringApplication.run(DemoSourceApp.class, args);
 }
 } public interface Source { String OUTPUT = "output"; @Output(Source.OUTPUT) MessageChannel output();
 }
  • 38. © 2016 Pivotal Software, Inc. All rights reserved. Programming Model (Source) @SpringBootApplication @RestController @EnableBinding(Source.class)
 public class DemoSourceApp {
 @Autowired Source source; @GetMapping void send(@RequestParam String text) {
 source.output() .send(MessageBuilder.withPayload(text).build());
 }
 public static void main(String[] args) {
 SpringApplication.run(DemoSourceApp.class, args);
 }
 }
  • 39. © 2016 Pivotal Software, Inc. All rights reserved. Properties (Source) spring.cloud.stream.bindings.output.destination=demo-strm demo- strm Source output
  • 40. © 2016 Pivotal Software, Inc. All rights reserved. Properties (Source) spring.cloud.stream.bindings.output.destination=demo-strm spring.cloud.stream.bindings.output.contentType=applicati on/json demo- strm Source output
  • 41. © 2016 Pivotal Software, Inc. All rights reserved. Binder (RabbitMQ) <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-stream-rabbit</artifactId> </dependency> demo- strm
  • 42. © 2016 Pivotal Software, Inc. All rights reserved. Binder (Apache Kafka) <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-stream-kafka</artifactId> </dependency> demo- strm
  • 43. © 2016 Pivotal Software, Inc. All rights reserved. Sink Pipeline demo- strm input Source output source | sink
  • 44. © 2016 Pivotal Software, Inc. All rights reserved. RabbitMQ demo-strm
  • 45. © 2016 Pivotal Software, Inc. All rights reserved. RabbitMQ demo-strm Source
  • 46. © 2016 Pivotal Software, Inc. All rights reserved. RabbitMQ demo-strm Topic Exchange demo-strm Source
  • 47. © 2016 Pivotal Software, Inc. All rights reserved. RabbitMQ demo-strm Topic Exchange demo-strm Source
  • 48. © 2016 Pivotal Software, Inc. All rights reserved. RabbitMQ demo-strm Topic Exchange demo-strm Source Sink
  • 49. © 2016 Pivotal Software, Inc. All rights reserved. RabbitMQ demo-strm Topic Exchange demo-strm .anonymous.x Queue demo-strm Source Sink
  • 50. © 2016 Pivotal Software, Inc. All rights reserved. RabbitMQ demo-strm Topic Exchange demo-strm .anonymous.x Queue demo-strm Source Sink
  • 51. © 2016 Pivotal Software, Inc. All rights reserved. Programming Model (Processor) @SpringBootApplication
 @EnableBinding(Processor.class)
 public class DemoProcessorApp { @StreamListener(Processor.INPUT) @SendTo(Processor.OUTPUT)
 void receive(String text) {
 return "[[" + text + "]]";
 }
 public static void main(String[] args) {
 SpringApplication.run(DemoProcessorApp.class, args);
 }
 }
  • 52. © 2016 Pivotal Software, Inc. All rights reserved. Properties (Processor) spring.cloud.stream.bindings.output.destination=my-source spring.cloud.stream.bindings.input.destination=my-source spring.cloud.stream.bindings.output.destination=my-proc spring.cloud.stream.bindings.input.destination=my-proc Source Processor Sink
  • 53. © 2016 Pivotal Software, Inc. All rights reserved. Pipeline my- source Source output source | processor | sink Processor output input my-proc Sink input
  • 54. © 2016 Pivotal Software, Inc. All rights reserved. Reactive API Support by Reactor @SpringBootApplication
 @EnableBinding(Processor.class)
 public class DemoProcessorRxApp { @StreamListener @Output(Processor.OUTPUT)
 public Flux<String> receive(@Input(Processor.INPUT) Flux<String> stream) {
 return stream.map(text -> "[[" + text + "]]");
 }
 public static void main(String[] args) {
 SpringApplication.run(DemoProcessorRxApp.class, args);
 }
 }
  • 55. © 2016 Pivotal Software, Inc. All rights reserved. Reactive API Support by Reactor @StreamListener @Output(Processor.OUTPUT)
 public Flux<AverageData> receive(@Input(Processor.INPUT) Flux<SensorData> stream) {
 return stream.window(Duration.ofSecond(20), Duration.ofSecond(10)) .flatMap(win -> win.groupBy(sensor -> sensor.id)) .flatMap(group -> calcAverage(group));
 }
  • 56. © 2016 Pivotal Software, Inc. All rights reserved. Stream Core Features •Persistent Pub-Sub •Consumer Group •Partitioning Support
  • 57. © 2016 Pivotal Software, Inc. All rights reserved. Persistent Pub-Sub HTTP Average Top Ns1.http s1.ave Message Broker
  • 58. © 2016 Pivotal Software, Inc. All rights reserved. Persistent Pub-Sub HTTP Average HDFS Top Ns1.http s1.ave Message Broker
  • 59. © 2016 Pivotal Software, Inc. All rights reserved. Persistent Pub-Sub HTTP Average HDFS Top N Fault Detection s1.http s1.ave Message Broker
  • 60. © 2016 Pivotal Software, Inc. All rights reserved. Persistent Pub-Sub HTTP Average HDFS Top N Fault Detection s1.http s1.ave Message Broker {"id":1, "temperature":38}
  • 61. © 2016 Pivotal Software, Inc. All rights reserved. Persistent Pub-Sub HTTP Average HDFS Top N Fault Detection s1.http s1.ave Message Broker {"id":1, "temperature":38}{"id":1, "temperature":38}
  • 62. © 2016 Pivotal Software, Inc. All rights reserved. Persistent Pub-Sub HTTP Average HDFS Top N Fault Detection s1.http s1.ave Message Broker {"id":1, "temperature":38} {"id":1, "temperature":38} {"id":1, "temperature":38}
  • 63. © 2016 Pivotal Software, Inc. All rights reserved. Persistent Pub-Sub HTTP Average HDFS Top N Fault Detection s1.http s1.ave Message Broker {"id":1, "temperature": {"id":1, "temperature":38} {"id":1, "temperature":38}
  • 64. © 2016 Pivotal Software, Inc. All rights reserved. HTTP Average HDFS Top N Fault Detection s1.http s1.ave Message Broker Average Average HDFS HDFS
  • 65. © 2016 Pivotal Software, Inc. All rights reserved. HTTP Average HDFS Top N Fault Detection s1.http s1.ave Message Broker {"id":1, "temperature":38} Average Average HDFS HDFS
  • 66. © 2016 Pivotal Software, Inc. All rights reserved. HTTP Average HDFS Top N Fault Detection s1.http s1.ave Message Broker {"id":1, "temperature":38}{"id":1, "temperature":38} Average Average HDFS HDFS
  • 67. © 2016 Pivotal Software, Inc. All rights reserved. HTTP Average HDFS Top N Fault Detection s1.http s1.ave Message Broker {"id":1, "temperature":38} {"id":1, "temperature":38} Average Average HDFS HDFS {"id":1, "temperature":38} {"id":1, "temperature":38} {"id":1, "temperature":38} {"id":1, "temperature":38}
  • 68. © 2016 Pivotal Software, Inc. All rights reserved. HTTP Average HDFS Top N Fault Detection s1.http s1.ave Message Broker {"id":1, "temperature":38} {"id":1, "temperature":38} Average Average HDFS HDFS {"id":1, "temperature":38} {"id":1, "temperature":38} {"id":1, "temperature":38} {"id":1, "temperature":38} 😩
  • 69. © 2016 Pivotal Software, Inc. All rights reserved. Topic Exchange demo-strm demo-strm .anonymous.1 Queue
  • 70. © 2016 Pivotal Software, Inc. All rights reserved. Topic Exchange demo-strm demo-strm .anonymous.1 Queue
  • 71. © 2016 Pivotal Software, Inc. All rights reserved. Topic Exchange demo-strm demo-strm .anonymous.1 Queue demo-strm .anonymous.2
  • 72. © 2016 Pivotal Software, Inc. All rights reserved. Topic Exchange demo-strm demo-strm .anonymous.1 Queue demo-strm .anonymous.2 Consumer Group
  • 73. © 2016 Pivotal Software, Inc. All rights reserved. Topic Exchange demo-strm demo-strm .anonymous.1 Queue demo-strm .anonymous.2 spring.cloud.stream.bindings.<channelName>.group=ave Consumer Group
  • 74. © 2016 Pivotal Software, Inc. All rights reserved. Consumer Group demo-strm demo-strm .ave QueueTopic Exchange
  • 75. © 2016 Pivotal Software, Inc. All rights reserved. Consumer Group HTTP Average HDFS Top N Fault Detection s1.http s1.ave Message Broker Average Average HDFS HDFS group=ave group=hdfs
  • 76. © 2016 Pivotal Software, Inc. All rights reserved. Consumer Group HTTP Average HDFS Top N Fault Detection s1.http s1.ave Message Broker Average Average HDFS HDFS group=ave group=hdfs {"id":1, "temperature":38}
  • 77. © 2016 Pivotal Software, Inc. All rights reserved. Consumer Group HTTP Average HDFS Top N Fault Detection s1.http s1.ave Message Broker Average Average HDFS HDFS group=ave group=hdfs {"id":1, "temperature":38}{"id":1, "temperature":38}
  • 78. © 2016 Pivotal Software, Inc. All rights reserved. Consumer Group HTTP Average HDFS Top N Fault Detection s1.http s1.ave Message Broker Average Average HDFS HDFS group=ave group=hdfs {"id":1, "temperature":38} {"id":1, "temperature":38}
  • 79. © 2016 Pivotal Software, Inc. All rights reserved. Consumer Group HTTP Average HDFS Top N Fault Detection s1.http s1.ave Message Broker Average Average HDFS HDFS group=ave group=hdfs {"id":1, "temperature":38} {"id":1, "temperature":38} 🤓
  • 80. © 2016 Pivotal Software, Inc. All rights reserved. Consumer Group HTTP Average HDFS Top N Fault Detection s1.http s1.ave Message Broker Average Average HDFS HDFS group=ave group=hdfs {"id":1, "temperature":38} {"id":1, "temperature":38} 🤓 consumer group subscriptions are durable 😁
  • 81. © 2016 Pivotal Software, Inc. All rights reserved. Durability demo-strm demo-strm .ave QueueTopic Exchange
  • 82. © 2016 Pivotal Software, Inc. All rights reserved. Durability demo-strm demo-strm .ave QueueTopic Exchange
  • 83. © 2016 Pivotal Software, Inc. All rights reserved. Durability demo-strm demo-strm .ave Queue 🏀 Topic Exchange
  • 84. © 2016 Pivotal Software, Inc. All rights reserved. Durability demo-strm demo-strm .ave Queue 🏀 Topic Exchange
  • 85. © 2016 Pivotal Software, Inc. All rights reserved. Durability demo-strm demo-strm .ave Queue 🚑 🏀 Topic Exchange
  • 86. © 2016 Pivotal Software, Inc. All rights reserved. Durability demo-strm demo-strm .ave Queue 🚑 🏀 Topic Exchange
  • 87. © 2016 Pivotal Software, Inc. All rights reserved. Durability demo-strm demo-strm .ave Queue 🏀 Topic Exchange
  • 88. © 2016 Pivotal Software, Inc. All rights reserved. Customer Service Email Service Point Service Post Service Source Sink
  • 89. © 2016 Pivotal Software, Inc. All rights reserved. Customer Service Email Service Point Service Post Service Source Sink spring.cloud.stream.bindings.output.destination=customer spring.cloud.stream.bindings.output.contentType=applicatio n/json
  • 90. © 2016 Pivotal Software, Inc. All rights reserved. Customer Service Email Service Point Service Post Service Subscribe Source Sink
  • 91. © 2016 Pivotal Software, Inc. All rights reserved. Customer Service Email Service Point Service Post Service Subscribe Source Sink group=point-service group=email-service group=post-service
  • 92. © 2016 Pivotal Software, Inc. All rights reserved. Customer Service Email Service Point Service Post Service Subscribe Source Sink group=point-service group=email-service group=post-service spring.cloud.stream.bindings.input.destination=customer spring.cloud.stream.bindings.input.group=point-service
  • 93. © 2016 Pivotal Software, Inc. All rights reserved. Customer Service Email Service Point Service Post Service Subscribe Source Sink group=point-service group=email-service group=post-service spring.cloud.stream.bindings.input.destination=customer spring.cloud.stream.bindings.input.group=point-service spring.cloud.stream.bindings.input.destination=customer spring.cloud.stream.bindings.input.group=email-service
  • 94. © 2016 Pivotal Software, Inc. All rights reserved. Customer Service Email Service Point Service Post Service Subscribe Source Sink group=point-service group=email-service group=post-service spring.cloud.stream.bindings.input.destination=customer spring.cloud.stream.bindings.input.group=point-service spring.cloud.stream.bindings.input.destination=customer spring.cloud.stream.bindings.input.group=email-service spring.cloud.stream.bindings.input.destination=customer spring.cloud.stream.bindings.input.group=post-service
  • 95. © 2016 Pivotal Software, Inc. All rights reserved. customer Customer Service output Point Service input Email Service input Post Service input
  • 96. © 2016 Pivotal Software, Inc. All rights reserved. customer customer .point- service Queue Consumer Group customer .email- service customer .post- service Topic Exchange
  • 97. © 2016 Pivotal Software, Inc. All rights reserved. HTTP Average s1.http Average
  • 98. © 2016 Pivotal Software, Inc. All rights reserved. HTTP Average s1.http Average {"id":1, "temperature":38} {"id":2, "temperature":41} {"id":2, "temperature":42} {"id":1, "temperature":37}
  • 99. © 2016 Pivotal Software, Inc. All rights reserved. HTTP Average s1.http Average {"id":1, "temperature":38} {"id":2, "temperature":41} {"id":2, "temperature":42} {"id":1, "temperature":37}
  • 100. © 2016 Pivotal Software, Inc. All rights reserved. HTTP Average s1.http Average {"id":1, "temperature":38} {"id":2, "temperature":41} {"id":2, "temperature":42} {"id":1, "temperature":37}
  • 101. © 2016 Pivotal Software, Inc. All rights reserved. HTTP Average s1.http Average {"id":1, "temperature":38} {"id":2, "temperature":41} {"id":2, "temperature":42} {"id":1, "temperature":37}
  • 102. © 2016 Pivotal Software, Inc. All rights reserved. HTTP Average s1.http Average {"id":1, "temperature":38} {"id":2, "temperature":41} {"id":2, "temperature":42} {"id":1, "temperature":37}
  • 103. © 2016 Pivotal Software, Inc. All rights reserved. HTTP Average s1.http Average {"id":1, "temperature":38} {"id":2, "temperature":41} {"id":2, "temperature":42} {"id":1, "temperature":37} 😩
  • 104. © 2016 Pivotal Software, Inc. All rights reserved. HTTP Average s1.http Average {"id":1, "temperature":38} {"id":2, "temperature":41} {"id":2, "temperature":42} {"id":1, "temperature":37} 😩 Partitioning Support(Stateful Stream)
  • 105. © 2016 Pivotal Software, Inc. All rights reserved. HTTP Average s1.http Average {"id":1, "temperature":38} {"id":2, "temperature":41} {"id":2, "temperature":42} {"id":1, "temperature":37} 😩 spring.cloud.stream.bindings.<channelName>.producer.par titionKeyExpression=payload.id Partitioning Support(Stateful Stream)
  • 106. © 2016 Pivotal Software, Inc. All rights reserved. Partitioning Support(Stateful Stream) HTTP Average s1.http Average
  • 107. © 2016 Pivotal Software, Inc. All rights reserved. Partitioning Support(Stateful Stream) HTTP Average s1.http Average {"id":1, "temperature":38} {"id":2, "temperature":41} {"id":2, "temperature":42} {"id":1, "temperature":37}
  • 108. © 2016 Pivotal Software, Inc. All rights reserved. Partitioning Support(Stateful Stream) HTTP Average s1.http Average {"id":1, "temperature":38} {"id":2, "temperature":41} {"id":2, "temperature":42} {"id":1, "temperature":37}
  • 109. © 2016 Pivotal Software, Inc. All rights reserved. Partitioning Support(Stateful Stream) HTTP Average s1.http Average {"id":1, "temperature":38} {"id":2, "temperature":41} {"id":2, "temperature":42} {"id":1, "temperature":37}
  • 110. © 2016 Pivotal Software, Inc. All rights reserved. Partitioning Support(Stateful Stream) HTTP Average s1.http Average {"id":1, "temperature":38} {"id":2, "temperature":41} {"id":2, "temperature":42} {"id":1, "temperature":37}
  • 111. © 2016 Pivotal Software, Inc. All rights reserved. Partitioning Support(Stateful Stream) HTTP Average s1.http Average {"id":1, "temperature":38} {"id":2, "temperature":41} {"id":2, "temperature":42} {"id":1, "temperature":37}
  • 112. © 2016 Pivotal Software, Inc. All rights reserved. Partitioning Support(Stateful Stream) HTTP Average s1.http Average {"id":1, "temperature":38} {"id":2, "temperature":41} {"id":2, "temperature":42} {"id":1, "temperature":37} 🤓
  • 113. © 2016 Pivotal Software, Inc. All rights reserved. Test Support Source output Sink input
  • 114. © 2016 Pivotal Software, Inc. All rights reserved. Test Support Source output Sink input TestSupportBinder
  • 115. © 2016 Pivotal Software, Inc. All rights reserved. Test Support <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-stream-test-support</artifactId> <scope>test</scope> </dependency>
  • 116. © 2016 Pivotal Software, Inc. All rights reserved. Unit Test (Sink) @RunWith(SpringRunner.class)
 @SpringBootTest(webEnvironment = WebEnvironment.NONE)
 public class DemoSinkAppTest { @Autowired Sink sink; @Rule public OutputCapture capture = new OutputCapture(); @Test public void testReceive() { sink.input() .send(MessageBuilder.withPayload("foo").build()); assertThat(capture.toString()) .isEqualsTo("Received foo");
 } }
  • 117. © 2016 Pivotal Software, Inc. All rights reserved. Unit Test (Source) @RunWith(SpringRunner.class)
 @SpringBootTest(webEnvironment = WebEnvironment.NONE)
 public class DemoSourceAppTest { @Autowired DemoSourceApp app; @Autowired MessageCollector collector; @Autowired Source source; @Test public void testSend() { app.send("foo"); Message<String> message = collector .forChannel(source.output()).poll(); assertThat(message.getPayload()).isEqualsTo("foo"); 
 }}
  • 118. ‹#›© 2016 Pivotal Software, Inc. All rights reserved. Advanced Topics
  • 119. © 2016 Pivotal Software, Inc. All rights reserved. Advanced Topics •Multi Binding •Distributed Tracing •Error Handling •Consumer Driven Contract
  • 120. © 2016 Pivotal Software, Inc. All rights reserved. Multi Bindings
  • 121. © 2016 Pivotal Software, Inc. All rights reserved. customer Customer Service output Email Service input
  • 122. © 2016 Pivotal Software, Inc. All rights reserved. customer Customer Service output Email Service input CustomerCreateEvent
  • 123. © 2016 Pivotal Software, Inc. All rights reserved. customer Customer Service output Email Service input
  • 124. © 2016 Pivotal Software, Inc. All rights reserved. customer Customer Service output Email Service input CustomerDeleteEvent
  • 125. © 2016 Pivotal Software, Inc. All rights reserved. customer Customer Service output Email Service input CustomerDeleteEvent ClassCastException!!
  • 126. © 2016 Pivotal Software, Inc. All rights reserved. create Email Service create- input delete- input Customer Service create- output delete- output delete CustomerCreateEvent CustomerDeleteEvent
  • 127. © 2016 Pivotal Software, Inc. All rights reserved. public interface CustomerEventSource { String CREATE_OUTPUT = "create-output"; String DELETE_OUTPUT = "delete-output"; @Output(CustomerEventSource.CREATE_OUTPUT) MessageChannel createOutput(); @Output(CustomerEventSource.DELETE_OUTPUT) MessageChannel deleteOutput();
 } Multi Bindings
  • 128. © 2016 Pivotal Software, Inc. All rights reserved. @Component
 public class CustomerService {
 @Autowired CustomerEventSource source; public void create(...) { source.createOutput().send(...); } public void delete() { source.deleteOutput().send(...); }
 } @SpringBootApplication @EnableBinding(CustomerEventSource.class)
 public class CustomerServiceApplication { /* ... */ }
  • 129. © 2016 Pivotal Software, Inc. All rights reserved. @Component
 public class CustomerService {
 @Autowired CustomerEventSource source; public void create(...) { source.createOutput().send(...); } public void delete() { source.deleteOutput().send(...); }
 } @SpringBootApplication @EnableBinding(CustomerEventSource.class)
 public class CustomerServiceApplication { /* ... */ } spring.cloud.stream.bindings.create-output.destination =create spring.cloud.stream.bindings.delete-output.destination =delete
  • 130. © 2016 Pivotal Software, Inc. All rights reserved. public interface CustomerEventSink { String CREATE_INPUT = "create-input"; String DELETE_INPUT = "delete-input"; @Input(CustomerEventSink.CREATE_INPUT) SubscribableChannel createInput(); @Input(CustomerEventSink.DELETE_INPUT) SubscribableChannel deleteInput();
 } Multi Bindings
  • 131. © 2016 Pivotal Software, Inc. All rights reserved. @Component
 public class PointService { @StreamListener(CustomerEventSink.CREATE_INPUT) public void handleCreate(CustomerCreateEvent event) { } @StreamListener(CustomerEventSink.DELETE_INPUT) public void handleDelete(CustomerDeleteEvent event) { }
 } @SpringBootApplication @EnableBinding(CustomerEventSink.class)
 public class PointServiceApplication { /* ... */ }
  • 132. © 2016 Pivotal Software, Inc. All rights reserved. @Component
 public class PointService { @StreamListener(CustomerEventSink.CREATE_INPUT) public void handleCreate(CustomerCreateEvent event) { } @StreamListener(CustomerEventSink.DELETE_INPUT) public void handleDelete(CustomerDeleteEvent event) { }
 } @SpringBootApplication @EnableBinding(CustomerEventSink.class)
 public class PointServiceApplication { /* ... */ } spring.cloud.stream.bindings.create-input.destination =create spring.cloud.stream.bindings.create-input.group =point-service spring.cloud.stream.bindings.delete-intput.destination =delete spring.cloud.stream.bindings.delete-input.group =point-service
  • 133. © 2016 Pivotal Software, Inc. All rights reserved. create create .point- service Queue delete delete .point- service Topic Exchange
  • 134. © 2016 Pivotal Software, Inc. All rights reserved. Frontend Customer Service Email Service Point Service Post Service Subscribe ABC Service XYZ Service
  • 135. © 2016 Pivotal Software, Inc. All rights reserved. Frontend Customer Service Email Service Point Service Post Service Subscribe ABC Service XYZ Service 🕝
  • 136. © 2016 Pivotal Software, Inc. All rights reserved. Frontend Customer Service Email Service Point Service Post Service Subscribe ABC Service XYZ Service🤔 🕝
  • 137. © 2016 Pivotal Software, Inc. All rights reserved. Frontend Customer Service Email Service Point Service Post Service Subscribe ABC Service XYZ Service🤔 🕝 🕵 🕵 🕵 🕵 🕵 🕵🕵
  • 138. © 2016 Pivotal Software, Inc. All rights reserved. Frontend Customer Service Email Service Point Service Post Service Subscribe ABC Service XYZ Service🤔 🕝 🕵 🕵 🕵 🕵 🕵 🕵🕵
  • 139. © 2016 Pivotal Software, Inc. All rights reserved. Frontend Customer Service Email Service Point Service Post Service Subscribe ABC Service XYZ Service🤔 🕝 🕵 🕵 🕵 🕵 🕵 🕵🕵 TraceID, SpanID
  • 140. © 2016 Pivotal Software, Inc. All rights reserved. Spring Cloud Sleuth • Distributed tracing solution for Spring Cloud • Interactions with external systems should be instrumented automatically • Capture data simply in logs, or by sending it to Zipkin via RestTemplate / Spring Cloud Stream / ...
  • 141. © 2016 Pivotal Software, Inc. All rights reserved. Spring Cloud Sleuth Stream <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-stream-slueth</artifactId> </dependency>
  • 142. © 2016 Pivotal Software, Inc. All rights reserved. Spring Cloud Sleuth Stream customer Customer Service output Email Service input
  • 143. © 2016 Pivotal Software, Inc. All rights reserved. Spring Cloud Sleuth Stream customer Customer Service output Email Service input sleuth sleuth
  • 144. © 2016 Pivotal Software, Inc. All rights reserved. Zipkin Stream Server <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-sleuth-zipkin-stream</artifactId> </dependency>
  • 145. © 2016 Pivotal Software, Inc. All rights reserved. Zipkin Stream Server <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-sleuth-zipkin-stream</artifactId> </dependency> @SpringBootApplication
 @EnableZipkinStreamServer
 public class ZipkinStreamServer {
 public static void main(String[] args) {
 SpringApplication.run(DemoSinkApp.class, args);
 }
 }
  • 146. © 2016 Pivotal Software, Inc. All rights reserved. Zipkin Stream Server customer Customer Service output Email Service input sleuth sleuth
  • 147. © 2016 Pivotal Software, Inc. All rights reserved. Zipkin Stream Server customer Customer Service output Email Service input sleuth sleuth sleuth sleuth
  • 148. © 2016 Pivotal Software, Inc. All rights reserved. Zipkin Stream Server customer Customer Service output Email Service input sleuth sleuth sleuth sleuth
  • 149. © 2016 Pivotal Software, Inc. All rights reserved. Zipkin Stream Server customer Customer Service output Email Service input sleuth sleuth sleuth sleuth
  • 150. © 2016 Pivotal Software, Inc. All rights reserved. Zipkin Stream Server customer Customer Service output Email Service input sleuth sleuth sleuth sleuth TraceID,SpanID TraceID,SpanID
  • 151. © 2016 Pivotal Software, Inc. All rights reserved. Zipkin Stream Server customer Customer Service output Email Service input sleuth sleuth sleuth sleuth
  • 152. © 2016 Pivotal Software, Inc. All rights reserved. Zipkin UI
  • 153. © 2016 Pivotal Software, Inc. All rights reserved. Zipkin UI Trace
  • 154. © 2016 Pivotal Software, Inc. All rights reserved. Zipkin UI Trace Span
  • 155. © 2016 Pivotal Software, Inc. All rights reserved.
  • 156. © 2016 Pivotal Software, Inc. All rights reserved. Error Handling •Depends on the message binder implementation •(Ex.) RabbitMQ binder routes the failed message to the Dead-Letter Queue(DLQ). No mechanism to handle DLQs.
  • 157. © 2016 Pivotal Software, Inc. All rights reserved. Dead-Letter Queue Processing demo-strm Topic Exchange demo-strm .ave Source Sink RabbitMQBinder
  • 158. © 2016 Pivotal Software, Inc. All rights reserved. Dead-Letter Queue Processing demo-strm Topic Exchange demo-strm .ave Source Sink DLX RabbitMQBinder
  • 159. © 2016 Pivotal Software, Inc. All rights reserved. Dead-Letter Queue Processing demo-strm Topic Exchange demo-strm .ave Source Sink DLX RabbitMQBinder spring.cloud.stream.bindings.input.destination=demo-strm spring.cloud.stream.bindings.input.group=ave spring.cloud.stream.rabbit.bindings.input.consumer.autoBi ndDlq=true
  • 160. © 2016 Pivotal Software, Inc. All rights reserved. Dead-Letter Queue Processing demo-strm Topic Exchange demo-strm .ave Source Sink DLX demo-strm .ave.dlq RabbitMQBinder spring.cloud.stream.bindings.input.destination=demo-strm spring.cloud.stream.bindings.input.group=ave spring.cloud.stream.rabbit.bindings.input.consumer.autoBi ndDlq=true
  • 161. © 2016 Pivotal Software, Inc. All rights reserved. Dead-Letter Queue Processing demo-strm Topic Exchange demo-strm .ave Source Sink DLX demo-strm .ave.dlq RabbitMQBinder
  • 162. © 2016 Pivotal Software, Inc. All rights reserved. Dead-Letter Queue Processing demo-strm Topic Exchange demo-strm .ave Source Sink DLX demo-strm .ave.dlq RabbitMQBinder
  • 163. © 2016 Pivotal Software, Inc. All rights reserved. Dead-Letter Queue Processing demo-strm Topic Exchange demo-strm .ave Source Sink DLX demo-strm .ave.dlq RabbitMQBinder
  • 164. © 2016 Pivotal Software, Inc. All rights reserved. Dead-Letter Queue Processing demo-strm Topic Exchange demo-strm .ave Source Sink DLX demo-strm .ave.dlq RabbitMQBinder 🔥
  • 165. © 2016 Pivotal Software, Inc. All rights reserved. Dead-Letter Queue Processing demo-strm Topic Exchange demo-strm .ave Source Sink DLX demo-strm .ave.dlq RabbitMQBinder 🔥 Retry 3 times by default
  • 166. © 2016 Pivotal Software, Inc. All rights reserved. Dead-Letter Queue Processing demo-strm Topic Exchange demo-strm .ave Source Sink DLX demo-strm .ave.dlq RabbitMQBinder 🔥 Retry 3 times by default
  • 167. © 2016 Pivotal Software, Inc. All rights reserved.
  • 168. © 2016 Pivotal Software, Inc. All rights reserved.
  • 169. © 2016 Pivotal Software, Inc. All rights reserved.
  • 170. © 2016 Pivotal Software, Inc. All rights reserved.
  • 171. © 2016 Pivotal Software, Inc. All rights reserved.
  • 172. © 2016 Pivotal Software, Inc. All rights reserved. Handling DLQ @Component
 public class DlqHander { @RabbitListener(queues = "customer.email-service.dlq") public void handle(Message event) { // Re-deliver if you want }
 }
  • 173. © 2016 Pivotal Software, Inc. All rights reserved. DLQ Recovery Center 😛 https://github.com/making-demo-scst/dlq-recover-service
  • 174. © 2016 Pivotal Software, Inc. All rights reserved. Trace everything
  • 175. © 2016 Pivotal Software, Inc. All rights reserved. customer Customer Service output Point Service input Email Service input Post Service input
  • 176. © 2016 Pivotal Software, Inc. All rights reserved. customer Customer Service output Point Service input Email Service input Post Service input
  • 177. © 2016 Pivotal Software, Inc. All rights reserved. customer Customer Service output Point Service input Email Service input Post Service input
  • 178. © 2016 Pivotal Software, Inc. All rights reserved. customer Customer Service output Point Service input Email Service input Post Service input
  • 179. © 2016 Pivotal Software, Inc. All rights reserved. customer Customer Service output Point Service input Email Service input Post Service input
  • 180. © 2016 Pivotal Software, Inc. All rights reserved. customer Customer Service output Point Service input Email Service input Post Service input 😗Breaking Change
  • 181. © 2016 Pivotal Software, Inc. All rights reserved. customer Customer Service output Point Service input Email Service input Post Service input 😗Breaking Change
  • 182. © 2016 Pivotal Software, Inc. All rights reserved. customer Customer Service output Point Service input Email Service input Post Service input 😗Breaking Change
  • 183. © 2016 Pivotal Software, Inc. All rights reserved. customer Customer Service output Point Service input Email Service input Post Service input 😗Breaking Change
  • 184. © 2016 Pivotal Software, Inc. All rights reserved. customer Customer Service output 😗Breaking Change 😡 😡 😡 😨
  • 185. © 2016 Pivotal Software, Inc. All rights reserved. Consumer Driven Contracts •Consumer shares "expectation" with Producer via "Contract" (≈ DSL) •The contract violation should be detected by generated tests on the producer side.
  • 186. © 2016 Pivotal Software, Inc. All rights reserved. Consumer Driven Contracts •Consumer shares "expectation" with Producer via "Contract" (≈ DSL) •The contract violation should be detected by generated tests on the producer side. ContractConsumer Producer
  • 187. © 2016 Pivotal Software, Inc. All rights reserved. Flow of Consumer Driven Contracts Consumer Producer
  • 188. © 2016 Pivotal Software, Inc. All rights reserved. Flow of Consumer Driven Contracts Consumer Producer Contract
  • 189. © 2016 Pivotal Software, Inc. All rights reserved. Flow of Consumer Driven Contracts Consumer Producer Contract
  • 190. © 2016 Pivotal Software, Inc. All rights reserved. Flow of Consumer Driven Contracts Consumer Producer Contract Acceptance Test
  • 191. © 2016 Pivotal Software, Inc. All rights reserved. Flow of Consumer Driven Contracts Consumer Producer Contract Acceptance Test
  • 192. © 2016 Pivotal Software, Inc. All rights reserved. Flow of Consumer Driven Contracts Consumer Producer Contract Acceptance Test ✅
  • 193. © 2016 Pivotal Software, Inc. All rights reserved. Flow of Consumer Driven Contracts Consumer Producer Contract Acceptance Test Stub ✅
  • 194. © 2016 Pivotal Software, Inc. All rights reserved. Flow of Consumer Driven Contracts Consumer Producer Contract Acceptance Test Stub ✅
  • 195. © 2016 Pivotal Software, Inc. All rights reserved. Flow of Consumer Driven Contracts Consumer Producer Contract Acceptance Test Stub Unit Test ✅
  • 196. © 2016 Pivotal Software, Inc. All rights reserved. Flow of Consumer Driven Contracts Consumer Producer Contract Acceptance Test Stub Unit Test ✅✅
  • 197. © 2016 Pivotal Software, Inc. All rights reserved. Spring Cloud Contract •A CDC Solution for JVM apps (especially Spring) •Contract DSL using Groovy •Generates Acceptance test (JUnit or Spock) for producer •Generates Stub for consumer •WireMock Support for REST Test •Messaging Support (Spring Integration, Spring Cloud Stream and Apache Camel)
  • 198. © 2016 Pivotal Software, Inc. All rights reserved. Contract DSL Contract.make { label 'create-customer' input { } outputMessage { sentTo('demo-strm') headers({header('Content-Type':'...')})
 body('''{"name":"@making"}''') }} shouldCreateCustomer.groovy
  • 199. © 2016 Pivotal Software, Inc. All rights reserved. Contract DSL Contract.make { label 'create-customer' input { } outputMessage { sentTo('demo-strm') headers({header('Content-Type':'...')})
 body('''{"name":"@making"}''') }} shouldCreateCustomer.groovy Created by Consumer
  • 200. © 2016 Pivotal Software, Inc. All rights reserved. Prepare Parent Test Class @RunWith(SpringRunner.class)
 @SpringBootTest(webEnvironment = WebEnvironment.NONE) @AutoConfigureMessageVerifier
 public abstract class MsgTestBase { @Autowired CustomerService service; protected void create() { service.create("@making"); 
 } }
  • 201. © 2016 Pivotal Software, Inc. All rights reserved. Prepare Parent Test Class @RunWith(SpringRunner.class)
 @SpringBootTest(webEnvironment = WebEnvironment.NONE) @AutoConfigureMessageVerifier
 public abstract class MsgTestBase { @Autowired CustomerService service; protected void create() { service.create("@making"); 
 } } Created by Producer
  • 202. © 2016 Pivotal Software, Inc. All rights reserved. Contract DSL Contract.make { label 'create-customer' input { triggeredBy('create()') } outputMessage { sentTo('demo-strm') headers({header('Content-Type':'...')})
 body('''{"name":"@making"}''') }} shouldCreateCustomer.groovy
  • 203. © 2016 Pivotal Software, Inc. All rights reserved. Contract DSL Contract.make { label 'create-customer' input { triggeredBy('create()') } outputMessage { sentTo('demo-strm') headers({header('Content-Type':'...')})
 body('''{"name":"@making"}''') }} shouldCreateCustomer.groovy Updated by Producer
  • 204. © 2016 Pivotal Software, Inc. All rights reserved. Generated Acceptance Test public class ContractVerifierTest extends MsgTestBase { // ... @Test public void validate_shouldCreateCustomer() { create(); ContractVerifierMessage res = verifierMessaging .receive("customer");
 assertThat(res).isNotNull(); DocumentContext parsedJson = JsonPath.parse( objectMapper.writeValueAsString(res.getPayload())); assertThatJson(parsedJson).field("name") .isEqualTo("@making");
 }}
  • 205. © 2016 Pivotal Software, Inc. All rights reserved. Spring Cloud Contract Maven Plugin mvn spring-cloud-contract:generateTests mvn spring-cloud-contract:convert mvn spring-cloud-contract:generateStubs Acceptance Test WireMock stub file (only for REST) Stub jar file
  • 206. © 2016 Pivotal Software, Inc. All rights reserved. Consumer Side Test @RunWith(SpringRunner.class)
 @SpringBootTest(webEnvironment = WebEnvironment.NONE) @AutoConfigureStubRunner(ids = "com.example:customer- service", workOffline = true)
 public class PointServiceConsumerTest { @Autowired StubTrigger stubTrigger; // ... @Test public void testCreateCustomer() { stubTrigger.trigger("create-customer"); // assert that the message is received ...
 } }
  • 207. © 2016 Pivotal Software, Inc. All rights reserved. Check sample code •http://bit.ly/making_ccc_a3
  • 208. © 2016 Pivotal Software, Inc. All rights reserved. (FYI) CQRS and Event Sourcing • https://spring.io/blog/2016/11/08/cqrs-and-event-sourcing- with-jakub-pilimon • https://github.com/pilloPl/event-source-cqrs-sample
  • 209. ‹#›© 2016 Pivotal Software, Inc. All rights reserved. Data Microservices with Spring Cloud Data Flow
  • 210. © 2016 Pivotal Software, Inc. All rights reserved. Data Microservices $ cat book.txt | tr ' ' '¥ ' | tr '[:upper:]' '[:lower:]' | tr -d '[:punct:]' | grep -v '[^a-z]‘ | sort | uniq -c | sort -rn | head
  • 211. © 2016 Pivotal Software, Inc. All rights reserved. Data Microservices $ cat book.txt | tr ' ' '¥ ' | tr '[:upper:]' '[:lower:]' | tr -d '[:punct:]' | grep -v '[^a-z]‘ | sort | uniq -c | sort -rn | head
  • 212. © 2016 Pivotal Software, Inc. All rights reserved. Data Microservices $ cat book.txt | tr ' ' '¥ ' | tr '[:upper:]' '[:lower:]' | tr -d '[:punct:]' | grep -v '[^a-z]‘ | sort | uniq -c | sort -rn | head Microservice for each data processing
  • 213. © 2016 Pivotal Software, Inc. All rights reserved. Data Microservices $ cat book.txt | tr ' ' '¥ ' | tr '[:upper:]' '[:lower:]' | tr -d '[:punct:]' | grep -v '[^a-z]‘ | sort | uniq -c | sort -rn | head Microservice for each data processing
  • 214. © 2016 Pivotal Software, Inc. All rights reserved. Data Microservices $ cat book.txt | tr ' ' '¥ ' | tr '[:upper:]' '[:lower:]' | tr -d '[:punct:]' | grep -v '[^a-z]‘ | sort | uniq -c | sort -rn | head Microservice for each data processing bound with Message Brokers
  • 215. © 2016 Pivotal Software, Inc. All rights reserved. Data Microservices $ cat book.txt | tr ' ' '¥ ' | tr '[:upper:]' '[:lower:]' | tr -d '[:punct:]' | grep -v '[^a-z]‘ | sort | uniq -c | sort -rn | head Microservice for each data processing bound with Message Brokers
  • 216. © 2016 Pivotal Software, Inc. All rights reserved. Data Microservices $ cat book.txt | tr ' ' '¥ ' | tr '[:upper:]' '[:lower:]' | tr -d '[:punct:]' | grep -v '[^a-z]‘ | sort | uniq -c | sort -rn | head Microservice for each data processing bound with Message Brokers on the modern platform such as Cloud Foundry
  • 217. © 2016 Pivotal Software, Inc. All rights reserved. Data Microservices $ cat book.txt | tr ' ' '¥ ' | tr '[:upper:]' '[:lower:]' | tr -d '[:punct:]' | grep -v '[^a-z]‘ | sort | uniq -c | sort -rn | head Microservice for each data processing bound with Message Brokers on the modern platform such as Cloud Foundry
  • 218. © 2016 Pivotal Software, Inc. All rights reserved. Data Microservices $ cat book.txt | tr ' ' '¥ ' | tr '[:upper:]' '[:lower:]' | tr -d '[:punct:]' | grep -v '[^a-z]‘ | sort | uniq -c | sort -rn | head Microservice for each data processing bound with Message Brokers on the modern platform such as Cloud Foundry
  • 219. © 2016 Pivotal Software, Inc. All rights reserved. Spring Cloud Data Flow • Microservices-based Distributed Data Pipelines •Long Lived Stream Applications •Short Lived Task Applications
  • 220. © 2016 Pivotal Software, Inc. All rights reserved. Spring Cloud Data Flow • Microservices-based Distributed Data Pipelines •Long Lived Stream Applications •Short Lived Task Applications Spring Cloud Stream
  • 221. © 2016 Pivotal Software, Inc. All rights reserved. Spring Cloud Data Flow • Microservices-based Distributed Data Pipelines •Long Lived Stream Applications •Short Lived Task Applications Spring Cloud Stream Spring Cloud Task
  • 222. © 2016 Pivotal Software, Inc. All rights reserved. Spring Cloud Data Flow • Microservices-based Distributed Data Pipelines •Long Lived Stream Applications •Short Lived Task Applications Spring Cloud Stream Spring Cloud Task Orchestration Layer
  • 223. © 2016 Pivotal Software, Inc. All rights reserved. Check my slide • http://www.slideshare.net/makingx/data-microservices-with- spring-cloud-stream-task-and-data-flow-jsug-springday
  • 224. ‹#›© 2016 Pivotal Software, Inc. All rights reserved. Deploy Stream Apps to Cloud Foundry
  • 225. © 2016 Pivotal Software, Inc. All rights reserved. Cloud Foundry •https://www.cloudfoundry.org/ •Cloud Native Platform •OSS •Spring ❤ Cloud Foundry •Support Multi IaaS 
 (AWS, Azure, GCP, vSphere, OpenStack)
  • 226. © 2016 Pivotal Software, Inc. All rights reserved. Cloud Foundry everywhere Public Cloud Foundry Private Cloud Foundry Development OSS ver Pivotal Cloud Foundry on Premise on Public Cloud
  • 227. © 2016 Pivotal Software, Inc. All rights reserved. PCF Dev • https://docs.pivotal.io/pcf-dev • Cloud Foundry on your laptop • Included • Redis / RabbitMQ / MySQL • Spring Cloud Services • Install with cf dev start
  • 228. © 2016 Pivotal Software, Inc. All rights reserved. Pivotal Web Services •https://run.pivotal.io/ •Public Cloud Foundry managed by Pivotal •$0.03/GB-hr (≈ ¥2200/GB-month) •$87 of free trial credit.
  • 229. © 2016 Pivotal Software, Inc. All rights reserved. Deploy Spring Cloud Stream Apps cf push my-source my-source.jar --no-start cf bind-service my-source my-binder cf start my-source cf push my-sink my-sink.jar --no-start cf bind-service my-sink my-binder cf start my-sink # in case of PCF Dev cf create-service p-rabbitmq standard my-binder # in case of Pivotal Web Services cf create-service cloudamqp lemur my-binder
  • 230. © 2016 Pivotal Software, Inc. All rights reserved. Sample Application http://bit.ly/making_ccc_a3 Pivotal Web Services / PCF Dev Frontend Customer Service Email Service Point Service Post ServiceZipkin Server MySQL SendGrid MySQL MySQL DLQ Recovery RabbitMQ HTTP
  • 231. © 2016 Pivotal Software, Inc. All rights reserved. Tutorial https://github.com/Pivotal-Japan/spring-cloud-stream-tutorial
  • 232. © 2016 Pivotal Software, Inc. All rights reserved. Thanks!! • https://cloud.spring.io/spring-cloud-stream/ • https://cloud.spring.io/spring-cloud-dataflow/ • https://cloud.spring.io/spring-cloud-sleuth/ • http://zipkin.io/ • https://cloud.spring.io/spring-cloud-contract/ • https://projects.spring.io/spring-amqp/ • https://run.pivotal.io/