使用Thorntail映射JMS JNDI条目

时间:2019-04-04 06:25:43

标签: thorntail

我需要映射当前在WildFly中使用Thorntail运行的以下JMS配置:

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

我还没有找到定义“条目”的任何示例,但是远程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 ... 

我有点迷茫。你能帮我解决吗? 谢谢!

1 个答案:

答案 0 :(得分:1)

您几乎完全正确。您需要的是(仅显示“消息传递”部分):

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