Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
002c6a6
Create index.adoc
ttelang Feb 21, 2024
19e1913
Update index.adoc
ttelang Feb 21, 2024
7ce7960
Update index.adoc
ttelang Feb 22, 2024
693aead
Merge pull request #1 from ttelang/patch-1
ttelang Feb 22, 2024
eeb29ba
Merge pull request #2 from ttelang/patch-2
ttelang Feb 22, 2024
09916ad
Update index.adoc
ttelang Feb 22, 2024
b19c677
Create README.md
ttelang Feb 22, 2024
550fc8e
Add files via upload
ttelang Feb 22, 2024
9859cba
Rename MicroProfile e-Commerce Application.drawio.png to FigureFM-1.png
ttelang Feb 22, 2024
befd8ea
Merge pull request #3 from ttelang/ttelang-preface
ttelang Feb 22, 2024
1243d46
Rename FigureFM-1.png to figureFM-1.png
ttelang Feb 22, 2024
47ac1c1
Update index.adoc
ttelang Feb 22, 2024
7068fe9
Merge pull request #4 from ttelang/ttelang-preface
ttelang Feb 22, 2024
84306ab
Merge branch 'eclipse:main' into main
ttelang Feb 25, 2024
868b9f6
Adding Mindmap image
ttelang Feb 25, 2024
045f2e8
Create chapter01/chapter01.adoc
ttelang Feb 25, 2024
daa9b34
Update chapter01.adoc
ttelang Mar 1, 2024
9eee901
Update chapter01/chapter01.adoc
ttelang Mar 1, 2024
fa2be64
Update chapter01.adoc
ttelang Mar 1, 2024
4a46396
Update chapter01.adoc
ttelang Mar 1, 2024
9e9a446
Update chapter01.adoc
ttelang Mar 1, 2024
2a329c6
Update chapter01.adoc
ttelang Mar 1, 2024
c5600c2
Update chapter01.adoc
ttelang Mar 1, 2024
f21ccd1
Update chapter01.adoc
ttelang Mar 1, 2024
f69f64d
Update chapter01.adoc
ttelang Mar 1, 2024
c704f11
Fix for https://github.com/eclipse/microprofile-tutorial/pull/5#discu…
ttelang Mar 1, 2024
70609ee
Fix for https://github.com/eclipse/microprofile-tutorial/pull/5#discu…
ttelang Mar 1, 2024
e3b5a67
Fix for https://github.com/eclipse/microprofile-tutorial/pull/5#discu…
ttelang Mar 1, 2024
6244454
Merge pull request #5 from ttelang/main
ttelang Mar 1, 2024
8593aff
Fix for https://github.com/eclipse/microprofile-tutorial/pull/5#discu…
ttelang Mar 1, 2024
36600b5
Fix for https://github.com/eclipse/microprofile-tutorial/pull/5#discu…
ttelang Mar 1, 2024
0bcf66b
Fix for https://github.com/eclipse/microprofile-tutorial/pull/5#discu…
ttelang Mar 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
279 changes: 279 additions & 0 deletions chapter01/chapter01.adoc

Large diffs are not rendered by default.

270 changes: 270 additions & 0 deletions images/FM-1 MicroProfile e-Commerce Application.drawio

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions images/README.md
Original file line number Diff line number Diff line change
@@ -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 |
Binary file added images/figure1-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/figureFM-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
152 changes: 152 additions & 0 deletions index.adoc
Original file line number Diff line number Diff line change
@@ -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_`.
|===