diff --git a/chapter01/chapter01.adoc b/chapter01/chapter01.adoc new file mode 100644 index 00000000..d35d8fcb --- /dev/null +++ b/chapter01/chapter01.adoc @@ -0,0 +1,279 @@ += Chapter 1: Introduction to MicroProfile + +== Introduction + +This introductory chapter provides a comprehensive overview of the MicroProfile platform, setting the stage for subsequent chapters in this tutorial. It aims to familiarize you with the fundamentals of the MicroProfile platform, its need, and benefits. Finally, we will discuss its place in the broader context of enterprise Java development. + +== Topics to be covered: +- What is MicroProfile +- Need for MicroProfile +- MicroProfile Specifications +- Current MicroProfile Implementations +- Architecture Philosophy +- Benefits of MicroProfile +- Relationship with Jakarta EE specification + +== What is MicroProfile + +link:https://microprofile.io/[MicroProfile] is an open-source specification that enhances enterprise Java technologies for microservices development. It provides a set of APIs and specifications for building modern, scalable, resilient, and efficient microservices-based applications. The primary goal of MicroProfile is to simplify the development for Java developers, enabling them to create applications optimized for cloud-native-development. + +MicroProfile was initiated in June 2016 by a collaboration of industry leaders, Java community members, and individual contributors. In the following year, the project was transitioned to the link:https://www.eclipse.org/[Eclipse Foundation] to enhance the project's openness and vendor-neutral stance. Now, MicroProfile has become a key framework for extending Java in the cloud-computing domain, offering a comprehensive suite of APIs tailored for developing microservices in a cloud-native ecosystem. + +The *MicroProfile Working Group* currently comprises of the following members: + +Committer Representative (Year 2024) + + * Emerson Castañeda + +Java user groups + + * Atlanta Java User Group (AJUG) + * Association of the German Java User Groups (iJUG) + +Corporate Members + + * Hunan AsiaInfo Anhui + * IBM + * Fujitsu + * Red Hat + * Primeton + * Payara + * Microsoft + * Tomitribe + * Oracle + +This collective effort demonstrates MicroProfile's commitment to evolving Java enterprise development for the modern cloud environment, leveraging the expertise of its community. + +== Need for MicroProfile + +The MicroProfile Specification was developed to address the following requirements: + +- *Microservices Architecture Adoption*: The industry shift towards microservices architecture has brought several advantages, including improved flexibility, scalability, and speed of deployment. However, it also introduced several new challenges for developers due to the added complexities. These include ensuring seamless integration between microservices, securing each microservice individually as well as interactions between them, managing performance and efficiency, designing microservices to be fault-tolerant and resilient to failures, ensuring data consistency across services, managing configurations across multiple environments and managing various independently deployable components. To address these challenges, MicroProfile provides a simplified and optimized set of APIs designed to build and deploy Java-based microservices applications. + +- *Limitations of Traditional Enterprise Java*: Traditional enterprise Java frameworks, like Java EE (now Jakarta EE), were often seen as too monolithic and heavyweight for microservices while evolving too slowly. It led to a demand for a more streamlined and microservices-focused framework. MicroProfile fills this gap by providing a lightweight alternative optimized for microservices development. + +- *Cloud-Native Application Development*: The rise of cloud-native applications necessitated new features such as external configuration, health checks, and fault tolerance, which existing Java standards did not adequately address. MicroProfile bridges these gaps left, making it easier for developers to create resilient, scalable, and manageable microservices for cloud-native application development using Java. + +- *Community-Driven Innovation*: The rapid pace of technological change in microservices necessitated a collaborative platform for innovation. MicroProfile, backed by community and vendor support, promotes rapid evolution to meet these demands. + +- *Vendor Neutrality and Interoperability*: There was a need for a framework that could provide standardization across different implementations and environments, ensuring compatibility and avoiding vendor lock-in. + +- *Focus on Simplicity and Productivity*: Developers needed a simple, easy-to-understand framework that increased productivity by reducing boilerplate code and focusing on essential microservice functionalities. Well-defined standards and patterns eliminate the need to reinvent the wheel, allowing developers to focus on microservices logic. + +- *Support for familiar programming model*: MicroProfile was founded with support for Jakarta JSON Processing, Jakarta JSON Binding, Jakarta RESTful Web Services, and Jakarta Contexts and Dependency Injection (CDI) to define the core programming model and accelerate adoption. + +- *Lightweight and Resilient Services*: With the microservices architecture, there's a need for frameworks that support the development of lightweight, resilient, and independently deployable services, which are essential for microservices. + +- *Rapid Adaptation to New Trends*: The technology landscape, especially around microservices, is constantly evolving. A framework like MicroProfile, which is community-driven and rapidly evolving, can adapt quickly to these changes, continually incorporating new practices and technologies, including: + ** *Streaming APIs and Reactive Programming Model*: To facilitate non-blocking communication and data processing, enhancing system responsiveness and scalability. + ** *API-First Development (Open API)*: Emphasizing the design and documentation of microservices with an API-first approach, promoting interoperability and clear service contracts. + ** *Eventual Consistency and Long Running Actions (LRA)*: Addressing the challenges of data consistency in distributed systems without compromising system performance. + +- *Enhanced Observability and Monitoring*: Microservices architectures complicate application monitoring and observability. A framework with built-in support for these capabilities simplifies the management of distributed services. + +== MicroProfile Specifications + +MicroProfile specifications are divided into two main categories: Platform and Standalone. + +:figure-caption: Figure +.MicroProfile Specifications +image::http://microprofile.io/wp-content/uploads/2023/10/microprofile_release_6.1.png[MicroProfile 6.1] + +=== MicroProfile Platform Component Specifications + +The MicroProfile Platform Specification is the core set of MicroProfile specifications designed to provide the foundational functionalities needed for microservices development. These specifications solve specific microservices challenges, including configuration, fault tolerance, health checks, metrics, and security. The table below provides a list of platform specifications of MicroProfile along with their descriptions: + +[options="header"] +|======================= +|Specification |Description +|link:https://microprofile.io/specifications/microprofile-config/[Config] | Provides an easy-to-use and flexible system for application configuration. +|link:https://microprofile.io/specifications/microprofile-fault-tolerance/[Fault Tolerance]| Implements patterns like Circuit Breaker, Bulkhead, Retry, Timeout, and Fallback for building resilient applications. +|link:https://microprofile.io/specifications/microprofile-jwt-auth/[JWT Authentication]| Defines a standard for using OpenID Connect (OIDC) based JSON Web Tokens(JWT) for role-based access control(RBAC) of microservices endpoints for secure communication. +|link:https://microprofile.io/specifications/microprofile-metrics/[Metrics] | Define custom application metrics and expose platform metrics on a standard endpoint using a standard format to external monitoring systems. +|link:https://microprofile.io/specifications/microprofile-health/[Health] | Allows applications to expose their health and readiness to perform operations to the underlying platform, which is crucial for automated recovery in cloud environments. +|link:https://microprofile.io/specifications/microprofile-open-api/[Open API] | Facilitates the generation of OpenAPI documentation for RESTful services, making API discovery and understanding easier. +|link:https://microprofile.io/specifications/microprofile-telemetry/[Telemetry]| Provides a unified set of APIs, libraries, and tools for collecting, processing, and exporting telemetry data (metrics, traces, and logs) from cloud-native applications and services. +|link:https://microprofile.io/specifications/microprofile-rest-client[Rest Client]| Defines a type-safe approach to invoke RESTful services over HTTP(S), simplifying the development of Rest clients. +| link:https://jakarta.ee/specifications/coreprofile/10/[Jakarta EE Core Profile 10] | An optimized Jakarta EE platform designed specifically for developing microservices and cloud-native Java applications with a reduced set of specifications for a lighter runtime footprint. +|======================= + +=== Standalone (Outside Umbrella) Specifications + +Standalone specifications address more advanced needs that every microservices application may not require. They allow for innovation and experimentation in areas that are evolving or where there’s a need to address niche concerns without burdening the core platform with additional complexity. The table below provides a list of standalone specifications of MicroProfile along with their descriptions: + +[options="header"] +|======================= +|Specification |Description +| link:https://microprofile.io/specifications/microprofile-context-propagation/[Context Propagation] | Defines a way to propagate context between threads and managed executor services. Ensure that the context is consistent during executing asynchronous tasks or across different services. +| link:https://microprofile.io/specifications/microprofile-graphql/[GraphQL] | Provides a layer on top of Jakarta EE that allows the creation of GraphQL services. This specification makes it easier to build APIs, enabling clients to request exactly the data they need and nothing more. +| link:https://microprofile.io/specifications/microprofile-lra/[Long Running Actions (LRA)]| Focuses on providing a model for developing services that participate in long-running processes, ensuring consistency and reliability without necessarily locking data. +| link:https://microprofile.io/specifications/microprofile-reactive-messaging/[Reactive Messaging]| Aims to facilitate building applications that communicate via reactive streams, enabling the development of event-driven, responsive, and resilient microservices. +| link:https://microprofile.io/specifications/microprofile-reactive-streams-operators/[Reactive Streams Operators]| Provides a way to process data streams in a reactive manner, allowing for non-blocking system design and improving the efficiency of data processing in microservices. +| link:https://microprofile.io/specifications/microprofile-opentracing/[Open Tracing]| Integrates distributed tracing by defining a way for services to trace requests across service boundaries, improving observability. +|======================= + +== MicroProfile Implementations +Below is the list of MicroProfile Implementations, each offering a platform for building and running microservices-based applications: + +- link:https://www.payara.fish/products/payara-micro/[Payara Micro^] +- link:https://tomee.apache.org/[Apache TomEE^] +- link:https://openliberty.io/[Open Liberty^] +- link:https://github.com/fujitsu/launcher[Launcher^] +- link:https://quarkus.io/[Quarkus^] +- link:https://www.wildfly.org/[WildFly^] +- link:https://helidon.io/[Helidon^] + +== Architecture Philosophy + +The overall goal of MicroProfile architecture is to provide a lightweight enterprise-grade framework tailored for building cloud-native applications and enabling developers to build and deploy microservices with Java easily: + +- *Simplicity*: MicroProfile APIs are designed to be simple and easy to use. They avoid unnecessary complexity and focus on providing the essential functionality for building microservices. + +- *Modularity*: Its modular approach allows developers to use only what they need, reducing the overhead typically associated with enterprise frameworks. + +- *Standards-based*: MicroProfile is based on open standards and specifications, ensuring compatibility and consistency across different implementations. + +- *Community-driven*: It encourages active participation from the Java community for continuous evolution. + +- *Vendor-Neutral*: MicroProfile is vendor-neutral. It’s supported by several industry players, ensuring that no single company controls its direction. + +- *Focus on Cloud-Native Applications*: The architecture is specifically tailored for cloud environments. MicroProfile integrates with a number of cloud-native technologies, such as Kubernetes and Istio. This makes it easy to deploy and manage MicroProfile applications in cloud environments. + +- *Reactive programming*: MicroProfile supports reactive programming, which is a style of programming that is well-suited for building microservices. Reactive applications are responsive and scalable, and they can handle high volumes of concurrent requests. + +:figure-caption: Figure +.Architecture Philosophy of MicroProfile +image::/images/figure1-2.png[Architecture Philosophy of MicroProfile] + +=== Benefits of MicroProfile +MicroProfile offers several benefits, making it a compelling choice for developing microservices, especially in Java-centric environments. These benefits include: + +- *Optimized for Microservices*: MicroProfile is designed explicitly for creating microservices, offering APIs that cater to the unique challenges of this architectural style. + +- *Cloud-Native Focus*: The framework includes features such as externalized configuration, health checks, and metrics, which are essential for building and operating cloud-native applications effectively. MicroProfile is inherently designed for cloud-native applications. + +- *Open Source and Standards-Based*: As an open-source framework based on open standards, MicroProfile facilitates interoperability and reduces the risk of vendor lock-in. + +- *Enhanced Productivity, Rapid Development and Deployment*: MicroProfile simplifies microservices development with a set of standard APIs. With its focus on simplicity and productivity, MicroProfile helps speed up the development and deployment of microservices by providing essential functionalities and reducing boilerplate code. + +- *Community-Driven Innovation*: Being community-driven, MicroProfile evolves quickly, incorporating new trends and best practices in microservices development. MicroProfile is backed by a strong Java community, ensuring continuous improvement and support. + +- *Vendor Neutrality*: Being vendor-neutral, MicroProfile is supported by a wide range of industry players, which ensures a broad choice of tools and platforms for developers. + +- *Compatibility with Jakarta EE*: MicroProfile is complementary to Jakarta EE, whether using MicroProfile implementations that support a small subset of Jakarta EE (such as Core Profile) or implementations that extend the full Jakarta EE Platform implementations with MicroProfile. + +- *Lightweight and Modular*: It provides a lightweight model compared to traditional enterprise Java frameworks. Its modularity allows developers to use only the necessary components, reducing the application's footprint and overhead. + +- *Scalability*: The framework supports the development of scalable applications, essential for microservices that handle varying loads efficiently. + +- *Enhanced Resilience*: MicroProfile includes specifications for fault tolerance patterns like retries, circuit breakers, timeouts, and bulkheads, which are crucial for building resilient services that can withstand network and service failures. + +- *Security Features*: MicroProfile's JWT Authentication provides a standardized way to secure microservices, making it easier to implement authentication and authorization. + +- *Ease of Testing*: With its lightweight nature and support for advanced features like Rest Client, MicroProfile simplifies the testing of microservices, both in isolation and in integration scenarios. + +== Relationship with Jakarta EE specification + +Jakarta EE is an open specification with more than 40 component specifications to address a wide array of needs of enterprise Java development. MicroProfile complements this by providing a baseline platform definition that optimizes enterprise Java for microservices architecture and delivers application portability across multiple compatible runtimes. Many Jakarta EE implementations that target a broad array of applications supplement Jakarta EE with MicroProfile to better support microservices. Their coexistence allows developers to harness the strength of both platforms, thereby facilitating a more versatile and adaptive approach to modern enterprise and cloud-native application development. MicroProfile strategically leverages Java EE developers' existing skill sets, enabling them to transition and adapt to microservices development with minimal learning curve. This ensures that developers can easily design and implement microservices architecture, enhancing productivity and facilitating the creation of cloud-native applications. Later in this tutorial, we will explore how MicroProfile API extends Jakarta EE’s capability to address microservices-specific challenges. + +NOTE: MicroProfile and Jakarta EE are complementary technologies. Both platforms enable developers to stay at the forefront of cloud-native application development. + +== Conclusion + +In this section, we explored the MicroProfile platform in detail, laying the foundation for understanding how it revolutionizes the development of microservices using Java. We started by defining MicroProfile, emphasizing its role as an open-source specification tailored for microservices development. Key contributions from industry leaders and community members have positioned MicroProfile as a pivotal technology in the Java ecosystem, especially for cloud-native application development. We delved into the essential specifications of MicroProfile, each playing a critical role in addressing specific challenges in microservices development, from configuration management to service resilience. As we move forward in this tutorial, we will delve deeper into each specification and discover how to implement MicroProfile in real-world Java applications effectively. + +[[glossary]] +== Glossary + +[[microservices]] +Microservices:: An architectural style for building applications as a collection of small, independent services. Each service focuses on a specific business capability and communicates with other services through well-defined APIs. + +[[apis]] +APIs (Application Programming Interfaces):: A set of definitions and protocols that specify how software components interact with each other. + +[[cloud-native-development]] +Cloud-native development:: An approach to building and running applications that are specifically designed for the cloud environment. It involves using technologies and practices that leverage the benefits of cloud platforms, such as scalability, elasticity, and pay-as-you-go pricing. + +[[eclipse-foundation-working-group]] +Eclipse Foundation Working Group:: A collaborative group of industry leaders and Java community members who actively contribute to the of development of Eclipse projects like MicroProfile within the Eclipse Foundation framework. + +[[jakarta-ee]] +Jakarta EE:: Jakarta EE (formerly Java Platform, Enterprise Edition, or Java EE) is a set of specifications, extending Java Platform, Standard Edition, or Java SE with specifications for enterprise features such as web services, database persistence, asynchronous messaging and more. + +[[external-configuration]] +External Configuration:: A technique in application development where configuration data is separated from the application code, allowing the application's behavior to be adjusted without changing the code, especially useful in cloud-native and microservices architectures. + +[[health-checks]] +Health Checks:: Mechanisms used in microservices architectures to continuously check the status of an application or service to ensure it is functioning correctly and available to users. + +[[fault-tolerance]] +Fault Tolerance:: The ability of a system to continue operating in the event of the failure of some of its components. This feature is critical for maintaining high availability and reliability in microservices architectures. + +[[vendor-neutrality]] +Vendor Neutrality:: The principle of designing software products and standards not controlled by any single vendor, promoting user interoperability and choice. + +[[interoperability]] +Interoperability:: The ability of a software to exchange and make use of information across different platforms and services. + +[[json-p]] +JSON-P (JSON Processing):: A Jakarta EE (formerly Java EE) API that enables parsing, generating, transforming, and querying JSON data. It facilitates the processing of JSON data within the Java programming environment. Currently it is known as Jakarta JSON Processing. + +[[json-b]] +JSON-B (JSON Binding):: A Jakarta EE (formerly Java EE) API for binding Java objects to JSON messages and vice versa, streamlining the serialization and deserialization process. It allows custom mappings to handle complex conversion scenarios efficiently. Currently it is known as Jakarta JSON Binding. + +[[jax-rs]] +JAX-RS (Java API for RESTful Web Services):: A Jakarta EE API for creating web services according to the REST architectural pattern in Java, using annotations to simplify development. It enables the easy creation and management of resources via standard HTTP methods. It is currently known as Jakarta RESTful Web Services. + +[[cdi]] +CDI (Contexts and Dependency Injection):: A Jakarta EE API for enterprise-grade dependency injection, offering type-safe mechanisms, context lifecycle management, and a framework for decoupling application components. It enhances modularity and facilitates the development of loosely coupled, easily testable applications. + +[[boilerplate-code]] +Boilerplate Code:: A piece of code that must be included in many places with little or no alteration. + +[[lightweight-services]] +Lightweight Services:: Services designed to consume minimal computing resources, enhancing performance and efficiency, particularly relevant in a microservices architecture. + +[[resilient-services]] +Resilient Services:: Services built to recover quickly from failures and continue operating. It is critical for maintaining the reliability of microservices-based applications. + +[[observability]] +Observability:: The ability to measure the internal state of a system by examining its outputs, crucial for understanding the performance and behavior of microservices. + +[[monitoring]] +Monitoring:: The practice of tracking and logging the performance and status of applications and infrastructure, essential for maintaining system health in microservices environments. + +[[circuit-breaker]] +Circuit Breaker:: A fault tolerance mechanism that prevents a failure in one service from causing system-wide failure, by temporarily disabling failing services. + +[[bulkhead]] +Bulkhead:: A pattern that isolates failures in one part of a system from the others, ensuring that parts of an application can continue functioning despite issues elsewhere. + +[[retry]] +Retry:: A simple fault tolerance mechanism where an operation is attempted again if it fails initially, based on predefined criteria. + +[[timeout]] +Timeout:: A mechanism to limit the time waiting for a response from a service, helping to avoid resource deadlock situations in distributed systems. + +[[fallback]] +Fallback:: A fault tolerance mechanism that provides an alternative solution or response when a primary method fails. + +[[rbac]] +Role-Based Access Control (RBAC):: A method of restricting system access to authorized users based on their roles within an organization. + +[[kubernetes]] +Kubernetes:: An open-source platform for automating deployment, scaling, and operations of application containers across clusters of hosts. + +[[istio]] +Istio:: An open platform to connect, manage, and secure microservices, providing an easy way to create a network of deployed services with load balancing, service-to-service authentication, and monitoring. + +[[reactive-programming]] +Reactive Programming:: A programming paradigm oriented around data flows and the propagation of change, enabling the development of responsive and resilient systems. + +[[distributed-tracing]] +Distributed Tracing:: A method for monitoring applications, especially those built using a microservices architecture, by tracking the flow of requests and responses across services. + +[[lra]] +Long Running Actions (LRA):: A model for managing long-duration, distributed transactions across microservices without locking resources. + +[[reactive-streams]] +Reactive Streams:: An initiative to provide a standard for asynchronous stream processing with non-blocking back pressure. diff --git a/images/FM-1 MicroProfile e-Commerce Application.drawio b/images/FM-1 MicroProfile e-Commerce Application.drawio new file mode 100644 index 00000000..2f72954c --- /dev/null +++ b/images/FM-1 MicroProfile e-Commerce Application.drawio @@ -0,0 +1,270 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/README.md b/images/README.md new file mode 100644 index 00000000..f4f79d20 --- /dev/null +++ b/images/README.md @@ -0,0 +1,5 @@ +The following table list images and their corresponding source files. + +| Export | Source | Tool | +----------|---------|-------- +| FigrueFM-1.png | FM-1 MicroProfie e-Commerce.drawio | https://www.draw.io | diff --git a/images/figure1-2.png b/images/figure1-2.png new file mode 100644 index 00000000..979617be Binary files /dev/null and b/images/figure1-2.png differ diff --git a/images/figureFM-1.png b/images/figureFM-1.png new file mode 100644 index 00000000..35baaea3 Binary files /dev/null and b/images/figureFM-1.png differ diff --git a/index.adoc b/index.adoc new file mode 100644 index 00000000..4f084383 --- /dev/null +++ b/index.adoc @@ -0,0 +1,152 @@ += MicroProfile API Tutorial +:doctype: book + +---- +MicroProfile API Tutorial + +Version: 6.1 + +Status: Draft +---- + +== Legal + +Copyright (c) 2024 Contributors to the Eclipse Foundation + +See the NOTICE file(s) distributed with this work for additional +information regarding copyright ownership. + +Licensed under the Apache License, Version 2.0 (the "License"); +You may not use this file except in compliance with the License. +You may obtain a copy of the License at + +---- + http://www.apache.org/licenses/LICENSE-2.0 +---- + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. + +== Preface + +=== About this Tutorial + +In this tutorial, you will learn how to use the features of the MicroProfile Platform by building a microservices-based e-commerce application named "MicroProfile e-Commerce". The tutorial will cover using MicroProfile APIs such as Config, REST Client, JWT, Fault Tolerance, and Metrics to build efficient, scalable, and resilient microservices for cloud-native applications. We aim to provide a comprehensive overview and hands-on knowledge about using MicroProfile APIs. + +=== Who is this Tutorial for + +This tutorial caters to software professionals, from beginners to senior developers, engineering managers, and architects, to adeptly utilize MicroProfile in real-world projects. + +=== What will be Covered + +First, an overview of the MicroProfile project is presented, followed by detailed sections on each specification, complete with thoroughly tested and updated code samples. + +=== Project + +In this tutorial, you will learn to build a microservices-based e-commerce application called "MicroProfile e-Commerce". The app will demonstrate the use of MicroProfile APIs for developing an application based on microservices and cloud-native architecture. + +It would include multiple microservices, each serving a different purpose and highlighting different aspects of MicroProfile. Java developers can use this adaptation as a practical case study to implement MicroProfile APIs in real-world applications. + +The MicroProfile e-Commerce application compirses of multiple microservices, among the key ones are as below: + +- **Product Catalog**: This service acts as the central repository for all product-related information, including detailed descriptions, pricing, and inventory levels. It provides APIs for fetching product details efficiently for the other microservices, such as the Shopping Cart. This microservice is vital for updating product data, ensuring data consistency and accuracy across the e-Commerce platform. + +- **The Shopping Cart**: This service allows users to add or remove products from their shopping cart. It communicates with the Product Catalog Microservice to access up-to-date product information. It handles the storage and management of cart items for each user, including the calculation of cart totals with applicable discounts or promotions. This microservice plays interfaces with the Checkout microservice to initiate the order processing. + +- **User Management**: This service is responsible for user account management, handles registration, login, and account updates securely using JWT tokens. It is essential for personalizing the user experience and safeguarding user information. + +- **Order Processing**: This service manages the entire order process, from collecting shipping information and confirming order details to initiating payment processing. This microservice ensures a seamless transition from shopping to order completion. + +- **Payment**: Dedicated to processing payments, this microservice interacts with external payment gateways to securely handle transactions. It receives payment instructions from the Checkout microservice, executes the payment process, and confirms transaction outcomes. This microservice is crucial for ensuring financial transactions are conducted securely and efficiently, maintaining the integrity of the payment process. + +- **Inventory**: This service is dedicated to monitoring and managing inventory levels. It tracks product availability, updates inventory in real-time as sales occu, and provides restocking alerts. By integrating with the Product Catalog and Checkout microservices, it ensures that product availability is accurately reflected on the platform and that orders are only placed for in-stock items. This microservice is crucial for maintaining optimal inventory levels and preventing stockouts, thereby enhancing the customer shopping experience. + +- **Shipping**: This microservice is responsible for managing the logistics of order delivery. It receives order details and shipping information from the Order Processing Microservice, ensuring that orders are shipped to customers in a timely and efficient manner. The Shipping Microservice plays a critical role in the post-purchase customer experience, managing expectations and communication regarding order delivery. + +:figure-caption: Figure +.MicroProfile e-Commerce Application +image::images/figureFM-1.png[MicroProfile e-Commerce Application] + +As you can see in the above figure, together these microservices form a robust and flexible e-Commerce application architecture, enabling scalable, efficient, and secure online shopping experiences. + +=== Downloading the Code +The code examples in this tutorial are available at this link:https://www.github.com/ttelang/microprofile-examples[repo] (TODO: to be changed). + +=== Prerequisites +MicroProfile use the Java Platform, and are usually written in the Java programming language. +All the examples in this tutorial are written in Java. +If you're new to Java, spend some time getting up to speed on the language and platform; +a good place to start is https://dev.java/learn/[dev.java/learn]. + +Each topic in this tutorial provides some background information, +but in general, +we assume you have a basic understanding of RESTful Web Services. + +=== Learning Objectives + +. Understanding MicroProfile and Its Ecosystem: + +.. Gain a solid understanding of what MicroProfile is and its role in modern cloud-native application development. + +.. Learn about the evolution of MicroProfile and its relationship with Jakarta EE. + +.. Understand how MicroProfile facilitates building microservices. + +. Hands-On Experience with Key MicroProfile APIs: + +.. Learn to implement Config, Health, Metrics, JWT Authentication, Fault Tolerance, Rest Client, and other MicroProfile APIs. + +.. Understand how to apply these APIs in practical scenarios through the Duke's Forest application case study. + +. Building Resilient and Scalable Services: + +.. Master techniques for developing resilient services using fault tolerance and health checks. + +. Securing Microservices: + +.. Learn the intricacies of securing microservices using MicroProfile JWT and Security API. + +. Effective Data Management in Microservices: + +.. Understand the role of JPA and JSON-B in MicroProfile for handling data operations in microservices. + +. Monitoring and Tracing: + +.. Implement monitoring strategies using MicroProfile Metrics. + +.. Learn to trace microservice interactions with OpenTracing for enhanced observability. + +. Collaborative Learning and Community Engagement: + +.. Participate in Q&A sessions, forums, and interactive discussions. + +.. Engage with the MicroProfile community for continuous learning and staying updated with the latest trends. + +By the end of this tutorial readers will gain the knowledge and skills necessary to design, develop, and deploy robust microservices using MicroProfile, preparing them for advanced roles in software development and architecture in cloud-native environments. + +== Conventions +[width="99%",cols="20%,38%,37%"] +|=== +|Convention |Meaning |Example + +|*Boldface* |Boldface type indicates a term defined in text or graphical user interface elements associated with an action. |A *cache* is a copy stored locally. + +From the *File* menu, choose *Open Project*. + +|`Monospace` |Monospace type indicates the names of files and directories, commands within a paragraph, URLs, code in examples, text that appears on the screen, or text that you enter. |Edit your `.login` file. + +Use `ls -a` to list all files. + +`_machine_name_% you have mail.` + +|_Italic_ |Italic type indicates book titles, emphasis, or placeholder variables for which you supply particular values. |Read Chapter 6 in the _User's Guide_. + +Do _not_ save the file. + +The command to remove a file is `rm _filename_`. +|===