AMQPClient.jl
AMQPClient.jl copied to clipboard
basic_publish should accept simple String / sub-string as message
Hello,
Trying to convert https://www.rabbitmq.com/tutorials/tutorial-one-python.html to Julia (*), I noticed that API of this AMQPClient.jl could probably be improved to accept String / sub-string (ie without creating explicitly a Message
)
For example the following Python code
channel.basic_publish(exchange='',
routing_key='hello',
body=data)
can be converted to Julia
# create a persistent plain text message
data = convert(Vector{UInt8}, codeunits("hello world"))
msg = Message(data, content_type="text/plain", delivery_mode=PERSISTENT)
basic_publish(chan1, msg; exchange="", routing_key="hello")
why not having simply?
basic_publish(chan1, "Hello World!"; exchange="", routing_key="hello")
Kind regards
(*) https://github.com/rabbitmq/rabbitmq-tutorials/tree/main/julia provides now such tutorial