squaremo / rabbit.js

Messaging in Node.JS made easy using RabbitMQ
Other
1.52k stars 142 forks source link

adding contentType options for PubSocket.prototype.publish method #96

Closed ar4mirez closed 8 years ago

ar4mirez commented 9 years ago

was trying to use some of the options from amqplib but i found the setsockopt function din't allow for extra options, and also the variable options in the function PubSocket.prototype.publish was overriding any new option set with setsockopt.

http://www.squaremobius.net/amqp.node/doc/channel_api.html

I'm only adding publish#contentType for now but i can add more later on.

sberryman commented 8 years ago

I thought about this as well, I need contentEncoding.

I was thinking of specifying an array of allowed options for publish and merging those. Some just don't make sense such as correlationId, messageId and timestamp as they are message specific. Unless those options were defined as a function then we could pass the chunk and encoding into the function and set the option value to the result of that function.

ar4mirez commented 8 years ago

@sberryman Agree with you :+1: I try to help with this PR but has been a year already so I'm not sure if will be merged some day or if there any other alternative ?