rabbitmqctl eval "rabbit_exchange:declare({resource, <<\"/\">>, exchange, <<\"test-topic\">>}, topic, true, false, false, [])."
Error:
{:undef, [{:rabbit_exchange, :declare, [{:resource, "/", :exchange, "test-topic"
}, :topic, true, false, false, []], []}, {:erl_eval, :do_apply, 6, [file: 'erl_e
val.erl', line: 680]}, {:rpc, :"-handle_call_call/6-fun-0-", 5, [file: 'rpc.erl'
, line: 197]}]}
But when I use Version 3.6.x excute rabbitmqctl eval ":rabbit_exchange:declare({...})." success
I don't now ...
I need your help, Thanks!
Hello and thanks for using RabbitMQ.
Please be aware that the RabbitMQ team does not use GitHub issues for anything but actionable work, which means that questions like these should be addressed to the rabbitmq-users mailing list.
Note that there is _no guarantee_ that any rabbitmqctl eval command will work between RabbitMQ versions. If you need to declare an exchange from the command line, use the rabbitmqadmin tool or use the HTTP API directly.
Thanks!
The "no guarantee" part means that you are invoking an API that's not intended to be used by either users or operators. Any client-facing code paths are updated to use the API signature available in a specific version. If you use those using eval (highly discouraged), it's up to you to determine what arguments must be passed and why. I don't see a single reason to mess with that over using rabbitmqadmin's public API (commands).
And for the truly curious, the function above requires an extra argument as of 3.7.0: the acting user.
Most helpful comment
Hello and thanks for using RabbitMQ.
Please be aware that the RabbitMQ team does not use GitHub issues for anything but actionable work, which means that questions like these should be addressed to the
rabbitmq-usersmailing list.Note that there is _no guarantee_ that any
rabbitmqctl evalcommand will work between RabbitMQ versions. If you need to declare an exchange from the command line, use therabbitmqadmintool or use the HTTP API directly.