0

我是 JMS 编程(Java)的新手。

  • 我在域 D1 中有一台机器 M1,在另一个域 D2 中有一台机器 M2。
  • 我在 M1 中有一个JMS 生产者。而在 M2 中是一个JMS 消费者。两者都有JBoss 7.2作为服务器。
  • 所以似乎唯一的解决方案是创建一个JMS 桥

我正在阅读官方文档。所以我想知道是否有必要创建一个 SSH 隧道。

二、hornetq-configuration.xml我应该在哪个文件中设置以下配置?

<bridge name="my-bridge">
   <queue-name>jms.queue.sausage-factory</queue-name>
   <forwarding-address>jms.queue.mincing-machine</forwarding-address>
   <filter-string="name='aardvark'"/>
   <transformer-class-name>
      org.hornetq.jms.example.HatColourChangeTransformer
   </transformer-class-name>
   <retry-interval>1000</retry-interval>
   <ha>true</ha>
   <retry-interval-multiplier>1.0</retry-interval-multiplier>
   <reconnect-attempts>-1</reconnect-attempts>
   <failover-on-server-shutdown>false</failover-on-server-shutdown>
   <use-duplicate-detection>true</use-duplicate-detection>
   <confirmation-window-size>10000000</confirmation-window-size>
   <user>foouser</user>
   <password>foopassword</password>
   <static-connectors>
      <connector-ref>remote-connector</connector-ref>
   </static-connectors>
   <!-- alternative to static-connectors
   <discovery-group-ref discovery-group-name="bridge-discovery-group"/>
   -->
</bridge>

它应该在 JMS 生产者机器或消费者机器的 JBoss 服务器中吗?

我的第三个问题是,JMS 网桥和核心网桥的设置有区别吗?

我将非常感谢任何额外的信息和解释!

十分感谢!

4

1 回答 1

0

I know this is little late for OP, may be this information helps someone.

Firstly, the difference between Core and JMS bridge. Read doc here

Core bridges are for linking a HornetQ node with another HornetQ node and do not use the JMS API. A JMS Bridge is used for linking any two JMS 1.1 compliant JMS providers.

The Core bridge uses proprietary HornetQ core api so it can only connect two HornetQ servers. Whereas JMS bridges use the JMS API so could connect any JMS1.1 API complaint servers.eg: HornetQ to ActiveMQ.

The configuration mentioned in question is Core bridge and can be configured in the source server.Since you seem to connect two HornetQ server Core bridges is the way forward. That said, in your case you could use JMS bridges as well since both are JMS complaint.But the recommended approach would be to use Core bridge due to performance advantage gain.

Finally, the JBoss installation server comes with some handy examples.You could find Core bridge example under [JBOSS_HOME]\jboss-as\extras\hornetq\examples\jms\bridge.

于 2014-11-07T06:01:01.010 回答