houseofcat / turbocookedrabbit

A user friendly RabbitMQ library written in Golang.
MIT License
107 stars 20 forks source link

How To Publish A String Message (i.e. how to go from a string into a tcr.Letter) #19

Closed istrau2 closed 3 years ago

istrau2 commented 3 years ago

I've been looking for documentation regarding letters. I can't find anything except the part that creates a mock letter. If i have a message in the form of a string, how do I turn that into a Letter that is publishable?

Thanks in advance

houseofcat commented 3 years ago

Let me know if this covers your use cases, if so feel free to close.

Example application doing publish. https://github.com/houseofcat/turbocookedrabbit/blob/master/examples/publish/main.go

istrau2 commented 3 years ago

@houseofcat Thanks, I had actually implemented using a Publisher instead of the RabbitService because we don't want failed publishes getting autopublished. It looks like Publisher.Publish() expects a *tcr.Letter instead of an interface...

houseofcat commented 3 years ago

Cool, let me know if you are good and/or close out the issue.

istrau2 commented 3 years ago

@houseofcat sorry, I missed the part in your link where it uses the publisher directly. Yes, this is helpful. I will close now. Thanks for the help.

houseofcat commented 3 years ago

All good just making sure you are happy.

Always love to see new users.