簡體   English   中英

阿爾忒彌斯休息界面

[英]Artemis rest interface

我對 ActiveMQ Artemis REST 插件有問題。 當我啟動 Artemis 時,它會引發如下錯誤:

Caused by: ActiveMQNotConnectedException[errorType=NOT_CONNECTED message=AMQ219007: Cannot connect to server(s). Tried with all available servers.]
    at org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:798) [artemis-core-client-2.10.0.jar:2.10.0]
    at org.apache.activemq.artemis.rest.MessageServiceManager.start(MessageServiceManager.java:151) [artemis-rest-2.10.0.jar:2.10.0]
    at org.apache.activemq.artemis.rest.integration.RestMessagingBootstrapListener.contextInitialized(RestMessagingBootstrapListener.java:50) [artemis-rest-2.10.0.jar:2.10.0]

我為運行 rest 插件做了什么:

  1. 構建 artemis-rest.war

pom.xml 配置:

<?xml version="1.0" encoding="UTF-8"?>
    <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/xsd/maven-        
 4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.artemis</groupId>
<artifactId>artemis-rest</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>artemis-rest</name>


<dependencies>
    <dependency>
        <groupId>org.apache.activemq.rest</groupId>
        <artifactId>artemis-rest</artifactId>
        <version>2.10.0</version>
    </dependency>
</dependencies>

</project>
  1. 編輯的 broker.xml 文件:

     <acceptors> <acceptor name="in-vm">vm://0</acceptor> <acceptor name="artemis">tcp://localhost:61616</acceptor> </acceptors>
  2. 編輯 bootstrap.xml

     <web bind="http://0.0.0.0:8161" path="web"> <app url="activemq-branding" war="activemq-branding.war"/> <app url="artemis-plugin" war="artemis-plugin.war"/> <app url="console" war="console.war"/> <app url="artemis-rest" war="artemis-rest.war"/> </web>
  3. 並將artemis-rest.war添加到apache-artemis-2.10.0\\web目錄。

有人知道為什么它不起作用嗎?

您尚未在 web.xml 中列出您的輸入。 並且還缺少 rest-messaging.xml 文件? 你安裝了 RESTEasy 嗎? 這是要進入 WEB-INF 的 web.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>file:///WEB-INF/rest-messaging.xml</param-value>
   </context-param>
</web-app>

這是 rest-messaging-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>

還沒有讓它工作。 我有 RESTEasy 的問題。 我不知道 Artemis 2.10.1 使用什么版本。 得到這個: java.lang.RuntimeException: java.lang.RuntimeException: You must install RESTEasy as a Bootstrap Listener 並且它必須在這個類之前列出

可能很快就會尋求幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM