1 Star 0 Fork 0

zhzhouq9/rabbitmq-tutorials

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
emit_log_topic.exs 491 Bytes
Copy Edit Raw Blame History
Jeff Weiss authored 2015-12-23 04:14 +08:00 . add Elixir source for tutorial 5
{:ok, connection} = AMQP.Connection.open
{:ok, channel} = AMQP.Channel.open(connection)
{topic, message} =
System.argv
|> case do
[] -> {"anonymous.info", "Hello World!"}
[message] -> {"anonymous.info", message}
[topic|words] -> {topic, Enum.join(words, " ")}
end
AMQP.Exchange.declare(channel, "topic_logs", :topic)
AMQP.Basic.publish(channel, "topic_logs", topic, message)
IO.puts " [x] Sent '[#{topic}] #{message}'"
AMQP.Connection.close(connection)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/zhzhouq9/rabbitmq-tutorials.git
git@gitee.com:zhzhouq9/rabbitmq-tutorials.git
zhzhouq9
rabbitmq-tutorials
rabbitmq-tutorials
master

Search