Let’s Spring Forth and Stream
with Apache Pulsar
1
@KoTurk77
May 2023
©2023 DataStax. – All rights reserved
This slide deck can be accessed here:
©2023 DataStax. – All rights reserved
Speakers
©2023 DataStax. – All rights reserved
Agenda
Cover w/ Image
©2023 DataStax. – All rights reserved
Introduction
©2023 DataStax. – All rights reserved
01
©2023 DataStax. – All rights reserved
What is Apache Pulsar?
©2023 DataStax. – All rights reserved
What is Spring for Apache Pulsar?
©2023 DataStax. – All rights reserved
Backstory
©2023 DataStax. – All rights reserved
High-Level Overview of Apache Pulsar
©2023 DataStax. – All rights reserved
02
©2023 DataStax. – All rights reserved
Built on Pub-Sub Pattern
©2023 DataStax. – All rights reserved
Flexible Subscriptions
©2023 DataStax. – All rights reserved
Architecture
Pulsar Client APIs
Producers
Broker
Consumers
Topics
©2023 DataStax. – All rights reserved
Architecture
Producers
Broker
Consumers
Topics
Reactive
client
Imperative
client
©2023 DataStax. – All rights reserved
Architecture
Producers
Broker
Consumers
Topics
Reactive
client
Imperative
client
Spring Pulsar
Spring Framework
Auto-configured clients
Spring Boot
SPRING PULSAR
©2023 DataStax. – All rights reserved
Architecture
Producers
Broker
Consumers
Topics
Reactive
client
Imperative
client
Spring Pulsar
Spring Framework
Auto-configured clients
Spring Boot
PulsarTemplate
@PulsarListener
SPRING PULSAR
©2023 DataStax. – All rights reserved
Architecture
Producers
Broker
Consumers
Topics
Reactive
client
Imperative
client
Spring Pulsar
Spring Framework
Auto-configured clients
Spring Boot
PulsarTemplate
@PulsarListener
SPRING PULSAR
ReactivePulsarTemplate
@ReactivePulsarListener
©2023 DataStax. – All rights reserved
Produce / consume (imperative)
@SpringBootApplication�class SpringPulsarHelloWorld { public static void main(String[] args) {� SpringApplication.run(SpringPulsarHelloWorld.class, args);� }�� @Bean� ApplicationRunner runner(PulsarTemplate<String> template) {� return (args) -> template.send("hello-topic", "Hello World!");� }�� @PulsarListener(topics = "hello-topic")� void listen(String msg) {� System.out.println("Message Received: " + msg);� }�} // spring.pulsar.consumer.subscription-initial-position=earliest |
©2023 DataStax. – All rights reserved
Produce / consume (reactive)
@SpringBootApplication�class SpringPulsarReactiveHelloWorld { public static void main(String[] args) {� SpringApplication.run(SpringPulsarReactiveHelloWorld.class, args);� }�� @Bean� ApplicationRunner runner(ReactivePulsarTemplate<String> template) {� return (args) -> template.send("hello-topic", "Hello World!").subscribe();� }�� @ReactivePulsarListener(topics = "hello-topic")� Mono<Void> listen(String msg) {� System.out.println("Message Received: " + msg); return Mono.empty();� }�} // spring.pulsar.reactiveconsumer.subscription-initial-position=earliest |
©2023 DataStax. – All rights reserved
Additional Noteworthy Features
©2023 DataStax. – All rights reserved
©2023 DataStax. – All rights reserved
Additional Noteworthy Features
©2023 DataStax. – All rights reserved
Benefits
©2023 DataStax. – All rights reserved
The live demo…
©2023 DataStax. – All rights reserved
03
©2023 DataStax. – All rights reserved
Source code
©2023 DataStax. – All rights reserved
What’s next?
©2023 DataStax. – All rights reserved
Core
Auto-configuration
Pulsar Binder
Spring Pulsar v0.2.0
Project evolution
Spring
Pulsar
©2023 DataStax. – All rights reserved
Project evolution
Spring
Boot
Spring �Cloud Stream
Spring Boot v3.2
Spring Cloud Stream v4.1
Core
Auto-configuration
Pulsar Binder
Spring Pulsar v1.0
Spring
Pulsar
©2023 DataStax. – All rights reserved
Project evolution
Spring
Boot
Spring �Cloud Stream
Spring Boot v3.2
Spring Cloud Stream v4.1
Core
Auto-configuration
Pulsar Binder
Spring Pulsar v1.0
Spring
Pulsar
©2023 DataStax. – All rights reserved
Project evolution
Spring
Boot
Spring �Cloud Stream
Spring Boot v3.2
Spring Cloud Stream v4.1
Core
Auto-configuration
Pulsar Binder
Spring Pulsar v1.0
Spring
Pulsar
©2023 DataStax. – All rights reserved
What about GraalVM?…
©2023 DataStax. – All rights reserved
04
©2023 DataStax. – All rights reserved
The Q + A …
©2023 DataStax. – All rights reserved
05
©2023 DataStax. – All rights reserved
Appendix / Resources
©2023 DataStax. – All rights reserved
Spring / Pulsar Resources
©2023 DataStax. – All rights reserved
Pulsar / DataStax Resources
https://www.datastax.com/products/astra-streaming
https://www.datastax.com/products/luna-streaming
CDC for Astra: https://docs.datastax.com/en/astra/docs/astream-cdc.html
34
©2023 DataStax. – All rights reserved
Thank You
Mary Grygleski
Christophe Bornet
©2023 DataStax. – All rights reserved