gpt4 book ai didi

java - Fabrica8、Vert.x、Karaf、Felix、Equinox、Spring DM 和 Fuse 以及 Docker 之间的区别

转载 作者:行者123 更新时间:2023-11-30 08:02:30 25 4
gpt4 key购买 nike

我正计划从我的单片服务器架构转换为微服务架构。我一直在根据我的先决条件进行一些研究。

pre-requisits:

1) Spring-Boot Application

2) Build Tool : Maven

3) Create OSGI bundles from my packages

根据我的理解,我希望我的遗产得到保留。我不希望我的项目受到太多干扰。这是我的另外两美分。

1) 容器是开发和部署微服务的好方法,运行容器的工具和平台是管理基于微服务的应用程序的好方法。

所以我热衷于寻找为 Spring-Boot 应用程序提供的容器。 Spring Environment 中发生了很多动荡。 Spring DM关闭后,出现了多个容器提供者的流入。

2) 我不寻求虚拟化,因此不需要 Docker。


主要问题

Which is the best container for OSGI Bundles in Spring?


其他问题

1) Please let me know the nuances between Fabrica8 and Apache Karaf which is apparently based on Felix or Equinox. There's new versions of Karaf coming up and competing with Fabrica8.l Which one is the best?

2) Can Docker or Vert.x. be useful with such requirements.

3) Optional. Please give more insights on the above mentioned frameworks if you will.

最佳答案

OSGI > Java 组件部署

将 Java 模块转换为组件并独立部署它们。

units of resources called bundles

Bundles can export services or run processes

bundle can be expected to have its requirements managed by the container

any valid OSGi bundle can theoretically be installed in any valid OSGi container

is lightweight in the sense that it offers very few services

has little runtime overhead

OSGi Container > Implementations > 

OSGi Release 4 Core Framework
| | |
| | |
| | |Core Open Source Implementations
| | |
| | |
| | |
| | |Apache Felix
| | |Eclipse Equinox (Eclipse IDE is built on this.)
| | |Knopflerfish
| |
| |
| |OSGi runtime environment (wraps an OSGi Core and provide developers with a simple interface to manage their OSGi applications)
| |
| |
| |
| |Apache Karaf (Felix Core)
| |Eclipse Virgo (Equinox Core)
|
|
|
|Dependency Injection Framework for OSGI
|
|
|
|Blueprint (Blueprint support the dynamic nature of OSGi services by describing how the components get instantiated and wired together)

使用明智(从最高到最低):

  1. OSGi R4 Core Bundle521 > Apache Felixorg.apache.felix » OSGI 容器下的 org.osgi.coreOSGi Service Platform Release 4 核心接口(interface)和类。

  2. Apache Karaf :> 程序集 :> 默认分发 107org.apache.karaf » OSGI 容器下的 apache-karafApache Karaf :> 程序集 :> 默认分发

  3. Apache Aries 蓝图 Bundle84org.apache.aries.blueprint » OSGI 容器下的 org.apache.aries.blueprint该 bundle 包含独立实现以及 API。它由 blueprint-api、blueprint-core 和 blueprint-cm 模块组成。

  4. Osgi4 > Apache Equinoxorg.eclipse.equinox » OSGI容器下的osgi

OSGI > 使用

Modular architecture reduces complexity

allows for better changeability

parallel development

reuse and flexibility

reducing time and expenses for development and maintenance

OSGI 容器 > 函数

install new bundles

start them

stop them

uninstall them

check their dependencies

check registered services

number of other things

executes the container's boot process

each container has a different startup environment

each container has slightly different capabilities

OSGI 容器 > bundle

container is running

each bundle consists of one or more Java packages

each bundle has a MANIGEST file

the Packages and Manifest file are bundled into a JAR

First bundle has an id of "0"

ID is used to control the bundle's lifecycle.

bundle provides a lifecycle and exported service

OSGi bundle requires an "activator"

"Activator" manages the lifecycle of the bundle

at least one of bundle contains an Activator

a feature is a set of bundles that provide a particular facility.

OSGI 容器 > 生命周期

starting

stopping

updating

or removing bundles and downloading of management policies

remotely and via an API

OSGI 容器 > 服务

services can be provided by one bundle to another bundle dynamically

service registry allows bundles to detect the addition of new services, or the removal of services, and adapt accordingly.

Apache Karaf

Karaf bundles are platform-specific because Karaf uses native-code libraries

Starts simply by unpacking the distribution bundle into any convenient directory

Apache Karaf > 命令

操作系统:列表

osgi:安装文件:/path/to/my/bundle.jar

osgi:开始[id]

osgi:停止[id]

osgi:卸载[id]

查找类 [类名]

关于java - Fabrica8、Vert.x、Karaf、Felix、Equinox、Spring DM 和 Fuse 以及 Docker 之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36913462/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com