我正在嘗試將 ActiveMQ Artemis 的 REST 介面添加到我的 Docker 容器中,為此我一直在關注官方指南。我生成一個artemis-rest.war
檔案并將其移動到我的/opt/artemis/web
檔案夾中。現在,當我導航到 時http://localhost:8161/artemis-rest/queues/queue_name
,會收到 404。當我嘗試導航到/opt/artemis/web
/console/ 或 /artemis-plugin/ 中列出的其他資源時,我至少會得到某種回應。
我的檔案夾結構如下所示:
|-- pom.xml
`-- src
`-- main
`-- webapp
`-- WEB-INF
`-- web.xml
`-- resources
`-- rest.xml
pom.xml:
<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 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.somebody</groupId>
<artifactId>artemis-rest</artifactId>
<packaging>war</packaging>
<name>ActiveMQ Artemis REST</name>
<version>2.17.0</version>
<dependencies>
<dependency>
<groupId>org.apache.activemq.rest</groupId>
<artifactId>artemis-rest</artifactId>
<version>2.17.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.activemq</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty.aggregate</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.logging</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.logmanager</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
休息.xml:
<rest-messaging>
<server-in-vm-id>0</server-in-vm-id> <!-- deprecated, use "url" -->
<use-link-headers>false</use-link-headers>
<default-durable-send>false</default-durable-send>
<dups-ok>true</dups-ok>
<topic-push-store-dir>topic-push-store</topic-push-store-dir>
<queue-push-store-dir>queue-push-store</queue-push-store-dir>
<producer-time-to-live>0</producer-time-to-live>
<producer-session-pool-size>10</producer-session-pool-size>
<session-timeout-task-interval>1</session-timeout-task-interval>
<consumer-session-timeout-seconds>300</consumer-session-timeout-seconds>
<consumer-window-size>-1</consumer-window-size> <!-- deprecated, use "url" -->
<url>vm://0</url>
</rest-messaging>
網頁.xml:
<web-app>
<listener>
<listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
</listener>
<listener>
<listener-class>org.apache.activemq.artemis.rest.integration.RestMessagingBootstrapListener</listener-class>
</listener>
<filter>
<filter-name>Rest-Messaging</filter-name>
<filter-class>org.jboss.resteasy.plugins.server.servlet.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>Rest-Messaging</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<context-param>
<param-name>rest.messaging.config.file</param-name>
<param-value>rest.xml</param-value>
</context-param>
</web-app>
我錯過了什么嗎?我還需要配置什么嗎?我會認為包括 .war 檔案就足夠了,至少可以得到某種錯誤。
uj5u.com熱心網友回復:
您需要部署artemis-rest.war
在etc/bootstrap.xml
,例如:
<web bind="http://localhost:8161" path="web">
...
<app url="artemis-rest" war="artemis-rest.war"/>
</web>
嵌入式 Web 服務器不會artemis-rest.war
因為您將其放入web
目錄而自動部署。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/385811.html