为什么暂停队列不是代理功能? [英] Why is pausing a queue not a broker function?

查看:66
本文介绍了为什么暂停队列不是代理功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个ActiveMQ经纪人admin命令,告诉它暂停队列-

I was looking for an ActiveMQ broker admin command, to tell it to pause a queue - that is:


  • 继续接受来自生产客户

  • 停止交付给使用中的客户,允许队列积压增长,直到恢复队列,然后将积压发送给客户。

我找不到这样的命令。最常见的答案是应该在客户端对其进行管理-即找到每个消费者并停止它。其他答案是解决方法,例如操纵网络路由或防火墙,以便客户端和代理不再通信。

I was unable to find such a command. The commonest answer was that it should be managed at the client end -- that is, locate every consumer and stop it. Other answers were workarounds, like manipulating network routes or firewalls so that the clients and broker could no longer communicate.

对其他消息队列的粗略调查表明ActiveMQ并不罕见在这方面。

A cursory survey of other message queues indicates that ActiveMQ is not unusual in this regard.

在我看来,有两个原因可能无法实现此功能:

It seems to me there are two reasons this functionality might not be implemented:


  • 很难实现-但我想不出为什么。

  • 这与消息队列的设计原理相反

这是什么,为什么?

推荐答案

实施起来可能不太复杂-如您所说。
我不知道这是不是是否有需求的主动设计决策。其他类似的产品(例如IBM WebSphere MQ)在队列上实现了禁止获取/放入,因此显然并不完全与消息传递的哲学背道而驰-而是一种对实时系统进行操作和排除故障的工具。

Probably not too complicated to implement - as you say. I don't know if it's an active design decision of if there has been no demand. Other similar products such as IBM WebSphere MQ implements "get/put inhibited" on queues, so it's obviously is not totally against the philosofy of messaging - rather a tool to operate and trouble shoot live systems.

我有点有偏见,但我实际上想使发送方与接收方分离(如果是两个不同的系统,则最终可能会切换/升级/更改..)。

I'm a bit biased, but I actually like to decouple the sender from the receive (if the are two different systems, that might eventually get switched/upgraded/changed..).

解耦系统并能够执行所需操作的一种简单方法是使发送方发送到一个队列 DATA.OUT,而接收方侦听另一个 DATA.IN 。然后,您可以使用Apache Camel(通常与ActiveMQ捆绑在一起以实现企业集成模式)从DATA.OUT路由到DATA.IN。

An easy way to decouple the systems, and be able to do what you want is to make the sender send to one queue "DATA.OUT" and the receiver listen to another "DATA.IN". Then you can use Apache Camel (which is typically bundled with ActiveMQ to achieve Enterprise Integration Patterns), to route from DATA.OUT to DATA.IN.

Camel Route是可以通过JMX来启动/停止,这将实现与您所描述的类似的东西。

A Camel Route is possible to start/stop via JMX, which will achieve something similar to what you described.

我想这是ActiveMQ设计,而不是您在中间件层,例如Apache Camel,而不是直接在队列上。

I guess ActiveMQ design in the matter rather have you do these kind of things in a middleware layer, such as Apache Camel, rather than direct on the queues.

这篇关于为什么暂停队列不是代理功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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