使用 Thorntail 映射 JMS JNDI 条目

Mapping a JMS JNDI Entries with Thorntail

我需要在 WildFly with Thorntail 中 运行 映射以下 JMS 配置:

 <jms-queue name="ExampleQueue" entries="queue/exampleQueue java:/jboss/exported/jms/queue/exampleQueue"/>

我还没有找到任何定义 "entries" 的示例,但我需要它用于远程 JMS 客户端。所以我想出了这个配置,但是它不起作用:

thorntail:
  management:
    security-realms:
      ApplicationRealm:
        in-memory-authentication:
          users:
            bob:
              password: Password1!
        in-memory-authorization:
          users:
            jmsuser:
              roles:
              - guest  
  messaging-activemq:
    servers:
      default:
        jms-queues:
          exampleQueue: {}
            entries: queue/exampleQueue java:/jboss/exported/jms/queue/exampleQueue

导致:

Caused by: java.lang.RuntimeException: while parsing a block mapping
 in 'reader', line 18, column 11:
              exampleQueue: {}
              ^
expected <block end>, but found BlockMappingStart
 in 'reader', line 19, column 13:
                entries: queue/exampleQueue java ... 

我有点迷路了。你能帮我修一下吗? 谢谢!

您答对了几乎。你需要的是(只显示消息部分):

messaging-activemq:
  servers:
    default:
      jms-queues:
        exampleQueue:
          entries:
          - queue/exampleQueue
          - java:/jboss/exported/jms/queue/exampleQueue

(我觉得queue/exampleQueue也许应该是jms/queue/exampleQueue,但不是很确定。)

有关完整的工作示例,您可以查看例如https://github.com/rhoar-qe/thorntail-test-suite/tree/master/javaee/messaging-remote