### Table of Contents
* [Summary](#summary)
* [Requirements](#requirements)
* [Configuration](#configuration)
* [Project contents](#project-contents)
* [Run](#run)
* [Notices](#notices)
### Summary
The dukes-liberty application provides simple examples demonstrating various features of the [MicroProifle](https://microprofile.io) programming model using the [Open Liberty](https://openliberty.io) application server.
### Requirements
* [Maven](https://maven.apache.org/install.html)
* Java 8: Any compliant JDK should work.
* [Java 8 JDK from Oracle](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
* [Java 8 JDK from IBM (AIX, Linux, z/OS, IBM i)](http://www.ibm.com/developerworks/java/jdk/)
* [AdoptOpenJDK 8 (OpenJ9 or Hotspot JVM)](https://adoptopenjdk.net/index.html)
### Configuration
The application is configured to provide various technologies and features. These capabilities are provided through dependencies in the pom.xml file and Open Liberty features enabled in the server config file found in `src/main/liberty/config/server.xml`.
### Project contents
The context root (dukes-liberty) is set in the `src/main/webapp/WEB-INF/ibm-web-ext.xml` file. The ports are set in the pom.xml file.
* **MicroProfile** : The [MicroProfile project](http://microprofile.io/) is an open community with the aim of optimizing Enterprise Java for a microservices architecture. MicroProfile will be evolving with guidance from the community. For the complete feature documentation, see the [MicroProfile programming model section](https://www.ibm.com/support/knowledgecenter/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/rwlp_microprofile.html) in the IBM Knowledge Center. Or, for more hands-on MicroProfile learning, check out the [Open Liberty Guides](https://openliberty.io/guides/?search=microprofile). If you want to share your thoughts you can post straight to the [MicroProfile Google group](https://groups.google.com/forum/#!forum/microprofile).
### Run
To build and run the application:
1. `mvn clean install`
1. `mvn liberty:run-server` (ctrl-c ends the server)
* Dukes-Liberty Endpoint: http://localhost:9080/dukes-liberty
* MicroProfile Health Endpoint: http://localhost:9080/health
* OpenAPI UI: http://localhost:9080/openapi/ui/
* Health API Endpoint: http://localhost:9080/dukes-liberty/api/health
* Hello API Endpoint: http://localhost:9080/dukes-liberty/api/hello
### Endpoints
The context root (dukes-liberty) is set in the `src/main/webapp/WEB-INF/ibm-web-ext.xml` file. The ports are set in the pom.xml file.
MicroProfile implementations
需积分: 0 52 浏览量
更新于2023-12-29
收藏 63KB ZIP AIGC 举报
MicroProfile 实现是Java生态体系中的一个关键组成部分,它旨在为构建微服务提供轻量级、高效率的框架。MicroProfile 是由多个企业级Java技术供应商联合推出的一个开放源代码项目,目标是优化Java Enterprise Edition (Java EE) 以适应云原生环境的需求。这个项目的主要目的是减轻开发者的负担,让他们能更轻松地创建高性能、低资源消耗的分布式系统。
在Java世界中,Java EE曾是开发企业级应用的标准平台,提供了诸如Servlet、JMS、EJB、JPA等丰富的API和服务。然而,随着微服务架构的兴起,开发者发现Java EE过于庞大且冗余,不完全适合微服务的快速迭代和独立部署需求。因此,MicroProfile应运而生,它吸取了Java EE的精华,去除了不必要的复杂性,为微服务开发提供了更精简、更现代化的框架。
MicroProfile的实现通常包括以下几个核心规范:
1. **OpenTracing**: 这个规范允许开发者在分布式系统中实现跟踪,以帮助诊断和优化性能。通过集成像Jaeger或Zipkin这样的追踪系统,可以轻松地理解微服务之间的交互。
2. **Health Check**: 提供了一种机制来检查微服务的健康状态,确保它们在运行时能够正常工作。这对于监控和自动扩展策略至关重要。
3. **Config**: 提供了一种统一的方式来管理微服务的配置,使得配置可以在运行时动态更新,无需重启服务。
4. **OpenAPI**: 基于Swagger,用于定义和描述RESTful API,使得API文档与代码同步,提高了开发效率和API一致性。
5. **Fault Tolerance**: 为微服务提供了故障容忍能力,包括重试、断路器、超时、降级等功能,有助于提高系统的容错性和稳定性。
6. **MicroProfile REST Client**: 提供了一个简单的API来调用其他微服务,简化了跨服务通信。
7. **JWT Token**: 提供了安全的身份验证和授权机制,支持JSON Web Token,增强了微服务的安全性。
MicroProfile的实现包括多个版本,每个新版本都添加了更多功能和改进。常见的实现有IBM Liberty、Payara Micro、TomEE、WildFly Swarm等,这些实现都遵循MicroProfile的规范,并提供了各自独特的附加功能和服务。
在实际开发中,选择合适的MicroProfile实现取决于项目的具体需求和团队的技术栈。例如,如果你的团队已经熟悉Apache Tomcat,那么可以选择TomEE作为基础;如果对IBM的产品有偏好,那么IBM Liberty可能是一个好选择。
MicroProfile 实现是Java开发者构建云原生应用的重要工具,它简化了微服务的开发和管理,提升了系统的可扩展性和可靠性。通过选择合适的MicroProfile实现,开发者可以更高效地利用Java的技术栈,实现微服务架构的优势。

zero2100
- 粉丝: 178
最新资源
- 地基处理-第4章--排水固结法.ppt
- [海南]度假区建筑岩土工程勘察报告.doc
- 第二章-多细胞动物的胚胎发育--2013PDF.pdf
- 提高TM710水分仪校准准确度(新)4.3.pptx
- [浙江]住宅楼塔吊安装、拆除施工方案(tc5613).doc
- 人防工程工程量清单计价模式下工程造价控制的几点思考.doc
- 高处作业吊篮安全技术培训.ppt
- -技术方案-20151222(0002).docx
- 公司供应商考察报告(模块).doc
- 济莱高速某段破损山体整治工程施工组织设计.doc
- 浅谈油田地面工程造价的确控.doc
- 《ACCESS入门教程》.ppt
- [计算机示范课的新方法]计算机病毒是指什么.doc
- 构筑物防水与防腐施工安全技术交底.doc
- 张家口张北西110kV变电站新建工程清册(初设品审后二次改通信改).doc
- 分产品概要需求文档规范.doc