Closed sasikiran closed 8 years ago
Please post questions to rabbitmq-users or Stack Overflow. RabbitMQ uses GitHub issues for specific actionable items engineers can work on, not questions. Thank you.
@sasikiran see https://github.com/rabbitmq/rabbitmq-objc-client/pull/64. In other words, without that PR there is no way to specify message properties. That's an overlooked feature in the library that will be addressed in the future.
Opening as a feature request in favour of #64
@sasikiran @hasbean with those three commits you can specify properties on a channel with basicPublish in a very manual way, by setting RMQBasic* types in an array, similar to PR #64 . I haven't yet implemented all of the encoding for every field type, though (including e.g. nested tables and nils), so you may run into issues when sending. I also haven't even looked at receiving properties through consumers.
The plan is to have RMQQueue and RMQExchange be the main interfaces for setting properties. They'll be settable through parameters with regular Objective-C / Swift types.
I'll be working on this until it's done, so tomorrow or Thursday might see this finished. Otherwise some time next week.
Thank you @camelpunch and @hasbean. I just checked out the API. This is so cool!
In C#'s EasyNetQ RabbitMQ library, you can create MessageProperties object and configure custom userId, replyTo etc. and pass the properties in
this.Bus.Publish()
method.Similarly, in Java's example shown in RPCClient.java, you see:
channel.basicPublish("", requestQueueName, props, message.getBytes("UTF-8"))
where props are the custom basic properties.Lastly, in C library port,
amqp_basic_publish()
accepts the same custom properties in &properties.How do I pass in the same basic properties in this library? I checked
basicPublish
method declared inRMQChannel
, and it looks like the method doesn't seem to support properties parameter.I also tried creating
RMQBasicPublish
object and then createdRMQContentHeader
with properties such asRMQBasicContentType
,RMQBasicUserId
,RMQBasicReplyTo
etc.However, I am stuck here not knowing what to do with the content header and how do I do a basic publish with the data I have. Any pointers here?