用HornetQ强制消息顺序 [英] force order of messages with HornetQ

查看:139
本文介绍了用HornetQ强制消息顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用HornetQ作为JMS提供程序(队列)设置了一个jms服务器.

I've setup a jms server with HornetQ as a JMS provider (Queue).

我有一个应用程序,它充当生产者,另一个应用程序(不同的计算机)充当消费者.

I have an application which acts as a producer and another one (different computer) as a consumer.

我了解JMS规范不能保证交付顺序,但是我正在寻找一种做到这一点的方法:按照发送顺序确切接收消息,即使是特定于提供商的.

I understand that the JMS specification doesn't guarantee the order of delivery, but I'm looking for a way to do just that: receive the messages exactly in the order they have been sent, even if it's provider specific.

有什么想法吗?

推荐答案

显然,这可以通过禁用使用者缓存来实现.这是通过更改hornetq-jms.xml:

Apparently this can be achieved by disabling the consumer cache. This is done by changing the hornetq-jms.xml:

   <connection-factory name="ConnectionFactory">
      <connectors>
         <connector-ref connector-name="netty-connector"/>
      </connectors>
      <entries>
         <entry name="ConnectionFactory"/>
      </entries>

      <consumer-window-size>0</consumer-window-size> <!-- add this line -->
   </connection-factory>

这篇关于用HornetQ强制消息顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆