我在 Karaf 4.2.9 中安装了 artemis 功能。经纪人创建得很好。我在jmx看到的。
但是我找不到如何在 Karaf 中安装 Artemis Web 控制台。
我不认为 ActiveMQ Artemis Web 控制台有可供 Karaf 安装的功能。
您可以创建自己的具有 Artemis 控制台功能的存储库。
这是我的模板:
<feature name="artemis-console" version="${artemis.version}">
<feature prerequisite="true">wrap</feature>
<bundle>mvn:org.apache.activemq/artemis-plugin/${artemis.version}/war</bundle>
<bundle>mvn:org.apache.activemq/activemq-branding/${artemis.version}/war</bundle>
<bundle>wrap:mvn:org.apache.activemq/artemis-console/${artemis.version}/war$Bundle-SymbolicName=ActiveMQ Artemis Console&Bundle-Version=${artemis.version}&Web-ContextPath=/console&Bundle-ClassPath=.,WEB-INF/classes,${artemis.embedded.list}</bundle>
</feature>
如您所见,该模板包含占位符 ${artemis.version} 和 ${artemis.embedded.list}。 ${artemis.embedded.list} 必须包含此 artemis-console 包中的所有嵌入式 jar。你可以手动列出它们,但我已经制作了maven项目,所以我可以轻松更改artemis版本:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>my.own.group</groupId>
<artifactId>custom-features</artifactId>
<version>${camel.version}</version>
<dependencies>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-console</artifactId>
<version>${artemis.version}</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>${project.basedir}/main/feature</directory>
<includes>
<include>custom-features.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<excludeTypes>pom</excludeTypes>
<excludeTransitive>true</excludeTransitive>
<outputDirectory>${basedir}/target/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>artemis-console</id>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<exportAntProperties>true</exportAntProperties>
<target>
<macrodef name="listzipcontents">
<attribute name="zipfile" />
<attribute name="property" />
<attribute name="prefix" />
<sequential>
<zipfileset src="@{zipfile}" id="content" includes="@{prefix}/*"/>
<pathconvert property="@{property}" pathsep="," dirsep="/">
<zipfileset refid="content" />
<map from="@{zipfile}:" to="" />
</pathconvert>
</sequential>
</macrodef>
<listzipcontents zipfile="${basedir}/target/lib/artemis-console-${artemis.version}.war"
property="artemis.embedded.list" prefix="WEB-INF/lib" />
<echo>${artemis.embedded.list}</echo>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
结果 - artemis-console 2.32.0 的此功能,包括长嵌入式 jar 列表:
<feature name="artemis-console" version="2.32.0">
<feature prerequisite="true">wrap</feature>
<bundle>mvn:org.apache.activemq/artemis-plugin/2.32.0/war</bundle>
<bundle>mvn:org.apache.activemq/activemq-branding/2.32.0/war</bundle>
<bundle>wrap:mvn:org.apache.activemq/artemis-console/2.32.0/war$Bundle-SymbolicName=ActiveMQ Artemis Console&Bundle-Version=2.32.0&Web-ContextPath=/console&Bundle-ClassPath=.,WEB-INF/classes,WEB-INF/lib/checker-qual-3.33.0.jar,WEB-INF/lib/commons-codec-1.15.jar,WEB-INF/lib/commons-io-2.11.0.jar,WEB-INF/lib/commons-logging-1.2.jar,WEB-INF/lib/error_prone_annotations-2.18.0.jar,WEB-INF/lib/failureaccess-1.0.1.jar,WEB-INF/lib/guava-32.0.1-jre.jar,WEB-INF/lib/hawtio-core-2.17.7.jar,WEB-INF/lib/hawtio-system-2.17.7.jar,WEB-INF/lib/hawtio-util-2.17.7.jar,WEB-INF/lib/httpclient-4.5.14.jar,WEB-INF/lib/httpcore-4.4.16.jar,WEB-INF/lib/j2objc-annotations-2.8.jar,WEB-INF/lib/jolokia-core-1.7.2.jar,WEB-INF/lib/json-20231013.jar,WEB-INF/lib/json-simple-1.1.1.jar,WEB-INF/lib/jsr305-3.0.2.jar,WEB-INF/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar</bundle>
</feature>