java - 在fuse Fabric中部署camel项目

标签 java jbossfuse fuseesb

以下是我想知道的在熔断结构环境中部署 Camel 项目的事情。 我已经创建了捆绑 jar 。这些捆绑 jar 在非结构环境中运行良好。即当我将这些 jar 移动到 jboss-fuse 上的部署目录时,它工作得很好。 当相同的 jar 移动到子容器时,它不起作用。我为结构环境设置的内容如下:

创建的 Fabric 容器:

fabric:create --new-user fadmin --new-user-password maskerkey --generate-zookeeper-password --resolver localip

子容器:

fabric:container-create-child root node 2

我应该如何将相同的 bundle 部署到子容器?当我部署捆绑 jar 时,我看到以下异常:

org.osgi.framework.BundleException: Unresolved constraint in bundle BUNDLE_NAME [139]: Unable to resolve 139.0: missing requirement [139.0] osgi.wiring.package; (osgi.wiring.package=org.apache.activemq.camel.component)

最佳答案

当你有fabric环境时,你不应该使用deploy/目录。这是为了原型(prototype)设计的目的。

当您使用以下方法创建子容器时:

fabric:container-create-child root node 2

您现在有两个名为 node1node2 的容器

OSGi 中的捆绑只是一个增强 JAR。

(Karaf)功能 bundle (以及可能的配置)的集合,因此您可以更轻松地安装多个 bundle 。

(Fabric)配置文件是 bundle 、功能、配置和资源(大致)的声明,因此您可以更轻松地安装多个(karaf)功能。

您的错误消息意味着尚未安装可以满足您的 bundle 要求的 bundle 。更准确地说,您缺少导出 org.apache.activemq.camel.component 包的包。

如果您查看 Fuse 提供的配置文件和功能,您将看到:

JBossFuse:karaf@root> features:info activemq-camel
Description of activemq-camel 5.11.0.redhat-vvv feature
----------------------------------------------------------------
Feature has no configuration
Feature has no configuration files
Feature depends on:
  activemq-client 5.11.0.redhat-vvv
  camel-spring [2.17,3)
  camel-jms [2.17,3)
  camel [2.17,3)
Feature contains followed bundles:
 mvn:org.apache.activemq/activemq-camel/5.11.0.redhat-vvv start-level=50
Feature has no conditionals.

(其中 vvv 是给定的 Fuse 版本)。

现在您必须创建您的个人资料:

profile-create myprofile

为其添加activemq-camel功能:

profile-edit --feature activemq-camel myprofile

将您的 bundle 添加到其中:

profile-edit --bundle mvn:your-groupId/your-artifactId/your-version

并将这个配置文件分配给一个容器(containers)

container-add-profile node1 myprofile

关于java - 在fuse Fabric中部署camel项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46768173/

相关文章:

java - Spring Boot可执行jar和外部配置文件

java - 从列表中查找最常见的对象

java - Eclipselink 未将更新保存到实体内的字段

java - 线程池运行web服务请求的合理线程数

java - featuresBoot 在 Fuse 7 (Karaf 4.2) 中不工作

java - 无法将camel服务部署到jboss Fuse

java - 为什么 Activemq-web-console 无法在 Fuse Servicemix 4.3.0-fuse-02-00 上运行?

osgi - JBoss Fuse 中的 WAR 文件部署

xml - Camel xml 到 xml 转换 xslt 仍然是可行的方法吗?

jboss - JRebel 可以与 JBoss Fuse 一起使用吗?