天天看点

【原创】RabbitMQ 之 Plugins(翻译)

      为了方便工作中使用,对 rabbitmq 的【插件】相关文档进行了翻译,鉴于自己水平有限,翻译中难免有纰漏产生,如果疑问,欢迎指出探讨。此文以中英对照方式呈现。

========== 我是分割线 ============= 

rabbitmq supports a variety of plugins. this page documents the plugins that ship with rabbitmq 3.0.1.

rabbitmq 支持许多插件。当前页面列出了 rabbitmq 3.0.1 可用的插件。

to enable plugins, use the rabbitmq-plugins tool:

<a href="http://my.oschina.net/moooofly/blog/95402#">?</a>

1

<code>rabbitmq-plugins</code><code>enable</code> <code>plugin-name</code>

and to disable plugins again, use:

通过如下命令 去使能插件: 

<code>rabbitmq-plugins disable plugin-name</code>

you can see a list of which plugins are enabled with:

通过如下命令 查看哪些插件被使能了: 

<code>rabbitmq-plugins list</code>

enabling or disabling plugins has no effect on a running rabbitmq server. you will need to (re)start rabbitmq for the enabled plugins to be activated.

在一个处于运行状态的 rabbitmq server 上,执行使能或者去使能插件的命令是不会产生效果的。你需要(重新)启动 rabbitmq 以便激活使能的插件。

for more information on rabbitmq-plugins, consult the manual page.

note: releases prior to 2.7.0 did not include plugins with the server, and any plugins that were installed were always activated; rabbitmq-plugins did not exist. you can download binary plugin files for older releases from the archive. note further that we did not make binary plugins available prior to release 2.0.0.

rabbitmq_auth_backend_ldap

authentication / authorisation plugin using an external ldap server. see the readme for more information.

rabbitmq_auth_mechanism_ssl

authentication mechanism plugin using sasl external to authenticate using ssl client certificates. see the readme for more information.

rabbitmq_federation

scalable publish / subscribe messaging across wans and administrative domains. see the page on the federation plugin for more information.

rabbitmq_federation_management

shows federation status in the management api and ui. only of use when using rabbitmq_federation in conjunction with rabbitmq_management. in a heterogenous cluster this should be installed on the same nodes as rabbitmq_management.

在管理 api 和 ui 中显示 federation 状态信息。仅在同时使用 rabbitmq_federation 和 rabbitmq_management 插件时有效。在异源 cluster 中,该插件应该与 rabbitmq_management 插件安装于同一个 node 上。

rabbitmq_management

a management / monitoring api over http, along with a browser-based ui. for more information, see the page on the management plugin.

rabbitmq_management_agent

when installing the management plugin on some of the nodes in a cluster, you must install rabbitmq_management_agent on all of the nodes in the cluster. you can install the full management plugin on as many of the nodes as you want.

当在 cluster 中的一些 node 上安装了管理插件时,你必须在 cluster 中的所有 node 上安装 rabbitmq_management_agent 插件。你可以任意多个 node 上安装全套管理相关插件。

rabbitmq_shovel

a plug-in for rabbitmq that shovels messages from a queue on one broker to an exchange on another broker. please see the page on the shovel plugin for more information or take a look at a working shovel configuration.

rabbitmq_shovel_management

shows shovel status in the management api and ui. see the plugin readme. only of use when using rabbitmq_shovel in conjunction with rabbitmq_management. in a heterogenous cluster this should be installed on the same nodes as rabbitmq_management.

rabbitmq_stomp 

a gateway for exposing amqp functionality via the stomp protocol. (some clients and servers supporting stomp are listed here.) please see the documentation and various blog articles about the adapter for more information on compiling and configuring it.

currently, all plugins below are experimental. this means we make no claims about their fitness for purpose or stability, though they are in general under active development.

当前,下表列出的插件都尚处于试验阶段,这意味着我们并未对其适用性或者稳定性做任何保证,尽管这些插件均以常规的有效方式开发。

rabbitmq_management_visualiser

broker topology visualiser plugin which is itself a plugin to the management plugin. adds a visualiser tab to the management web interface, which then flexibly and interactively displays channels, queues and exchanges, and the links between them.

rabbitmq_consistent_hash_exchange

consistent hash exchange type. please see the readme for more information.

rabbitmq_tracing

adds message tracing to the management plugin. logs messages from the firehose in a couple of formats.

rabbitmq_jsonrpc_channel

an amqp-over-http protocol binding for rabbitmq and some javascript libraries for interacting with rabbitmq over http.

rabbitmq_jsonrpc_channel_examples

adds some example web applications to rabbitmq_jsonrpc_channel: a shared whiteboard, a chat application, and some tests.

rabbitmq_web_stomp

a bridge exposing rabbitmq_stomp to web browsers using websockets, using the websockets emulation / compatibility layer sockjs. please see the page on the web-stomp plugin.

rabbitmq_web_stomp_examples

adds some basic examples to rabbitmq_web_stomp: a simple "echo" service and a basic canvas-based collaboration tool.

rabbitmq_mqtt

an adapter implementing the mqtt 3.1 protocol. see the readme for more details.

some plugins are also available from third party sources. plugins will generally be available in two forms. the expected form for a packaged plugin will be a .ez erlang archive. alternatively, more developmental plugins may be distributed directly from source control, in which case see building plugins below. once you have one or more .ez archives for your plugins, you need to copy them to the plugins directiory.

一些插件同样可以从第三方处获得。插件通常以如下两种形式呈现:常规的形式为以 .ez 作为后缀的 erlang archive 包;另外一种,同时也是处于开发更新状态中的插件,可能会直接通过源码的形式进行发布,在这种情况下可以参考下面的 building plugins 内容。一旦你获得了一个或者多个 .ez 插件文件,你唯一需要做的就是将其拷贝到相应的插件目录中去。

the plugins directory location is determined by the rabbitmq_plugins_dir variable. its default value depends on how you installed rabbitmq. some common values are:

插件目录的位置由环境变量 rabbitmq_plugins_dir 决定。其默认值依赖于你安装 rabbitmq 的方式。一些常见的值如下表: 

installation method

plugins directory

debian/rpm packages

/usr/lib/rabbitmq/lib/rabbitmq_server-version/plugins

windows

typically c:\program files\rabbitmq\rabbitmq_server-version\plugins (depending on where it was installed)

macports

${install_prefix}/lib/rabbitmq/lib/rabbitmq_server-version/plugins (the macports ${install_prefix} defaults to /opt/local)

homebrew

/usr/local/cellar/rabbitmq/version/lib/rabbitmq/erlang/lib/rabbitmq-version/plugins

generic unix

rabbitmq_server-version/plugins (depending on where it was installed)

the variable's meaning has changed in 2.7.0: whereas it previously referred to the directory of installed plugins, it now refers to the directory with all available plugins. the rabbitmq-plugins tool can only enable plugins found in this directory.

该变量的含义从版本 2.7.0 开始发生了改变:在 2.7.0 之前,其表示已安装插件所在的目录,改变之后的含义为可用插件所在目录。命令行工具 rabbitmq-plugins 只能使能在该目录下的可找到的插件。 

the enabled plugins configuration is preserved between upgrades, so there is no need to re-enable plugins after an upgrade, but because the plugins directory changes between versions, any third party plugins will need to be copied to the new directory. it's very possible that due to api changes you may need to check for updates to third party plugins at this point.

已使能插件的配置信息在 升级过程中会 被保留,故不需要在升级后重新使能插件,但是由于不同版本中规定的插件目录的位置可能不同,第三方插件将需要被手动拷贝到新目录。还有一种非常可能发生的情况是,由于 api 发生了改变,你可能需要自己去检查第三方插件并更新。 

you can also build rabbitmq plugins from source. the sources for a particular version of the plugins is distributed in the same archive as the broker with that version. the source code repositories can all be found on our mercurial server. see the plugin development guide for more information on building plugins from source.

note that plugins tend to be strongly bound to a particular version of rabbitmq-server. for example, if you are running rabbitmq 3.0.1, you should check out all plugins with the mercurial tag rabbitmq_v3_0_1.

值得注意的是,插件一般情况下是与特定版本的 rabbitmq-server 强绑定的。例如,如果你运行的是 rabbitmq 3.0.1 版本,你应该检出所有带有 mercurial tag 为 rabbitmq_v3_0_1 的插件。

继续阅读