是否可以在ActiveMQ中镜像单个队列? [英] Is it possible to mirror a single queue in ActiveMQ?

查看:143
本文介绍了是否可以在ActiveMQ中镜像单个队列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在生产系统中运行ActiveMQ.我们的一些队列的数量非常多,而有些队列的数量非常少.我对镜像其中一个低容量队列感兴趣,以便可以围绕收到的消息构建非正式的监视服务.

不幸的是,我唯一能找到的文档似乎暗示着镜像队列是全有还是全无:您要么为拥有的每个队列创建一个主题(并遭受复制流经系统的每条消息的性能损失),要么根本无法使用该功能.

是否无法为单个已知队列名称启用此有用的功能?

解决方案

您可以像这样镜像单个队列:

<destinationInterceptors>
    <virtualDestinationInterceptor>
        <virtualDestinations>
            <compositeQueue name="YOUR.QUEUE" forwardOnly="false">
                <forwardTo>
                    <queue physicalName="MIRROR.OF.YOUR.QUEUE"/>
                </forwardTo>
            </compositeQueue>
        </virtualDestinations>
    </virtualDestinationInterceptor>
</destinationInterceptors>

您可以在此处找到文档.

I'm running ActiveMQ in a production system. Some of our queues are very high volume and some are very low volume. I'm interested in mirroring one of the low volume queues so that I can build informal monitoring services around the messages being received.

Unfortunately, the only documentation I've been able to find seems to imply that Mirrored Queues are are all-or-nothing: you either create a topic for every single queue you have (and suffer the performance penalty of copying every message flowing through your system), or you can't use the feature at all.

Is there no way of enabling this helpful functionality for a single, known queue name?

解决方案

You can mirror single queues like this:

<destinationInterceptors>
    <virtualDestinationInterceptor>
        <virtualDestinations>
            <compositeQueue name="YOUR.QUEUE" forwardOnly="false">
                <forwardTo>
                    <queue physicalName="MIRROR.OF.YOUR.QUEUE"/>
                </forwardTo>
            </compositeQueue>
        </virtualDestinations>
    </virtualDestinationInterceptor>
</destinationInterceptors>

You can find the documentation for virtual destinations here.

这篇关于是否可以在ActiveMQ中镜像单个队列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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