简体   繁体   English

任何 IDE 或帮助调试 Rabbitmq 的扩展?

[英]Any IDE or extension for helping debugging Rabbitmq?

I am new to Erlang. I am working on investigating some details about how RabbitMQ handle messages.我是 Erlang 的新手。我正在研究有关 RabbitMQ 如何处理消息的一些细节。 I want to create some breakpoints in its source code and watch the contexts.我想在其源代码中创建一些断点并观察上下文。 However, there seems to be no ideal IDE for Erlang OTP application, which can bring nice debugging experience just like IDEA for java.但是,Erlang OTP应用似乎没有理想的IDE,它可以像IDEA一样为java带来良好的调试体验。

Since the source code for RabbitMQ is managed by erlang.mk, I downloaded the source code, opened with VS Code + "Erlang LS" extension and could not find how to start debugging the project from the source code.由于 RabbitMQ 的源代码由 erlang.mk 管理,我下载了源代码,用 VS Code + "Erlang LS" 扩展打开,并没有找到如何从源代码开始调试项目。 Are there any suggestions for choosing IDE & extensions, or debugging the source code in a convenient way?对于选择IDE & extensions,或者方便调试源码有什么建议吗?


Tried:试过:

VS Code + "Erlang LS" extension: can not find how to start debugging. VS Code +“Erlang LS”扩展:找不到如何开始调试。

VS Code + "erlang" extension: it only supports projects managed by rebar/rebar3. VS Code + "erlang" 扩展:它只支持由 rebar/rebar3 管理的项目。


Expecting:期待:

Convenient way to debug RabbitMQ from source code.从源代码调试 RabbitMQ 的便捷方式。

Found the solution myself.自己找到了解决方案。 You can enjoy debugging after the following steps:您可以通过以下步骤进行调试:

  1. Install "Erlang LS" extension in VS Code.在 VS Code 中安装“Erlang LS”扩展。
  2. Uncomment "code_reload" setting in "erlang_ls.config" and input the right node name.取消注释“erlang_ls.config”中的“code_reload”设置并输入正确的节点名称。 For rabbitmq 3.11.5 on Mac OS 13, node name is "rabbit".对于 Mac OS 13 上的 rabbitmq 3.11.5,节点名称是“rabbit”。 If you are not sure about the node name, use如果您不确定节点名称,请使用

epmd -names epmd-名称

to find the running nodes after you have launched rabbitMQ.启动rabbitMQ后查找正在运行的节点。

  1. launch.json is like: launch.json 就像:

    { "version": "0.2.0", "configurations": [ { "name": "Existing Erlang Node", "type": "erlang", "request": "attach", "projectnode": "rabbit", "cookie": "xxxxxxx", "timeout": 300, "cwd": "${workspaceRoot}" } ] } { "version": "0.2.0", "configurations": [ { "name": "Existing Erlang Node", "type": "erlang", "request": "attach", "projectnode": "rabbit" , "cookie": "xxxxxxx", "timeout": 300, "cwd": "${workspaceRoot}" } ] }

"projectnode" should be the same with the node name used in the above step. “projectnode”应与上述步骤中使用的节点名称相同。 "cookie" is the default Erlang node cookie. “cookie”是默认的 Erlang 节点 cookie。

  1. Start rabbitmq with:使用以下命令启动 rabbitmq:

bazel run -c dbg broker bazel run -c dbg 代理

  1. Pressed "F5", and set breakpoints as you like.按“F5”,并根据需要设置断点。 Rabbitmq are free to be debugged now. Rabbitmq现在免费调试。 在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM