SlideShare a Scribd company logo
1 of 26
Download to read offline
A High-Speed Data Ingestion
Service in Java Using MQTT,
AMQP, and STOMP
September 20, 2023
Las Vegas, NV
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
1
Kuassi Mensah
Director of Product Management
Oracle
Juarez Barbosa Junior
Sr. Principal Java Developer Evangelist
Oracle
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
2
Meet the speakers
Java App Dev with Oracle Database
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
3
ORACLE JDBC & UCP
Supporting all Java DataBase Connectivity types
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
4
ORACLE JDBC
Reactive Java Database Connectivity (JDBC)
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
5
SYNC & ASYNC JDBC
Support for the Latest Java Versions
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
6
JAVA & JDBC VERSIONS
• Java 11 - native support, compiled with it
• Java 17 - certified
• JDBC Standards - 4.2 and 4.3
• GraalVM - native image instrumentation
• Reactive Streams - Java Flow API support
• Project Loom - Virtual Threads support
• Data access is critical in mission-critical apps
Classic Java Threads
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
7
AKA JAVA PLATFORM THREADS
⚫ Database access with blocking threads
⚫ A JDBC call blocks a thread for 100’s of milliseconds
(thread-per-request style)
⚫ Thread count increases linearly with the number of JDBC
calls
⚫ Performance degrades as the number of threads increases
⚫ 1 MB of stack memory per thread
⚫ Scheduling many platform threads is expensive
⚫ Preemptive scheduling vs time-slicing
Virtual Threads
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
8
LIGHTWEIGHT THREADS
⚫ JEPs 425, 436, 444 (JDK Enhancement Proposals)
⚫ Lightweight threads that dramatically reduce the effort of writing, maintaining, and observing high-throughput concurrent
applications
⚫ Enable applications written in the simple thread-per-request style to scale with near-optimal hardware utilization
⚫ Enable easy troubleshooting, debugging, and profiling of virtual threads with existing JDK tools
Virtual Threads
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
9
LIGHTWEIGHT THREADS
⚫ JEPs 425, 436, 444 (JDK Enhancement Proposals)
⚫ Do not remove the traditional implementation of threads, and do not alter the basic concurrency model of Java
⚫ Enable existing code that uses Java threads to adopt virtual threads with minimal change
⚫ java.lang.Thread
⚫ final Boolean - isVirtual()
⚫ static Thread.Builder.OfVirtual - ofVirtual()
⚫ static Thread.Builder.OfPlatform - ofPlatform()
⚫ static Thread - startVirtualThread(Runnable task)
Demo # 1: Virtual vs Platform Threads
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
10
RESOURCES UTILIZATION COMPARISON
⚫ Virtual Threads versus Platform Threads
⚫ JEP 425 Virtual Threads (Preview)
⚫ JEP 436 (Second Preview)
⚫ JEP 444 (Target -> JDK 21)
⚫ Runs on Java 19, 20, 21
⚫ javac --release 19 --enable-preview
⚫ java --enable-preview
⚫ Oracle JDBC Driver 23c instrumented to support Virtual Threads
⚫ Verifiable comparison of OS/HW resources utilization (Platform Threads x Virtual Threads)
Oracle Reactive Streams Ingestion (RSI) Library
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
11
ASYNC JDBC
⚫ Java Library for Reactive Streams Ingestion
⚫ Streaming capability: Ingest data in an unblocking, and reactive way from a
large group of clients
⚫ Group records through RAC (Real App Clusters), and Shard affinity using
native UCP (Universal Connection Pool)
⚫ Optimize CPU allocation while decoupling record processing from I/O
⚫ Fastest insert method for the Oracle Database through Direct Path Insert,
bypassing SQL and writing directly into the DB files
Demo # 2: Reactive Streams Ingestion (RSI)
PushPublisher API
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
12
// Push Publisher for Simple Usage
PushPublisher<Customer> pushPublisher =
ReactiveStreamsIngestion.pushPublisher();
pushPublisher.subscribe(rsi.subscriber());
// Ad-hoc usage
pushPublisher.accept(
new Customer(1, "John Doe", "North"));
// As a Consumer of a Stream
Customer[] customers = …
Stream
.of(customers)
.filter(c -> c.region.equals("NORTH"))
.forEach(pushPublisher::accept);
// As a Consumer for 3rd party Reactive Stream
// Libraries eg: Reactor https://projectreactor.io/
Flux
.just(
new Customer(1, "John Doe", "North"),
new Customer(2, "Jane Smith", "South"))
.concatWithValues(new Customer(3, "Bob", "South"))
.doOnComplete(() -> {System.out.println("Done!");})
.doOnCancel(() -> {System.out.println("Canceled!");})
.subscribe(pushPublisher::accept);
Oracle R2DBC: from Synchronous to Reactive JDBC
Sync, blocking Async, reactive
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
13
static String queryJdbc(java.sql.Connection connection)
throws SQLException {
try (java.sql.Statement statement =
connection.createStatement()) {
ResultSet resultSet =
statement.executeQuery("SELECT * FROM CUSTOMERS");
if (resultSet.next())
return resultSet.getString(1);
else
throw new NoSuchElementException("Query returned zero
rows");
}
}
static Publisher<String>
queryR2dbc(io.r2dbc.spi.Connection connection) {
return Flux.from(connection.createStatement(
"SELECT * FROM CUSTOMERS")
.execute())
.flatMap(result ->
result.map(row -> row.get(0, String.class)))
.switchIfEmpty(Flux.error(
new NoSuchElementException("Query returned zero
rows")));
}
Demo # 3: Oracle R2DBC
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
14
REACTIVE STREAMS
⚫ Oracle Reactive Relational Database Connectivity (R2DBC)
⚫ Oracle R2DBC Driver is a Java library that supports reactive Programming with Oracle
Database
⚫ It implements the R2DBC Service Provider Interface (SPI) as specified by the Reactive
Relational Database Connectivity (R2DBC)
⚫ The R2DBC SPI exposes Reactive Streams as an abstraction for Remote database
operations
⚫ The sample code uses Project Reactor. It could use RxJava, Akka, or any RS library
⚫ Runs on Java 11+
Oracle JDBC supports both!
Want Virtual Threads?
• Oracle JDBC has been “Virtual Thread Compatible”since
21.1.0.0
Want Reactive Streams?
• Oracle R2DBC 1.0.0
• Consume JDK 9 Flow interfaces implementations directly
from Oracle JDBC’s Reactive Extensions
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
15
Virtual Threads or Reactive Streams?
Virtual Threads or Reactive?
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
16
• Benefits of Virtual Threads:
• Easier to read and write
• Easier to debug
• Integration with JDK tools
• Do not alter the basic concurrency model of Java
• Limitations of Virtual Threads:
• Some libraries are not compatible
• To be finalized in JDK 21
• JEP 425: Virtual Threads (Preview)
• JEP 436: Virtual Threads (Second Preview)
• JEP 444: Virtual Threads
Benefits of Reactive:
• Reactive Libraries (Reactor, RxJava, Akka,
Vert.x)
• Stream-like API with a functional style
• Low-level concurrency is handled for
you (locks, atomics, queues).
Limitations of Reactive:
• Steep learning curve
• Harder to read and write
• Harder to debug
MOM - Message-Oriented Middleware
A middleware component that allows communication and exchanges data (messages).
It involves passing data between applications using a communication channel that carries self-
contained units of information (messages).
In a MOM-based communication environment, messages are sent and received
asynchronously.
Message-Oriented Middleware - Apache ActiveMQ
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
17
AMQP – Advanced Message Queuing Protocol
The Advanced Message Queuing Protocol (AMQP) is an open standard for passing business
messages between applications or organizations. With AMQP organizations can:
• Realize the savings commoditization brings; remove vendor lock-in
• Connect applications on different platforms; choose the right platform for the job
• Connect to business partners using a full-featured open standard; remove technical
barriers to trade
• Position for innovations built upon the foundation of AMQP
• Security, Reliability, Interoperability, Standard, Openness
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
18
MQTT – Message Queuing Telemetry Transport
MQTT is an OASIS standard messaging protocol for the Internet of Things (IoT).
It is designed as an extremely lightweight publish/subscribe messaging transport that is ideal
for connecting remote devices with a small code footprint and minimal network bandwidth.
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
19
STOMP – Simple (or Streaming) Text Oriented
Messaging Protocol
STOMP provides an interoperable wire format so that STOMP clients can communicate with
any STOMP message broker to provide easy and widespread messaging interoperability
among many languages, platforms and brokers..
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
20
Java Message Service (JMS) & ActiveMQ
ActiveMQ
• ActiveMQ is a Java-based open-source message broker which supports REST API and various
wire-level protocols, such as MQTT, AMQP, and STOMP.
JMS Message Producer and Consumer
• Port number 5672 is the default port that ActiveMQ is listening to over the AMQP protocol when it
starts up.
• The sample code snippet creates an AMQP connection (publisher) that connects to ActiveMQ
using the given username, password, hostname, and port number.
• It also creates a topic subscriber (consumer) to receive messages that have been published to the
"event" topic.
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
21
Java Message Service (JMS) & ActiveMQ
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
22
Demo # 4: Architecture / Project Structure
ActiveMQ + AMQP + MQTT + STOMP + Java Message Service
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
23
Learn More
JDK 21 - https://openjdk.org/projects/jdk/21/
Project Loom - https://openjdk.org/projects/loom/
JEP 444 Virtual Threads - https://openjdk.org/jeps/444
Getting Started with the Java library for Reactive Streams Ingestion (RSI) - https://bit.ly/3rEiRnC
High-throughput stream processing with the Java Library for Reactive Streams Ingestion (RSI),
Virtual Threads, and the Oracle ATP Database - https://bit.ly/3rATCTd
Oracle R2DBC Driver – https://github.com/oracle/oracle-r2dbc
JDBC – https://www.oracle.com/database/technologies/appdev/jdbc.html
Application Development with the Oracle Database -
https://www.oracle.com/database/technologies/application-development.html
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
24
Thank you
Kuassi Mensah, Director of Product Management
kuassi.mensah@oracle.com
Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates
25
Juarez Barbosa Jr, Sr. Principal Java Developer Evangelist
juarez.barbosa@oracle.com
Session Survey
26 Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates

More Related Content

Similar to Oracle CloudWorld 2023 - A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, and STOMP

JCON OpenBlend Slovenia 2023 - A High-Speed Data Ingestion Service in Java Us...
JCON OpenBlend Slovenia 2023 - A High-Speed Data Ingestion Service in Java Us...JCON OpenBlend Slovenia 2023 - A High-Speed Data Ingestion Service in Java Us...
JCON OpenBlend Slovenia 2023 - A High-Speed Data Ingestion Service in Java Us...Juarez Junior
 
BarcelonaJUG - Revolutionize Java Database Application Development with React...
BarcelonaJUG - Revolutionize Java Database Application Development with React...BarcelonaJUG - Revolutionize Java Database Application Development with React...
BarcelonaJUG - Revolutionize Java Database Application Development with React...Juarez Junior
 
Porto Tech Hub Conference 2023 - Revolutionize Java DB AppDev with Reactive S...
Porto Tech Hub Conference 2023 - Revolutionize Java DB AppDev with Reactive S...Porto Tech Hub Conference 2023 - Revolutionize Java DB AppDev with Reactive S...
Porto Tech Hub Conference 2023 - Revolutionize Java DB AppDev with Reactive S...Juarez Junior
 
Cloud Conference Day - Revolutionize Java Database App Development with React...
Cloud Conference Day - Revolutionize Java Database App Development with React...Cloud Conference Day - Revolutionize Java Database App Development with React...
Cloud Conference Day - Revolutionize Java Database App Development with React...Juarez Junior
 
CloudTalks - Revolutionize Java DB AppDev with Reactive Streams and Virtual T...
CloudTalks - Revolutionize Java DB AppDev with Reactive Streams and Virtual T...CloudTalks - Revolutionize Java DB AppDev with Reactive Streams and Virtual T...
CloudTalks - Revolutionize Java DB AppDev with Reactive Streams and Virtual T...Juarez Junior
 
jPrime 2023 - Revolutionize Java DB AppDev with Reactive Streams and Virtual ...
jPrime 2023 - Revolutionize Java DB AppDev with Reactive Streams and Virtual ...jPrime 2023 - Revolutionize Java DB AppDev with Reactive Streams and Virtual ...
jPrime 2023 - Revolutionize Java DB AppDev with Reactive Streams and Virtual ...Juarez Junior
 
DeveloperWeek Europe 2023 - Revolutionize Java DB AppDev with Reactive Stream...
DeveloperWeek Europe 2023 - Revolutionize Java DB AppDev with Reactive Stream...DeveloperWeek Europe 2023 - Revolutionize Java DB AppDev with Reactive Stream...
DeveloperWeek Europe 2023 - Revolutionize Java DB AppDev with Reactive Stream...Juarez Junior
 
TDC Connections 2023 - Revolutionize Java DB AppDev with Reactive Streams and...
TDC Connections 2023 - Revolutionize Java DB AppDev with Reactive Streams and...TDC Connections 2023 - Revolutionize Java DB AppDev with Reactive Streams and...
TDC Connections 2023 - Revolutionize Java DB AppDev with Reactive Streams and...Juarez Junior
 
Rollin onj Rubyv3
Rollin onj Rubyv3Rollin onj Rubyv3
Rollin onj Rubyv3Oracle
 
B1 roadmap to cloud platform with oracle web logic server-oracle coherence ...
B1   roadmap to cloud platform with oracle web logic server-oracle coherence ...B1   roadmap to cloud platform with oracle web logic server-oracle coherence ...
B1 roadmap to cloud platform with oracle web logic server-oracle coherence ...Dr. Wilfred Lin (Ph.D.)
 
What's New and Noteworthy on Oracle CAF 12.1.3
What's New and Noteworthy on Oracle CAF 12.1.3What's New and Noteworthy on Oracle CAF 12.1.3
What's New and Noteworthy on Oracle CAF 12.1.3Bruno Borges
 
Shopzilla On Concurrency
Shopzilla On ConcurrencyShopzilla On Concurrency
Shopzilla On ConcurrencyRodney Barlow
 
Java dev mar_2021_keynote
Java dev mar_2021_keynoteJava dev mar_2021_keynote
Java dev mar_2021_keynoteSuyash Joshi
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC vipin kumar
 
Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.suranisaunak
 
Java Library for High Speed Streaming Data
Java Library for High Speed Streaming Data Java Library for High Speed Streaming Data
Java Library for High Speed Streaming Data Oracle Developers
 
Elastic and Cloud-ready Applications with Payara Micro
Elastic and Cloud-ready Applications with Payara MicroElastic and Cloud-ready Applications with Payara Micro
Elastic and Cloud-ready Applications with Payara MicroOndrej Mihályi
 
Elastic and Cloud-ready Applications with Payara Micro
Elastic and Cloud-ready Applications with Payara MicroElastic and Cloud-ready Applications with Payara Micro
Elastic and Cloud-ready Applications with Payara MicroPayara
 
Elastic and Cloud-ready Applications with Payara Micro
Elastic and Cloud-ready Applications with Payara MicroElastic and Cloud-ready Applications with Payara Micro
Elastic and Cloud-ready Applications with Payara MicroPayara
 

Similar to Oracle CloudWorld 2023 - A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, and STOMP (20)

JCON OpenBlend Slovenia 2023 - A High-Speed Data Ingestion Service in Java Us...
JCON OpenBlend Slovenia 2023 - A High-Speed Data Ingestion Service in Java Us...JCON OpenBlend Slovenia 2023 - A High-Speed Data Ingestion Service in Java Us...
JCON OpenBlend Slovenia 2023 - A High-Speed Data Ingestion Service in Java Us...
 
BarcelonaJUG - Revolutionize Java Database Application Development with React...
BarcelonaJUG - Revolutionize Java Database Application Development with React...BarcelonaJUG - Revolutionize Java Database Application Development with React...
BarcelonaJUG - Revolutionize Java Database Application Development with React...
 
Porto Tech Hub Conference 2023 - Revolutionize Java DB AppDev with Reactive S...
Porto Tech Hub Conference 2023 - Revolutionize Java DB AppDev with Reactive S...Porto Tech Hub Conference 2023 - Revolutionize Java DB AppDev with Reactive S...
Porto Tech Hub Conference 2023 - Revolutionize Java DB AppDev with Reactive S...
 
Cloud Conference Day - Revolutionize Java Database App Development with React...
Cloud Conference Day - Revolutionize Java Database App Development with React...Cloud Conference Day - Revolutionize Java Database App Development with React...
Cloud Conference Day - Revolutionize Java Database App Development with React...
 
CloudTalks - Revolutionize Java DB AppDev with Reactive Streams and Virtual T...
CloudTalks - Revolutionize Java DB AppDev with Reactive Streams and Virtual T...CloudTalks - Revolutionize Java DB AppDev with Reactive Streams and Virtual T...
CloudTalks - Revolutionize Java DB AppDev with Reactive Streams and Virtual T...
 
jPrime 2023 - Revolutionize Java DB AppDev with Reactive Streams and Virtual ...
jPrime 2023 - Revolutionize Java DB AppDev with Reactive Streams and Virtual ...jPrime 2023 - Revolutionize Java DB AppDev with Reactive Streams and Virtual ...
jPrime 2023 - Revolutionize Java DB AppDev with Reactive Streams and Virtual ...
 
DeveloperWeek Europe 2023 - Revolutionize Java DB AppDev with Reactive Stream...
DeveloperWeek Europe 2023 - Revolutionize Java DB AppDev with Reactive Stream...DeveloperWeek Europe 2023 - Revolutionize Java DB AppDev with Reactive Stream...
DeveloperWeek Europe 2023 - Revolutionize Java DB AppDev with Reactive Stream...
 
TDC Connections 2023 - Revolutionize Java DB AppDev with Reactive Streams and...
TDC Connections 2023 - Revolutionize Java DB AppDev with Reactive Streams and...TDC Connections 2023 - Revolutionize Java DB AppDev with Reactive Streams and...
TDC Connections 2023 - Revolutionize Java DB AppDev with Reactive Streams and...
 
Rollin onj Rubyv3
Rollin onj Rubyv3Rollin onj Rubyv3
Rollin onj Rubyv3
 
B1 roadmap to cloud platform with oracle web logic server-oracle coherence ...
B1   roadmap to cloud platform with oracle web logic server-oracle coherence ...B1   roadmap to cloud platform with oracle web logic server-oracle coherence ...
B1 roadmap to cloud platform with oracle web logic server-oracle coherence ...
 
What's New and Noteworthy on Oracle CAF 12.1.3
What's New and Noteworthy on Oracle CAF 12.1.3What's New and Noteworthy on Oracle CAF 12.1.3
What's New and Noteworthy on Oracle CAF 12.1.3
 
Shopzilla On Concurrency
Shopzilla On ConcurrencyShopzilla On Concurrency
Shopzilla On Concurrency
 
Java dev mar_2021_keynote
Java dev mar_2021_keynoteJava dev mar_2021_keynote
Java dev mar_2021_keynote
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC
 
Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.
 
Java Library for High Speed Streaming Data
Java Library for High Speed Streaming Data Java Library for High Speed Streaming Data
Java Library for High Speed Streaming Data
 
Real time web apps
Real time web appsReal time web apps
Real time web apps
 
Elastic and Cloud-ready Applications with Payara Micro
Elastic and Cloud-ready Applications with Payara MicroElastic and Cloud-ready Applications with Payara Micro
Elastic and Cloud-ready Applications with Payara Micro
 
Elastic and Cloud-ready Applications with Payara Micro
Elastic and Cloud-ready Applications with Payara MicroElastic and Cloud-ready Applications with Payara Micro
Elastic and Cloud-ready Applications with Payara Micro
 
Elastic and Cloud-ready Applications with Payara Micro
Elastic and Cloud-ready Applications with Payara MicroElastic and Cloud-ready Applications with Payara Micro
Elastic and Cloud-ready Applications with Payara Micro
 

More from Juarez Junior

Oracle CloudWorld 2023 - How to hook up Telegram with Spring Boot and ADB
Oracle CloudWorld 2023 - How to hook up Telegram with Spring Boot and ADBOracle CloudWorld 2023 - How to hook up Telegram with Spring Boot and ADB
Oracle CloudWorld 2023 - How to hook up Telegram with Spring Boot and ADBJuarez Junior
 
Oracle CloudWorld 2023 - A Practical Guide to Implementing DevOps with IaC fo...
Oracle CloudWorld 2023 - A Practical Guide to Implementing DevOps with IaC fo...Oracle CloudWorld 2023 - A Practical Guide to Implementing DevOps with IaC fo...
Oracle CloudWorld 2023 - A Practical Guide to Implementing DevOps with IaC fo...Juarez Junior
 
Oracle CloudWorld 2023 - Multi-cloud App Dev for Java Devs with Microsoft Azu...
Oracle CloudWorld 2023 - Multi-cloud App Dev for Java Devs with Microsoft Azu...Oracle CloudWorld 2023 - Multi-cloud App Dev for Java Devs with Microsoft Azu...
Oracle CloudWorld 2023 - Multi-cloud App Dev for Java Devs with Microsoft Azu...Juarez Junior
 
GeeCon Prague 2023 - Unleash the power of your applications with Micronaut®, ...
GeeCon Prague 2023 - Unleash the power of your applications with Micronaut®, ...GeeCon Prague 2023 - Unleash the power of your applications with Micronaut®, ...
GeeCon Prague 2023 - Unleash the power of your applications with Micronaut®, ...Juarez Junior
 
SevillaJUG - Unleash the power of your applications with Micronaut® ,GraalVM...
SevillaJUG - Unleash the power of your applications with Micronaut®  ,GraalVM...SevillaJUG - Unleash the power of your applications with Micronaut®  ,GraalVM...
SevillaJUG - Unleash the power of your applications with Micronaut® ,GraalVM...Juarez Junior
 
SKILup Days Container Orchestration - Kubernetes Operators for Databases
SKILup Days Container Orchestration - Kubernetes Operators for DatabasesSKILup Days Container Orchestration - Kubernetes Operators for Databases
SKILup Days Container Orchestration - Kubernetes Operators for DatabasesJuarez Junior
 
DTU Global Azure 2023 Bootcamp - Multi-cloud App Dev for Java Developers with...
DTU Global Azure 2023 Bootcamp - Multi-cloud App Dev for Java Developers with...DTU Global Azure 2023 Bootcamp - Multi-cloud App Dev for Java Developers with...
DTU Global Azure 2023 Bootcamp - Multi-cloud App Dev for Java Developers with...Juarez Junior
 
Melee Numerique 2022 - Revolutionize Java DB App Dev with Reactive Streams an...
Melee Numerique 2022 - Revolutionize Java DB App Dev with Reactive Streams an...Melee Numerique 2022 - Revolutionize Java DB App Dev with Reactive Streams an...
Melee Numerique 2022 - Revolutionize Java DB App Dev with Reactive Streams an...Juarez Junior
 
DeveloperWeekEnterprise2023 - Introduction to Kubernetes Operators for Databases
DeveloperWeekEnterprise2023 - Introduction to Kubernetes Operators for DatabasesDeveloperWeekEnterprise2023 - Introduction to Kubernetes Operators for Databases
DeveloperWeekEnterprise2023 - Introduction to Kubernetes Operators for DatabasesJuarez Junior
 
DevConf.cz - Introduction to Kubernetes Operators for Databases
DevConf.cz - Introduction to Kubernetes Operators for DatabasesDevConf.cz - Introduction to Kubernetes Operators for Databases
DevConf.cz - Introduction to Kubernetes Operators for DatabasesJuarez Junior
 
[pt-BR] - Cloud Conference Day - Agilidade para disponibilização de aplicaçõe...
[pt-BR] - Cloud Conference Day - Agilidade para disponibilização de aplicaçõe...[pt-BR] - Cloud Conference Day - Agilidade para disponibilização de aplicaçõe...
[pt-BR] - Cloud Conference Day - Agilidade para disponibilização de aplicaçõe...Juarez Junior
 
Microsoft Azure - GAA and Irish Tech Society Hackathon
Microsoft Azure - GAA and Irish Tech Society HackathonMicrosoft Azure - GAA and Irish Tech Society Hackathon
Microsoft Azure - GAA and Irish Tech Society HackathonJuarez Junior
 
JSNation.com - Azure Static Web Apps (SWA) with Azure DevOps
JSNation.com - Azure Static Web Apps (SWA) with Azure DevOpsJSNation.com - Azure Static Web Apps (SWA) with Azure DevOps
JSNation.com - Azure Static Web Apps (SWA) with Azure DevOpsJuarez Junior
 
Azure DevOps with DV and GitHub
Azure DevOps with DV and GitHubAzure DevOps with DV and GitHub
Azure DevOps with DV and GitHubJuarez Junior
 

More from Juarez Junior (14)

Oracle CloudWorld 2023 - How to hook up Telegram with Spring Boot and ADB
Oracle CloudWorld 2023 - How to hook up Telegram with Spring Boot and ADBOracle CloudWorld 2023 - How to hook up Telegram with Spring Boot and ADB
Oracle CloudWorld 2023 - How to hook up Telegram with Spring Boot and ADB
 
Oracle CloudWorld 2023 - A Practical Guide to Implementing DevOps with IaC fo...
Oracle CloudWorld 2023 - A Practical Guide to Implementing DevOps with IaC fo...Oracle CloudWorld 2023 - A Practical Guide to Implementing DevOps with IaC fo...
Oracle CloudWorld 2023 - A Practical Guide to Implementing DevOps with IaC fo...
 
Oracle CloudWorld 2023 - Multi-cloud App Dev for Java Devs with Microsoft Azu...
Oracle CloudWorld 2023 - Multi-cloud App Dev for Java Devs with Microsoft Azu...Oracle CloudWorld 2023 - Multi-cloud App Dev for Java Devs with Microsoft Azu...
Oracle CloudWorld 2023 - Multi-cloud App Dev for Java Devs with Microsoft Azu...
 
GeeCon Prague 2023 - Unleash the power of your applications with Micronaut®, ...
GeeCon Prague 2023 - Unleash the power of your applications with Micronaut®, ...GeeCon Prague 2023 - Unleash the power of your applications with Micronaut®, ...
GeeCon Prague 2023 - Unleash the power of your applications with Micronaut®, ...
 
SevillaJUG - Unleash the power of your applications with Micronaut® ,GraalVM...
SevillaJUG - Unleash the power of your applications with Micronaut®  ,GraalVM...SevillaJUG - Unleash the power of your applications with Micronaut®  ,GraalVM...
SevillaJUG - Unleash the power of your applications with Micronaut® ,GraalVM...
 
SKILup Days Container Orchestration - Kubernetes Operators for Databases
SKILup Days Container Orchestration - Kubernetes Operators for DatabasesSKILup Days Container Orchestration - Kubernetes Operators for Databases
SKILup Days Container Orchestration - Kubernetes Operators for Databases
 
DTU Global Azure 2023 Bootcamp - Multi-cloud App Dev for Java Developers with...
DTU Global Azure 2023 Bootcamp - Multi-cloud App Dev for Java Developers with...DTU Global Azure 2023 Bootcamp - Multi-cloud App Dev for Java Developers with...
DTU Global Azure 2023 Bootcamp - Multi-cloud App Dev for Java Developers with...
 
Melee Numerique 2022 - Revolutionize Java DB App Dev with Reactive Streams an...
Melee Numerique 2022 - Revolutionize Java DB App Dev with Reactive Streams an...Melee Numerique 2022 - Revolutionize Java DB App Dev with Reactive Streams an...
Melee Numerique 2022 - Revolutionize Java DB App Dev with Reactive Streams an...
 
DeveloperWeekEnterprise2023 - Introduction to Kubernetes Operators for Databases
DeveloperWeekEnterprise2023 - Introduction to Kubernetes Operators for DatabasesDeveloperWeekEnterprise2023 - Introduction to Kubernetes Operators for Databases
DeveloperWeekEnterprise2023 - Introduction to Kubernetes Operators for Databases
 
DevConf.cz - Introduction to Kubernetes Operators for Databases
DevConf.cz - Introduction to Kubernetes Operators for DatabasesDevConf.cz - Introduction to Kubernetes Operators for Databases
DevConf.cz - Introduction to Kubernetes Operators for Databases
 
[pt-BR] - Cloud Conference Day - Agilidade para disponibilização de aplicaçõe...
[pt-BR] - Cloud Conference Day - Agilidade para disponibilização de aplicaçõe...[pt-BR] - Cloud Conference Day - Agilidade para disponibilização de aplicaçõe...
[pt-BR] - Cloud Conference Day - Agilidade para disponibilização de aplicaçõe...
 
Microsoft Azure - GAA and Irish Tech Society Hackathon
Microsoft Azure - GAA and Irish Tech Society HackathonMicrosoft Azure - GAA and Irish Tech Society Hackathon
Microsoft Azure - GAA and Irish Tech Society Hackathon
 
JSNation.com - Azure Static Web Apps (SWA) with Azure DevOps
JSNation.com - Azure Static Web Apps (SWA) with Azure DevOpsJSNation.com - Azure Static Web Apps (SWA) with Azure DevOps
JSNation.com - Azure Static Web Apps (SWA) with Azure DevOps
 
Azure DevOps with DV and GitHub
Azure DevOps with DV and GitHubAzure DevOps with DV and GitHub
Azure DevOps with DV and GitHub
 

Recently uploaded

Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingScyllaDB
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireExakis Nelite
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentationyogeshlabana357357
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfAnubhavMangla3
 
Microsoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdfMicrosoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdfOverkill Security
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهMohamed Sweelam
 
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...SOFTTECHHUB
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024Lorenzo Miniero
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxjbellis
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...caitlingebhard1
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxMarkSteadman7
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....rightmanforbloodline
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!Memoori
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 

Recently uploaded (20)

Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
 
Microsoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdfMicrosoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdf
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهله
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 

Oracle CloudWorld 2023 - A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, and STOMP

  • 1. A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, and STOMP September 20, 2023 Las Vegas, NV Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 1
  • 2. Kuassi Mensah Director of Product Management Oracle Juarez Barbosa Junior Sr. Principal Java Developer Evangelist Oracle Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 2 Meet the speakers
  • 3. Java App Dev with Oracle Database Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 3 ORACLE JDBC & UCP
  • 4. Supporting all Java DataBase Connectivity types Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 4 ORACLE JDBC
  • 5. Reactive Java Database Connectivity (JDBC) Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 5 SYNC & ASYNC JDBC
  • 6. Support for the Latest Java Versions Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 6 JAVA & JDBC VERSIONS • Java 11 - native support, compiled with it • Java 17 - certified • JDBC Standards - 4.2 and 4.3 • GraalVM - native image instrumentation • Reactive Streams - Java Flow API support • Project Loom - Virtual Threads support • Data access is critical in mission-critical apps
  • 7. Classic Java Threads Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 7 AKA JAVA PLATFORM THREADS ⚫ Database access with blocking threads ⚫ A JDBC call blocks a thread for 100’s of milliseconds (thread-per-request style) ⚫ Thread count increases linearly with the number of JDBC calls ⚫ Performance degrades as the number of threads increases ⚫ 1 MB of stack memory per thread ⚫ Scheduling many platform threads is expensive ⚫ Preemptive scheduling vs time-slicing
  • 8. Virtual Threads Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 8 LIGHTWEIGHT THREADS ⚫ JEPs 425, 436, 444 (JDK Enhancement Proposals) ⚫ Lightweight threads that dramatically reduce the effort of writing, maintaining, and observing high-throughput concurrent applications ⚫ Enable applications written in the simple thread-per-request style to scale with near-optimal hardware utilization ⚫ Enable easy troubleshooting, debugging, and profiling of virtual threads with existing JDK tools
  • 9. Virtual Threads Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 9 LIGHTWEIGHT THREADS ⚫ JEPs 425, 436, 444 (JDK Enhancement Proposals) ⚫ Do not remove the traditional implementation of threads, and do not alter the basic concurrency model of Java ⚫ Enable existing code that uses Java threads to adopt virtual threads with minimal change ⚫ java.lang.Thread ⚫ final Boolean - isVirtual() ⚫ static Thread.Builder.OfVirtual - ofVirtual() ⚫ static Thread.Builder.OfPlatform - ofPlatform() ⚫ static Thread - startVirtualThread(Runnable task)
  • 10. Demo # 1: Virtual vs Platform Threads Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 10 RESOURCES UTILIZATION COMPARISON ⚫ Virtual Threads versus Platform Threads ⚫ JEP 425 Virtual Threads (Preview) ⚫ JEP 436 (Second Preview) ⚫ JEP 444 (Target -> JDK 21) ⚫ Runs on Java 19, 20, 21 ⚫ javac --release 19 --enable-preview ⚫ java --enable-preview ⚫ Oracle JDBC Driver 23c instrumented to support Virtual Threads ⚫ Verifiable comparison of OS/HW resources utilization (Platform Threads x Virtual Threads)
  • 11. Oracle Reactive Streams Ingestion (RSI) Library Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 11 ASYNC JDBC ⚫ Java Library for Reactive Streams Ingestion ⚫ Streaming capability: Ingest data in an unblocking, and reactive way from a large group of clients ⚫ Group records through RAC (Real App Clusters), and Shard affinity using native UCP (Universal Connection Pool) ⚫ Optimize CPU allocation while decoupling record processing from I/O ⚫ Fastest insert method for the Oracle Database through Direct Path Insert, bypassing SQL and writing directly into the DB files
  • 12. Demo # 2: Reactive Streams Ingestion (RSI) PushPublisher API Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 12 // Push Publisher for Simple Usage PushPublisher<Customer> pushPublisher = ReactiveStreamsIngestion.pushPublisher(); pushPublisher.subscribe(rsi.subscriber()); // Ad-hoc usage pushPublisher.accept( new Customer(1, "John Doe", "North")); // As a Consumer of a Stream Customer[] customers = … Stream .of(customers) .filter(c -> c.region.equals("NORTH")) .forEach(pushPublisher::accept); // As a Consumer for 3rd party Reactive Stream // Libraries eg: Reactor https://projectreactor.io/ Flux .just( new Customer(1, "John Doe", "North"), new Customer(2, "Jane Smith", "South")) .concatWithValues(new Customer(3, "Bob", "South")) .doOnComplete(() -> {System.out.println("Done!");}) .doOnCancel(() -> {System.out.println("Canceled!");}) .subscribe(pushPublisher::accept);
  • 13. Oracle R2DBC: from Synchronous to Reactive JDBC Sync, blocking Async, reactive Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 13 static String queryJdbc(java.sql.Connection connection) throws SQLException { try (java.sql.Statement statement = connection.createStatement()) { ResultSet resultSet = statement.executeQuery("SELECT * FROM CUSTOMERS"); if (resultSet.next()) return resultSet.getString(1); else throw new NoSuchElementException("Query returned zero rows"); } } static Publisher<String> queryR2dbc(io.r2dbc.spi.Connection connection) { return Flux.from(connection.createStatement( "SELECT * FROM CUSTOMERS") .execute()) .flatMap(result -> result.map(row -> row.get(0, String.class))) .switchIfEmpty(Flux.error( new NoSuchElementException("Query returned zero rows"))); }
  • 14. Demo # 3: Oracle R2DBC Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 14 REACTIVE STREAMS ⚫ Oracle Reactive Relational Database Connectivity (R2DBC) ⚫ Oracle R2DBC Driver is a Java library that supports reactive Programming with Oracle Database ⚫ It implements the R2DBC Service Provider Interface (SPI) as specified by the Reactive Relational Database Connectivity (R2DBC) ⚫ The R2DBC SPI exposes Reactive Streams as an abstraction for Remote database operations ⚫ The sample code uses Project Reactor. It could use RxJava, Akka, or any RS library ⚫ Runs on Java 11+
  • 15. Oracle JDBC supports both! Want Virtual Threads? • Oracle JDBC has been “Virtual Thread Compatible”since 21.1.0.0 Want Reactive Streams? • Oracle R2DBC 1.0.0 • Consume JDK 9 Flow interfaces implementations directly from Oracle JDBC’s Reactive Extensions Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 15 Virtual Threads or Reactive Streams?
  • 16. Virtual Threads or Reactive? Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 16 • Benefits of Virtual Threads: • Easier to read and write • Easier to debug • Integration with JDK tools • Do not alter the basic concurrency model of Java • Limitations of Virtual Threads: • Some libraries are not compatible • To be finalized in JDK 21 • JEP 425: Virtual Threads (Preview) • JEP 436: Virtual Threads (Second Preview) • JEP 444: Virtual Threads Benefits of Reactive: • Reactive Libraries (Reactor, RxJava, Akka, Vert.x) • Stream-like API with a functional style • Low-level concurrency is handled for you (locks, atomics, queues). Limitations of Reactive: • Steep learning curve • Harder to read and write • Harder to debug
  • 17. MOM - Message-Oriented Middleware A middleware component that allows communication and exchanges data (messages). It involves passing data between applications using a communication channel that carries self- contained units of information (messages). In a MOM-based communication environment, messages are sent and received asynchronously. Message-Oriented Middleware - Apache ActiveMQ Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 17
  • 18. AMQP – Advanced Message Queuing Protocol The Advanced Message Queuing Protocol (AMQP) is an open standard for passing business messages between applications or organizations. With AMQP organizations can: • Realize the savings commoditization brings; remove vendor lock-in • Connect applications on different platforms; choose the right platform for the job • Connect to business partners using a full-featured open standard; remove technical barriers to trade • Position for innovations built upon the foundation of AMQP • Security, Reliability, Interoperability, Standard, Openness Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 18
  • 19. MQTT – Message Queuing Telemetry Transport MQTT is an OASIS standard messaging protocol for the Internet of Things (IoT). It is designed as an extremely lightweight publish/subscribe messaging transport that is ideal for connecting remote devices with a small code footprint and minimal network bandwidth. Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 19
  • 20. STOMP – Simple (or Streaming) Text Oriented Messaging Protocol STOMP provides an interoperable wire format so that STOMP clients can communicate with any STOMP message broker to provide easy and widespread messaging interoperability among many languages, platforms and brokers.. Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 20
  • 21. Java Message Service (JMS) & ActiveMQ ActiveMQ • ActiveMQ is a Java-based open-source message broker which supports REST API and various wire-level protocols, such as MQTT, AMQP, and STOMP. JMS Message Producer and Consumer • Port number 5672 is the default port that ActiveMQ is listening to over the AMQP protocol when it starts up. • The sample code snippet creates an AMQP connection (publisher) that connects to ActiveMQ using the given username, password, hostname, and port number. • It also creates a topic subscriber (consumer) to receive messages that have been published to the "event" topic. Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 21
  • 22. Java Message Service (JMS) & ActiveMQ Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 22
  • 23. Demo # 4: Architecture / Project Structure ActiveMQ + AMQP + MQTT + STOMP + Java Message Service Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 23
  • 24. Learn More JDK 21 - https://openjdk.org/projects/jdk/21/ Project Loom - https://openjdk.org/projects/loom/ JEP 444 Virtual Threads - https://openjdk.org/jeps/444 Getting Started with the Java library for Reactive Streams Ingestion (RSI) - https://bit.ly/3rEiRnC High-throughput stream processing with the Java Library for Reactive Streams Ingestion (RSI), Virtual Threads, and the Oracle ATP Database - https://bit.ly/3rATCTd Oracle R2DBC Driver – https://github.com/oracle/oracle-r2dbc JDBC – https://www.oracle.com/database/technologies/appdev/jdbc.html Application Development with the Oracle Database - https://www.oracle.com/database/technologies/application-development.html Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 24
  • 25. Thank you Kuassi Mensah, Director of Product Management kuassi.mensah@oracle.com Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates 25 Juarez Barbosa Jr, Sr. Principal Java Developer Evangelist juarez.barbosa@oracle.com
  • 26. Session Survey 26 Oracle CloudWorld Copyright © 2023, Oracle and/or its affiliates