This document provides an overview of how to build a full stack API with DevOps integration using Quarkus in under an hour. It discusses APIs in microservice architectures, Quarkus advantages over other frameworks, and includes demos on building the first Quarkus API, adding fault tolerance, observability, logging, persistence, and security. The agenda covers asynchronous and synchronous communication patterns, MicroProfile basics, Quarkus benefits like performance and container support, JAX-RS annotations, and using various Quarkus extensions for fault tolerance, OpenTelemetry, logging, databases, Hibernate ORM with Panache, and OAuth security.
In this talk, Carlos de la Guardia shows how a Pyramid application can be deployed using a front end web server, like Apache or Nginx. He also covers how to automate deployment using buildout and a PyPI clone, and post-deployment creation of a variety of maintenance scripts and cron jobs that perform application specific tasks through Pyramid.
A link to audio of the presentation is here: http://2011ploneconference.sched.org/event/29a2f357905e4ab0fe3048c53bc1c94c
The document discusses two serverless computing platforms that support Swift - OpenWhisk and Fn.
OpenWhisk is an open source system that is event-driven, containerized, and allows chaining of actions. It is hosted on Bluemix but can be difficult to deploy elsewhere. Fn is container-native and deploys functions as containers communicating via standard input/output. Both allow simple Swift functions to be deployed and called remotely with REST APIs or command line tools. The document provides examples of writing, deploying and calling functions on each platform.
An introduction to Apache OpenWhisk, an open source, distributed Serverless platform that executes functions (fx) in response to events at any scale. OpenWhisk manages the infrastructure, servers and scaling using Docker containers so you can focus on building amazing and efficient applications.
This document discusses serverless computing and functions as a service. It defines serverless computing as building applications that do not require server management, instead being executed on demand in response to events. It describes how serverless platforms handle tasks like provisioning, maintenance, scaling and billing. Examples of serverless use cases include APIs, backend services, event-driven programming and processing unpredictable traffic. The document then discusses Apache OpenWhisk as an open source serverless platform and how it works.
Introduction to node js - From "hello world" to deploying on azure
Slide deck from my talk on Node.js.
More information is available here: http://colinmackay.scot/2014/11/29/dunddd-2014-introduction-to-node-jsfrom-hello-world-to-deploying-on-azure/
Plugin-based software design with Ruby and RubyGems
Talk at RubyKaigi 2015.
Plugin architecture is known as a technique that brings extensibility to a program. Ruby has good language features for plugins. RubyGems.org is an excellent platform for plugin distribution. However, creating plugin architecture is not as easy as writing code without it: plugin loader, packaging, loosely-coupled API, and performance. Loading two versions of a gem is a unsolved challenge that is solved in Java on the other hand.
I have designed some open-source software such as Fluentd and Embulk. They provide most of functions by plugins. I will talk about their plugin-based architecture.
Migration Spring Boot PetClinic REST to Quarkus 1.2.0
In this presentation I will introduce Quarkus and also show which were the steps followed to migrate Spring PetClinic application to Quarkus using the standard libraries : resteasy, microprofile metrics, hibernate, openapi, .... GraalVM
This document discusses implementing DevOps practices and technologies like Terraform and Ansible to create a fault-tolerant web store. It outlines creating the VM infrastructure with Terraform including load balancing. Ansible is used to install and configure software. A Jenkins pipeline is created for continuous integration and delivery. A Galera cluster provides database replication across multiple servers. Monitoring and backups are also implemented.
The document discusses various strategies for deploying and maintaining Pyramid web applications. It covers deployment options using Nginx, Apache with mod_wsgi, and Paste. It also discusses using buildout, supervisor, scripting, exception logging, backups, staging environments, caching, monitoring, and replication. The case study at the end describes how the open source KARL project deploys their Pyramid application using Nginx, HAProxy, Paste, Supervisor, buildout, and a custom package index on GitHub.
The document provides instructions on setting up a sample Spring web application using Struts, Spring, and Hibernate. It covers downloading necessary components, creating the project structure and Ant build file, writing a unit test for the persistence layer, configuring Hibernate and Spring, and creating the initial model class and mapping file. The goal is to lay the groundwork for a basic CRUD application to manage user data across the three tiers.
The document discusses several key technologies for developing Java web applications, including Java Servlet technology, WebWork framework, Spring framework, and Apache Maven build tool. It provides an overview of how each technology addresses common problems like stateless communication, business logic implementation, view generation, and data access overhead. Examples are given showing how WebWork and Spring can be used together with Maven to build a simple "Hello World" application that follows the MVC pattern and leverages dependency injection.
This document discusses strategies for making Ruby on Rails applications highly available. It covers common architectures using a single server, and moving to distributed systems. Key topics include application modularity, useful gems for asynchronous processing, database replication, session management, application deployment, configuration management, and load balancing. The conclusion emphasizes that porting Rails apps to a highly available environment requires thinking about architecture and distribution early, but is not prohibitively difficult if approached methodically.
This document summarizes a presentation on monitoring microservices with Spring Boot. It discusses evolving architectures from monolithic to microservices and challenges in microservices. It then covers different monitoring techniques like metrics, tracing and logging. It provides an overview of tools like Prometheus, Grafana, Spring Boot Admin, Eureka and Consul for monitoring microservices. Finally, it outlines hands-on labs to set up monitoring of a sample application with different tool combinations.
This document provides an overview of Java 8 including:
- Java 8 has approximately 9 million developers and Oracle supports versions 6-8.
- New features include default methods, lambda expressions, streams, and parallel processing capabilities.
- JavaScript integration allows JavaScript code to be run from Java, enabling database and other connections from JavaScript.
- Potential issues with Java 8 include more complex debugging due to lambda expressions and increased abstraction.
Go swagger tutorial how to create golang api documentation using go swagger (1)Katy Slemon
1. The document discusses how to create API documentation for Golang APIs using Swagger. It provides step-by-step instructions for setting up a demo project and generating API documentation from code comments.
2. The tutorial demonstrates configuring basic Swagger settings, defining models, and adding Swagger comments to API routes. It also covers generating clients from the Swagger documentation.
3. Creating API documentation with Swagger simplifies the documentation process and allows automatically generating clients for other frameworks from a single source of documentation.
Meteor is a reactive web application framework that uses JavaScript on both the client and server. It provides reactivity through Tracker.autorun, which re-runs functions automatically when reactive data sources change. Meteor uses DDP for client-server communication and Minimongo, a MongoDB implementation, for client-side data caching. The document provides steps for creating a basic Meteor application with user accounts, routing, schemas, forms, and template helpers to display posts data reactively.
In this talk, Carlos de la Guardia shows how a Pyramid application can be deployed using a front end web server, like Apache or Nginx. He also covers how to automate deployment using buildout and a PyPI clone, and post-deployment creation of a variety of maintenance scripts and cron jobs that perform application specific tasks through Pyramid.
A link to audio of the presentation is here: http://2011ploneconference.sched.org/event/29a2f357905e4ab0fe3048c53bc1c94c
The document discusses two serverless computing platforms that support Swift - OpenWhisk and Fn.
OpenWhisk is an open source system that is event-driven, containerized, and allows chaining of actions. It is hosted on Bluemix but can be difficult to deploy elsewhere. Fn is container-native and deploys functions as containers communicating via standard input/output. Both allow simple Swift functions to be deployed and called remotely with REST APIs or command line tools. The document provides examples of writing, deploying and calling functions on each platform.
An introduction to Apache OpenWhisk, an open source, distributed Serverless platform that executes functions (fx) in response to events at any scale. OpenWhisk manages the infrastructure, servers and scaling using Docker containers so you can focus on building amazing and efficient applications.
This document discusses serverless computing and functions as a service. It defines serverless computing as building applications that do not require server management, instead being executed on demand in response to events. It describes how serverless platforms handle tasks like provisioning, maintenance, scaling and billing. Examples of serverless use cases include APIs, backend services, event-driven programming and processing unpredictable traffic. The document then discusses Apache OpenWhisk as an open source serverless platform and how it works.
Introduction to node js - From "hello world" to deploying on azureColin Mackay
Slide deck from my talk on Node.js.
More information is available here: http://colinmackay.scot/2014/11/29/dunddd-2014-introduction-to-node-jsfrom-hello-world-to-deploying-on-azure/
Talk at RubyKaigi 2015.
Plugin architecture is known as a technique that brings extensibility to a program. Ruby has good language features for plugins. RubyGems.org is an excellent platform for plugin distribution. However, creating plugin architecture is not as easy as writing code without it: plugin loader, packaging, loosely-coupled API, and performance. Loading two versions of a gem is a unsolved challenge that is solved in Java on the other hand.
I have designed some open-source software such as Fluentd and Embulk. They provide most of functions by plugins. I will talk about their plugin-based architecture.
Migration Spring Boot PetClinic REST to Quarkus 1.2.0Jonathan Vila
In this presentation I will introduce Quarkus and also show which were the steps followed to migrate Spring PetClinic application to Quarkus using the standard libraries : resteasy, microprofile metrics, hibernate, openapi, .... GraalVM
This document discusses implementing DevOps practices and technologies like Terraform and Ansible to create a fault-tolerant web store. It outlines creating the VM infrastructure with Terraform including load balancing. Ansible is used to install and configure software. A Jenkins pipeline is created for continuous integration and delivery. A Galera cluster provides database replication across multiple servers. Monitoring and backups are also implemented.
The document discusses various strategies for deploying and maintaining Pyramid web applications. It covers deployment options using Nginx, Apache with mod_wsgi, and Paste. It also discusses using buildout, supervisor, scripting, exception logging, backups, staging environments, caching, monitoring, and replication. The case study at the end describes how the open source KARL project deploys their Pyramid application using Nginx, HAProxy, Paste, Supervisor, buildout, and a custom package index on GitHub.
The document provides instructions on setting up a sample Spring web application using Struts, Spring, and Hibernate. It covers downloading necessary components, creating the project structure and Ant build file, writing a unit test for the persistence layer, configuring Hibernate and Spring, and creating the initial model class and mapping file. The goal is to lay the groundwork for a basic CRUD application to manage user data across the three tiers.
The document discusses several key technologies for developing Java web applications, including Java Servlet technology, WebWork framework, Spring framework, and Apache Maven build tool. It provides an overview of how each technology addresses common problems like stateless communication, business logic implementation, view generation, and data access overhead. Examples are given showing how WebWork and Spring can be used together with Maven to build a simple "Hello World" application that follows the MVC pattern and leverages dependency injection.
This document discusses strategies for making Ruby on Rails applications highly available. It covers common architectures using a single server, and moving to distributed systems. Key topics include application modularity, useful gems for asynchronous processing, database replication, session management, application deployment, configuration management, and load balancing. The conclusion emphasizes that porting Rails apps to a highly available environment requires thinking about architecture and distribution early, but is not prohibitively difficult if approached methodically.
Spring boot microservice metrics monitoringOracle Korea
This document summarizes a presentation on monitoring microservices with Spring Boot. It discusses evolving architectures from monolithic to microservices and challenges in microservices. It then covers different monitoring techniques like metrics, tracing and logging. It provides an overview of tools like Prometheus, Grafana, Spring Boot Admin, Eureka and Consul for monitoring microservices. Finally, it outlines hands-on labs to set up monitoring of a sample application with different tool combinations.
Spring Boot - Microservice Metrics MonitoringDonghuKIM2
마이크로서비스 아키텍쳐에서의 분산된 서비스간의 모니터링 방법을 소개합니다.
- Microservice Monitoring with Service Discovery (Eureka) Spring Boot Admin
- Microservice Monitoring with Service Discovery (Consul), Prometheus, Grafana
This presentation was given at the Boston Django meetup on November 16, and surveyed several leading PaaS providers including Stackato, Dotcloud, OpenShift and Heroku.
For each PaaS provider, I documented the steps necessary to deploy Mezzanine, a popular Django-based CMS and blogging platform.
At the end of the presentation, I do a wrap-up of the different providers and provide a comparison matrix showing which providers have which features. This matrix is likely to go out-of-date quickly because these providers are adding new features all the time.
Similar to Meetup 2022 - APIs with Quarkus.pdf (20)
The document provides an overview of the Kubernetes Gateway API, which enables robust traffic management in Kubernetes clusters. It describes key concepts like GatewayClasses, Gateways, and Routes that make up the Gateway API model. The API allows infrastructure providers to implement ingress controllers, cluster operators to manage traffic, and application developers to define routing rules in a standardized way. It aims to improve on the Ingress resource and support multiple protocols like HTTP, TLS, and TCP in an integrated manner. There are now over a dozen implementations of the Gateway API by popular API gateways and service meshes.
describing and comparing different protocols when it come to deploying apis on edge computing devices.
5 different categories are analyzed and 7 protocols are examined
This document provides an overview of authorization models and how Open Policy Agent (OPA) can be used for authorization in microservices. It defines common authorization models like ACL, DAC, MAC, RBAC, and ABAC and provides examples of how they work. It then discusses how OPA uses a declarative policy language called Rego to specify authorization policies and can offload policy decision making through REST APIs. The document demonstrates integrating OPA by evaluating policies and managing policies. It shows a demo of OPA enforcing a simple salary access policy.
How easy (or hard) it is to monitor your graph ql service performanceRed Hat
- GraphQL performance monitoring can be challenging as queries can vary significantly even when requesting the same data. Traditional endpoint monitoring provides little insight.
- Distributed tracing using OpenTracing allows tracing queries to monitor performance at the resolver level. Tools like Jaeger and plugins for Apollo Server and other GraphQL servers can integrate tracing.
- A demo showed using the Apollo OpenTracing plugin to trace a query through an Apollo server and resolver to an external API. The trace data was sent to Jaeger for analysis to help debug performance issues.
This document outlines a presentation on digital identity and self-sovereign identity (SSI) in the post-Covid world. The presentation discusses how the pandemic has increased digital payments and online activity. It then covers current challenges around digital identity theft, consent management under PSD2 and GDPR. The bulk of the presentation introduces SSI as a portable, lifetime digital identity model not dependent on centralized authorities. It explains the underlying decentralized identifiers (DIDs) and verifiable credentials of SSI. Practical uses of SSI are demonstrated for applying for jobs and loans. Potential benefits are seen for identity verification, preventing phishing, and improving user onboarding processes.
How do async ap is survive in a rest world Red Hat
The document discusses how asynchronous APIs can survive in a REST-based world. It describes how Async APIs use an event-driven approach compared to the request-reply model of REST. The AsyncAPI specification aims to describe event-driven APIs similarly to how OpenAPI describes REST APIs. The document demonstrates how Async and REST APIs can work together using an example setup with an API gateway, manager, and message broker to connect an HTML page and Node.js client via published topics.
The case for a unified way of speaking to thingsRed Hat
The presentation introduces the Web of Things (WoT) model for connecting IoT devices. It discusses challenges with current IoT frameworks and protocols and outlines the WoT approach of using standardized descriptions and APIs to allow IoT devices and services to communicate independently of their implementations. The WoT model consists of four layers - access, find, share, and compose. A Thing Description format and REST and WebSocket APIs are presented. A demo is shown and the presentation concludes by discussing challenges, opportunities, and key takeaways regarding the WoT approach.
The document discusses best practices for test-driven development (TDD) and API contract testing. It introduces TDD foundations like writing tests before code and the red-green-refactor cycle. Tools for TDD like mocking frameworks and behavior-driven development are presented. The concepts of stubs, mocks, and service virtualization are explained. An API contract-first approach is advocated to facilitate automated testing. The key benefits of TDD and resources for further learning are summarized.
This document discusses using streaming APIs like Kafka in production environments. It begins with an introduction to Kafka including topics, partitions, brokers, producers and consumers. It then discusses how Kafka can be used with microservices for improved decoupling and scalability with an event-driven approach. Kafka Streams and streaming APIs are presented as a way to include streaming data. Several use cases from industries like travel, transportation, finance and news are described that demonstrate how companies leverage Kafka for applications such as predictive maintenance, real-time data processing, and serving as a single source of truth. The presentation concludes with a demo of a simple microservices application using Kafka.
This document provides a brief analysis and comparison of the demographics, economy, history, language, status, and any referendums of three regions: Scotland, Catalunya, and Lombardia. For each region, facts are presented on population statistics, GDP contributions, unemployment rates, historical rulers, official and minority languages, autonomy status within their respective countries, and any independence referendums that have been held.
This document provides an overview of service mesh and the Istio observability tool Kiali. It begins with an introduction to service mesh and what problems it addresses in microservices architectures. Istio is presented as an open source service mesh that provides traffic management, observability, and policy enforcement for microservices. Kiali is specifically discussed as a tool for visualizing the topology and traffic flow of services in an Istio mesh. The rest of the document provides an agenda and then a live demo of Kiali's features using the Bookinfo sample application on Istio.
The document provides an overview of microservices and service meshes, and uses Istio as an example service mesh implementation. It discusses how Istio allows microservices to be developed independently while providing capabilities like discovery, load balancing, resilience, metrics and tracing through lightweight proxies. The document then demonstrates what happens at each step of a request's lifecycle as it travels through an application protected by Istio's service mesh. Specifically, it shows how Istio components like Pilot, Envoy, Mixer and Citadel work together to provide control, observability and security for microservices.
The document discusses API design best practices. It begins with an overview of API lifecycles and introduces two approaches to API design: design first and code first. It then outlines several design principles for APIs, including treating APIs as products and focusing on developer experience. The document also discusses OpenAPI Specification 3.0 and tools for API design like Stoplight, Restlet, and Apicurio. It concludes with complementary tools for API testing, mocking, and design.
Lucamaf1 2949-db--winter2013-accomplishmentRed Hat
Luca Mattia Ferrari successfully completed an online introduction to databases course from January to March 2013. He scored 53.5% on quizzes, 37% on exercises, and 30% on exams, for a total scaled score of 217.5 out of 293. The course covered lectures, quizzes, exercises and exams on databases. Jennifer Widom, a professor at Stanford University, thanked Ferrari for his participation in their online education experiment.
Luca Mattia Ferrari completed an online Game Theory course provided by Stanford University through Coursera. The course covered notions of equilibrium, dominance, normal and extensive form games, and games of complete and incomplete information. It was taught by Professor Yoav Shoham and Professor Matthew Jackson of Stanford University's Computer Science and Economics departments respectively. The statement of accomplishment does not confer a Stanford grade, credit, or degree.
statement of accomplishment - heterogeneous parallel programmingRed Hat
Luca Mattia Ferrari completed the University of Illinois at Urbana-Champaign's online Coursera course "Heterogeneous Parallel Programming". The course covered data parallel execution models, locality, parallel algorithm patterns, and scalable programming using joint MPI-CUDA. As part of the course, students had to complete 5 quizzes and 5 programming assignments. The statement does not confer credit from the University of Illinois.
React and Next.js are complementary tools in web development. React, a JavaScript library, specializes in building user interfaces with its component-based architecture and efficient state management. Next.js extends React by providing server-side rendering, routing, and other utilities, making it ideal for building SEO-friendly, high-performance web applications.
React Native vs Flutter - SSTech SystemSSTech System
Your project needs and long-term objectives will ultimately choose which of React Native and Flutter to use. For applications using JavaScript and current web technologies in particular, React Native is a mature and trustworthy choice. For projects that value performance and customizability across many platforms, Flutter, on the other hand, provides outstanding performance and a unified UI development experience.
Attendance Tracking From Paper To DigitalTask Tracker
If you are having trouble deciding which time tracker tool is best for you, try "Task Tracker" app. It has numerous features, including the ability to check daily attendance sheet, and other that make team management easier.
Lots of bloggers are using Google AdSense now. It’s getting really popular. With AdSense, bloggers can make money by showing ads on their websites. Read this important article written by the experienced designers of the best website designing company in Delhi –
An MVP (Minimum Viable Product) mobile application is a streamlined version of a mobile app that includes only the core features necessary to address the primary needs of its users. The purpose of an MVP is to validate the app concept with minimal resources, gather user feedback, and identify any areas for improvement before investing in a full-scale development. This approach allows businesses to quickly launch their app, test its market viability, and make data-driven decisions for future enhancements, ensuring a higher likelihood of success and user satisfaction.
Efficient hot work permit software for safe, streamlined work permit management and compliance. Enhance safety today. Contact us on +353 214536034.
https://sheqnetwork.com/work-permit/
Discover the Power of ONEMONITAR: The Ultimate Mobile Spy App for Android Dev...onemonitarsoftware
Unlock the full potential of mobile monitoring with ONEMONITAR. Our advanced and discreet app offers a comprehensive suite of features, including hidden call recording, real-time GPS tracking, message monitoring, and much more.
Perfect for parents, employers, and anyone needing a reliable solution, ONEMONITAR ensures you stay informed and in control. Explore the key features of ONEMONITAR and see why it’s the trusted choice for Android device monitoring.
Share this infographic to spread the word about the ultimate mobile spy app!
Ansys Mechanical enables you to solve complex structural engineering problems and make better, faster design decisions. With the finite element analysis (FEA) solvers available in the suite, you can customize and automate solutions for your structural mechanics problems and parameterize them to analyze multiple design scenarios. Ansys Mechanical is a dynamic tool that has a complete range of analysis tools.
Are you wondering how to migrate to the Cloud? At the ITB session, we addressed the challenge of managing multiple ColdFusion licenses and AWS EC2 instances. Discover how you can consolidate with just one EC2 instance capable of running over 50 apps using CommandBox ColdFusion. This solution supports both ColdFusion flavors and includes cb-websites, a GoLang binary for managing CommandBox websites.
Sami provided a beginner-friendly introduction to Amazon Web Services (AWS), covering essential terms, products, and services for cloud deployment. Participants explored AWS' latest Gen AI offerings, making it accessible for those starting their cloud journey or integrating AI into coding practices.
1. Building a full stack API with
DevOps integrated
or how to build a complete u-service from scratch in an hour
Sergio Gutierrez
EMEA Senior Solution Architect
Luca Ferrari
EMEA Senior Solution Architect
2. Agenda
➔ APIs in Microservice Architecture patterns
➔ Quarkus as a runtime engine (advantages)
➔ Development approach: API Contract first / Code first
➔ Demos
1. building your first quarkus api
2. adding fault tolerance
3. observing your u-service
4. adding logging to your service
5. adding persistence
6. adding security (developer friendly way)
3. APIs in Microservice Architecture patterns
● Synchronous Communication
● Asynchronous Message-based Communication
3
4. MicroProfile and Microservice Basics
● Java for microservices-based architecture
● Portability across multiple runtimes
The following components are fundamental for developers creating microservices:
● Contexts and Dependency Injection for Java (CDI) specification
● Jakarta RESTful Web Services (JAX-RS)
● JSON processing
Using all three components, you can build basic RESTful web services in a straightforward and declarative
manner.
4
5. Quarkus advantage
Advantages compared to other Java-based cloud-native frameworks, Quarkus
offers the following benefits:
● Faster response times, in general.
● Lower memory usage.
● Higher throughout in reactive routes.
● Full container image support.
● Compliance to MicroProfile conformance tests.
5
7. Reviewing the JAX-RS Specification
JAX-RS, formerly known as Java API for RESTful Web Services, is a specification that provides support for creating web
services following the Representational State Transfer (REST) architectural pattern.
Annotation Description
@Path The relative path for a class or method.
@GET, @PUT,@POST, @DELETE,
@HEAD
The HTTP request type of a method.
@Produces, @Consumes The Internet media types for the content consumed as the request parameters or
produced as the response. The javax.ws.rs.core.MediaType class specifies the
allowed values.
Table 2.1. JAX-RS Class and Method-Level Annotations Summary
7
8. Demo #1
How do you get started with this??
Solution: https://quarkus.io/guides/getting-started and git clone https://github.com/quarkusio/quarkus-quickstarts.git
● Bootstrapping an application
● Creating a JAX-RS endpoint
● Injecting beans
● Functional tests
● Packaging of the application
How to create a Hello World API with Quarkus app
8
9. Demo #1
Bootstrapping the project
quarkus create app org.acme:getting-started
--extension='resteasy-reactive'
Different options to create your project:
● Maven
● https://code.quarkus.io/
● Quarkus CLI
mvn io.quarkus.platform:quarkus-maven-plugin:2.14.1.Final:create
-DprojectGroupId=org.acme
-DprojectArtifactId=getting-started
-Dextensions='resteasy-reactive'
Quarkus CLI installation https://quarkus.io/guides/cli-tooling
9
10. Demo #1
Quarkus scaffold project generated
It generates the following in ./getting-started:
● the Maven structure
● an org.acme.GreetingResource resource exposed on /hello
● an associated unit test
● a landing page that is accessible on http://localhost:8080 after starting the application
● example Dockerfile files for both native and jvm modes in src/main/docker
● the application configuration file
10
11. Demo #2
What if my backend fails?!
The recovery procedures defined by the fault tolerance specification include the following:
● Bulkhead (@org.eclipse.microprofile.faulttolerance.Bulkhead) Limits the workload for a microservice to
avoid failures caused by concurrency or service overload.
● Retry policy(@org.eclipse.microprofile.faulttolerance.Retry) Defines the conditions for retrying a failing
execution.
● Timeout(@org.eclipse.microprofile.faulttolerance.Timeout) Defines the maximum execution time
before interrupting a request.
● Circuit breaker (@org.eclipse.microprofile.faulttolerance.CircuitBreaker)Supports a fail-fast approach
if the system is suffering from an overload or is unavailable.
● Fallback(@org.eclipse.microprofile.faulttolerance.Fallback) Executes an alternative method if the
execution fails for the annotated method.
Source: https://quarkus.io/guides/smallrye-fault-tolerance 11
12. Demo #2
Fault tolerance - Fallback
@Fallback(fallbackMethod = "fallbackRecommendations")
public List<Coffee> recommendations(int id) {
...
}
public List<Coffee> fallbackRecommendations(int id) {
LOGGER.info("Falling back to
RecommendationResource#fallbackRecommendations()");
// safe bet, return something that everybody likes
return
Collections.singletonList(coffeeRepository.getCoffeeById(1));}
@Fallback(fallbackMethod = "fallbackRecommendations")
> quarkus dev
http://localhost:8080/coffee/2/recommendations
quarkus create app org.acme:microprofile-fault-tolerance-quickstart
--extension='smallrye-fault-tolerance,resteasy-reactive-jackson
--no-code
12
The application built in this guide simulates a simple
backend for a gourmet coffee e-shop. It
implements a REST endpoint providing information
about coffee samples we have on store.
In case of a timeout, the page will display a single
recommendation that we hardcoded in our fallback
method fallbackRecommendations(), rather than
two recommendations returned by the original
method.
13. Demo #3
I want to observe my u-services!
quarkus create app org.acme:opentelemetry-quickstart
--extension='resteasy-reactive,quarkus-opentelemetry'
--no-code
Source: https://quarkus.io/guides/opentelemetry
REST application to demonstrate distributed tracing.
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-opentelemetry</artifactId>
</dependency>
13
14. Demo #3
Open Telemetry
The OpenTelemetry Collector offers a
vendor-agnostic implementation of how to
receive, process and export telemetry
data. It removes the need to run, operate,
and maintain multiple agents/collectors.
This works with improved scalability and
supports open-source observability data
formats (e.g. Jaeger, Prometheus, Fluent
Bit, etc.) sending to one or more
open-source or commercial back-ends.
14
16. Demo #4
How can I do simple troubleshooting?
As most developers would say, the first tool to troubleshoot when something goes wrong is logging (everything if
possible).
Quarkus offers JBoss Log Manager and the JBoss Logging facade for this purpose and all the logging configuration can
be done inside your application.properties
Applications and components may use any of the following APIs for logging, and the logs will be merged:
● JDK java.util.logging (also called JUL)
● JBoss Logging
● SLF4J
● Apache Commons Logging
It is possible to change the output format of the console log when for example the output of the application is captured
by a service which can, for example, process and store the log information for later analysis (JSON Logging Format)
16
Source:
https://quarkus.io/guides/rest-json
https://quarkus.io/guides/logging
17. Demo #4
Configuring Logging
We will start from a more comple REST example here
https://github.com/quarkusio/quarkus-quickstarts/tree/main/rest-json-quickstart
This includes: 2 REST resources, Ser/Des, a simple HTML frontend
It also already includes a Logging Filter automatically injected based on ContainerRequestFilter
(https://www.baeldung.com/jersey-filters-interceptors )
We will add more logging at the Resource level, to log as WARN if we add Tomato as a fruit
import org.jboss.logging.Logger;
…
private static final Logger LOG = Logger.getLogger(FruitResource.class);
…
if(fruit.name.equalsIgnoreCase("tomato")){
LOG.warn("Tomato is not a fruit");
}
17
18. Demo #5
Where to persist data?
Not every information can be stored only in memory, thinking about your amazon order and payment?
Quarkus provides many options to persist data, we will be highlighting the most important:
● Dev Service for DBs: when testing or running in dev mode Quarkus can provide you with a zero-config database
out of the box. Depending on your database type you may need Docker installed in order to use this feature.
Dev Services is supported for the following databases: DB2 (container) (requires license acceptance), Derby (in-process), H2 (in-process), MariaDB
(container), Microsoft SQL Server (container) (requires license acceptance), MySQL (container), Oracle Express Edition (container), PostgreSQL
(container)
● Simple datasource setup: a datasource can be either a JDBC datasource, a reactive one or both. It all depends on
how you configure it and which extensions you added to your project. To define a datasource, start by defining
the kind in the application.configuration. By using a JDBC driver extension and setting the kind in the
configuration, Quarkus resolves the JDBC driver automatically, so you don’t need to configure it yourself
● Support of both Hibernate ORM with Panache:
Hibernate ORM is an object–relational mapping tool for the Java programming language. It provides a framework for mapping an object-oriented domain
model to a relational database.
Panache is a Quarkus-specific library that simplifies the development of your Hibernate-based persistence layer. Similar to Spring Data JPA, Panache
handles most of the repetitive boilerplate code for you. Its implementations of the repository and the active record pattern provide methods to create,
update, and remove records, perform basic queries, and define and execute your own queries.
18
19. Demo #5
REST with persistence on Postgres container
We will start from a full example which cover everything we have seen in the previous slide
https://github.com/quarkusio/quarkus-quickstarts/tree/main/hibernate-orm-panache-quickstart
This includes: 1 Hibernate with Panache entity, the corresponding REST resource, all implementing the repository pattern
Panache’s repositories provide you with a set of standard methods to find entities by their primary key. You can also persist, update and remove an
entity. The only thing you need to do to get this functionality is to define an entity-specific repository class. It has to implement the
PanacheRepository or PanacheRepositoryBase interface.
We will just modify the configuration so that the db dev service port is fixed, and we can connect to it:
quarkus.datasource.devservices.port=45432
19
Source:
https://quarkus.io/guides/databases-dev-services
https://quarkus.io/guides/datasource
https://quarkus.io/guides/hibernate-orm-panache
https://quarkus.io/blog/quarkus-devservices-testcontainers-podman/
20. Demo #6
Somebody is bothering me with Security!
As you don’t want to expose your first valuable service publicly without any protection, you might want to think about
security.
Quarkus offers a full range of security options for your services:
● Basic and Form HTTP authentication
● WebAuthn is an authentication mechanism that replaces passwords. When you write a service for registering new users, or
logging them in, instead of asking for a password, you can use WebAuthn, which replaces the password.
● Quarkus also provides mutual TLS (mTLS) authentication so that you can authenticate users based on their X.509
certificates.
● OpenID Connect (OIDC) is an identity layer that works on top of the OAuth 2.0 protocol. OIDC enables client applications to
verify the identity of a user based on the authentication performed by the OIDC provider and to retrieve basic information
about that user. You can also verify ID and access JWT tokens by using the refreshable JSON Web Key (JWK) set or you can
introspect them remotely. However, opaque (binary) tokens can only be introspected remotely.
20
Source: https://quarkus.io/guides/security
21. Demo #6
OIDC security with Security Dev Services
https://github.com/quarkusio/quarkus-quickstarts/tree/main/security-openid-connect-quickstart
You can use the Quarkus OpenID Connect (OIDC) extension to secure your JAX-RS applications using Bearer Token
Authorization. The Bearer Tokens are issued by OIDC and OAuth 2.0 compliant authorization servers, such as Keycloak.
In this example, we are using a very simple microservice which offers two endpoints:
/api/users/me
/api/admin
These endpoints are protected and can only be accessed if a client is sending a bearer token along with the request,
which must be valid (e.g.: signature, expiration and audience) and trusted by the microservice.
The /api/users/me endpoint can be accessed by any user with a valid token. As a response, it returns a JSON document
with details about the user where these details are obtained from the information carried on the token.
The /api/admin endpoint is protected with RBAC (Role-Based Access Control) where only users granted with the admin
role can access. At this endpoint, we use the @RolesAllowed annotation to declaratively enforce the access constraint.
21
Source:
https://quarkus.io/guides/security-openid-connect
22. Demo #6
BONUS!
In case you can’t find that specific protocol or standard to integrate with inside the standard quarkus libraries,
You can explore the quarkiverse
For example in the case of security we have community support for MFA: https://github.com/quarkiverse/quarkus-mfa
22
Source:
https://quarkus.io/blog/quarkiverse/