Multi-protocol Messaging and Streaming Broker for Grasshopper (RabbitMQ_GH)
收藏doi.org2024-05-22 更新2025-03-26 收录
下载链接:
https://doi.org/10.18419/darus-4193
下载链接
链接失效反馈官方服务:
资源简介:
RabbitMQ GH is a Grasshopper plugin for implementing RabbitMQ messaging capabilities to exchange data between external applications and Grasshopper scripts in real time, with a high degree of flexibility and scalability. INSTALLATION Erlang installation Download the current Erlang version installer and follow the default setup in the installation wizard. Add Erlang to the Environment variables. To do it, go to Control Panel>System and Security>System. A new window will open. Click on Advanced system settings under the Device specifications collapsable panel. When the System Properties window appears, click on the Environment Variables button at the bottom of the Advanced tab. On the User variables section use the New... button to add a new variable with ERLANG_HOME as the Variable name and the installation path as the variable value (By default the installation path should be C:\Program Files\Erlang OTP). To verify that the variable was correctly added, open a command prompt and enter the ECHO %ERLANG_HOME% command. If the installation path is printed on the screen, the variable is correctly added. RabbitMQ installation On RabbitMQ´s GitHub page go to the Releases section on the right-hand side of the window. Click on the latest release and navigate to the assets section and download the rabbitmq-server-windows-.zip file, where corresponds to the latest release version number. Extract the compressed files to the directory where you want RabbitMQ to be stored. To run RabbitMQ, open a terminal window and go to the installation directory. Once there, run the rabbitmq-server.bat command. The current Erlang version and the plugins being used should be printed on the screen. In Windows, RabbitMQ does not run on startup by default. To change that, the Startup type of the RabbitMQ Server must be set to Automatic If the plugins are not working properly, follow the same procedure described in the following section to activate them. Management plugin activation To activate the management plugin, open a terminal window and go to the installation directory. After that, run the rabbitmq-plugins enable rabbitmq_management command. This should enable the plugin and it should be working the next time RabbitMQ is launched. The same command works for activating other plugins by replacing rabbitmq_management with the plugin's name after it has been downloaded into the plugin's directory located on RabbitMQ's installation directory. For further information, follow this link. Grasshopper plugin installation Copy the folder Installation_Files/Rabbit_MQ_GH into your Grasshopper component folder. If you don´t know the location of this folder on your computer, you can find it using Grasshopper's interface. Go to File>Special Folders>Components Folder and a file explorer window will open in the correct directory. In general, downloaded .gha files can be blocked by Windows OS, so verify that all the downloaded files are unblocked. To do so, find each file in the file explorer and right-click on it. In the context menu select Properties. This will open a new window. Go to the lower part of the general tab and check the checkbox labeled Unblock. For the use of the plugin, even after closing the .gh files, the connections created in the session will remain open if the Run toggle is set to True. To prevent this, make sure to set the toggle to False before closing the file. Additional resources Linux machine deployment AWS deployment MANAGEMENT PLUGIN To open the management plugin, in your web browser navigate to localhost:15672 If no credentials have been established, use guest as the default username and password to log in. USE PATTERNS Example files covering several use patterns for Grasshopper, Python, and C# are located in the folder Tutorial/Examples/. Most of them build on top of the consumer-producer pattern. It has two main components: A producer that sends messages to a RabbitMQ queue and a consumer that receives the messages from the queue and processes them. These are all the patterns covered in the example files with a detailed explanation in Tutorial/Examples/readme.md: Basic consumer Competing consumers Publisher-subscriber Request-reply Basic routing Topic routing
RabbitMQ GH是一款专为Grasshopper开发环境设计的插件,旨在实现RabbitMQ消息传递功能,以实时交换外部应用程序与Grasshopper脚本之间的数据,具备高度的灵活性和可扩展性。安装过程如下:
安装Erlang
下载当前版本的Erlang安装程序,并遵循安装向导中的默认设置。将Erlang添加到环境变量中。具体操作为:进入控制面板>系统和安全>系统。打开新窗口后,在设备规格可折叠面板下点击高级系统设置。在系统属性窗口中,点击高级选项卡底部的环境变量按钮。在用户变量部分,使用新建...按钮添加一个新变量,变量名为ERLANG_HOME,变量值为安装路径(默认安装路径应为C:Program FilesErlang OTP)。为验证变量是否正确添加,打开命令提示符并输入ECHO %ERLANG_HOME%命令。如果屏幕上打印出安装路径,则表示变量已正确添加。
安装RabbitMQ
在RabbitMQ的GitHub页面,进入右侧的发布版块。点击最新版本,导航到资产版块并下载rabbitmq-server-windows-.zip文件,其中对应最新发布版本的版本号。将压缩文件解压到您希望存储RabbitMQ的目录中。要运行RabbitMQ,打开一个终端窗口并导航到安装目录。一旦到达,运行rabbitmq-server.bat命令。屏幕上应打印出当前Erlang版本和正在使用的插件。在Windows中,RabbitMQ默认不随系统启动运行。要更改此设置,必须将RabbitMQ服务器的启动类型设置为自动。如果插件运行不正常,请按照以下章节中描述的相同程序激活它们。
管理插件激活
要激活管理插件,打开一个终端窗口并导航到安装目录。之后,运行rabbitmq-plugins enable rabbitmq_management命令。这将启用插件,并在下次启动RabbitMQ时生效。相同的命令也可以用于激活其他插件,只需将rabbitmq_management替换为已下载到RabbitMQ安装目录插件目录中的插件名称。
Grasshopper插件安装
将Installation_Files/Rabbit_MQ_GH文件夹复制到您的Grasshopper组件文件夹中。如果您不知道该文件夹在计算机上的位置,可以使用Grasshopper的界面找到它。进入文件>特殊文件夹>组件文件夹,将打开一个文件资源管理器窗口,显示正确目录。通常,下载的.gha文件可能会被Windows操作系统阻止,因此请验证所有下载的文件都已解除阻止。为此,在文件资源管理器中找到每个文件,右键单击它。在上下文菜单中选择属性,这将打开一个新窗口。在常规选项卡的下半部分,勾选标签为解除阻止的复选框。使用该插件时,即使在关闭.gh文件后,如果将运行切换设置为True,则在会话中创建的连接将保持打开状态。为了防止这种情况,确保在关闭文件之前将切换设置为False。
Linux机器部署
AWS部署
管理插件
要打开管理插件,在您的网络浏览器中导航到localhost:15672。如果尚未建立凭据,请使用默认用户名guest和密码登录。
使用模式
涵盖Grasshopper、Python和C#的多种使用模式的示例文件位于Tutorial/Examples/文件夹中。其中大部分基于生产者-消费者模式构建。该模式有两个主要组件:一个生产者向RabbitMQ队列发送消息,一个消费者从队列接收消息并进行处理。这些模式都在示例文件中有详细说明,具体内容请参考Tutorial/Examples/readme.md:基本消费者、竞争消费者、发布者-订阅者、请求-回复、基本路由、主题路由。
提供机构:
DaRUS



