0

我同时使用 JBoss AS 4 (JBoss MQ) 和 JBoss AS 7 (Hornet Q)。我想配置存储队列的位置。在 JBoss AS 4 /jboss/server/default/deploy 的目的地,我有 default-ds.xml,我认为这是在数据库中存储队列的配置:

默认DS

<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
 <xa-datasource-property name="URL">jdbc:h2:${jboss.server.data.dir}${/}h2${/}localDB;LOCK_TIMEOUT=360000;DB_CLOSE_ON_EXIT=FALSE</xa-datasource-property>
 <user-name>sa</user-name>
<min-pool-size>1</min-pool-size>
      <max-pool-size>10</max-pool-size>
 <track-connection-by-tx />
<metadata>
   <type-mapping>Hypersonic SQL</type-mapping>
</metadata>
 </xa-datasource>

我想知道 hornetQ 在 JBOSS AS 7 中是否有这样的文件,它可以帮助我配置存储队列。我需要在服务器等重启之间保留队列。文件在哪里?它只是standalone.xml吗?

4

1 回答 1

1

HornetQ 只支持文件持久化。HornetQ 使用一组二进制日志文件将消息存储在队列中。

默认情况下,信息存储在$JBOSS_HOME/standalone/data (messagingbindings, messagingjournal and messaginglargemessages directory).

您可以更改默认目录,修改文件中的消息传递子系统standalone.xml

例如

<subsystem xmlns="urn:jboss:domain:messaging:1.1">
   <hornetq-server>
      <!-- first of all we want to use a journal on disk (this is important) -->
      <persistence-enabled>true</persistence-enabled>
      <journal-directory path="path/to/journal" relative-to="user.home"/>
      <bindings-directory path="path/to/bindings" relative-to="user.home"/>
      <large-messages-directory path="path/to/large-message" relative-to="user.home"/>
      <paging-directory path="path/to/paging" relative-to="user.home"/>

      <!-- ... -->
   </hornetq-server>
</subsystem>

请注意,路径始终相对于相对属性(系统属性,在本示例中为用户主目录)。不可能定义绝对路径。

于 2014-10-28T21:04:39.853 回答