Skip to content

basic_publish should accept simple String / sub-string as message #63

@s-celles

Description

@s-celles

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions