简体   繁体   English

JBoss配置:JMS Bridge配置应该在哪里?

[英]JBoss configuration : Where should JMS Bridge configuration be?

I'm new to JMS programming (Java). 我是JMS编程(Java)的新手。

  • I have a machine M1, in a domain D1 and a machine M2 in another domain D2. 我在域D1中有一台机器M1,在另一个域D2中有一台机器M2。
  • I have in M1 a JMS producer . 我在M1中有一个JMS生产者 And in M2 a JMS consumer . 在M2中,一个JMS使用者 Both have as servers JBoss 7.2 . 两者都有JBoss 7.2作为服务器。
  • So it seems the only solution is to create a JMS bridge . 因此,似乎唯一的解决方案是创建JMS桥

I'm reading the official documentation . 我正在阅读官方文件 So I wonder if creating an SSH tunnel is necessary. 所以我想知道是否需要创建SSH隧道。

Second, in which hornetq-configuration.xml file should I set the following configuration? 其次,我应该在哪个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>

Should it be in the in JBoss server of the JMS producer machine or consumer machine? 它应该在JMS生产者机器还是消费者机器的JBoss服务器中?

My third question is, is there a difference in settings between JMS bridge and core bridge? 我的第三个问题是, JMS桥和核心桥之间的设置是否有所不同?

I would be so thankful for any additional information and explainations! 如有任何其他信息和解释,我将非常感谢!

Thank you a lot! 非常感谢!

I know this is little late for OP, may be this information helps someone. 我知道这对于OP来说为时不晚,也许此信息对某人有所帮助。

Firstly, the difference between Core and JMS bridge. 首先,Core和JMS桥之间的区别。 Read doc here 在这里阅读文件

Core bridges are for linking a HornetQ node with another HornetQ node and do not use the JMS API. 核心网桥用于将HornetQ节点与另一个HornetQ节点链接,并且不使用JMS API。 A JMS Bridge is used for linking any two JMS 1.1 compliant JMS providers. JMS桥用于链接任何两个符合JMS 1.1的JMS提供程序。

The Core bridge uses proprietary HornetQ core api so it can only connect two HornetQ servers. 核心网桥使用专有的HornetQ核心api,因此它只能连接两个HornetQ服务器。 Whereas JMS bridges use the JMS API so could connect any JMS1.1 API complaint servers.eg: HornetQ to ActiveMQ. JMS桥使用JMS API,因此可以连接任何JMS1.1 API投诉服务器。例如:HornetQ到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. 有问题的配置是核心网桥,可以在源服务器中配置。由于您似乎连接了两个HornetQ服务器,因此核心网桥是前进的方向。 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. 也就是说,在您的情况下您也可以使用JMS桥接器,因为两者都是JMS的投诉。但是由于获得了性能优势,因此推荐的方法是使用Core桥接器。

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. 最后,JBoss安装服务器附带了一些方便的示例。您可以在[JBOSS_HOME] \\ jboss-as \\ extras \\ hornetq \\ examples \\ jms \\ bridge下找到Core bridge示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM