We use this module across multiple services and would like to use the platform string to track which services are connected to our rabbit cluster.
This PR allows you to configure platform by passing it as an option to connect
While this is a fine feature to have (and other clients generally allow client properties configuration), I'd like to add that this is not really what the platform key is for. I'd say information or even product are more appropriate.
Alright - I'll change it to product :)
make product/version configurable
There you go. product and version are now configurable instead of platform. This solves my problem as well :)
The client properties are arbitrary, but the spec (https://www.rabbitmq.com/resources/specs/amqp0-9-1.xml) suggests that the 'product', 'platform', and 'version' of the client should be included. I take e.g., "product", o be the name of the client library, i.e., "amqplib"; likewise "version". (Arguably "platform" should be the OS rather than the version of Node.JS, or a combination of those.) In other words I treat it like a user agent string.
I can see why it's useful to include some other information so you can see it in the management console or whatever. I'd rather it was fields other than those already included, though -- they will still be encoded. Maybe "application" or "service", for your purposes.
So just to be clear, I think an application should be able to supply arbitrary client properties, but those already in CLIENT_PROPERTIES cannot be overridden.
I don't think socketOptions is the right place to supply them, but on the other hand, I wouldn't want another argument to connect either, and it would be a pain to encode them in the URL. (Actually it's a pain to encode other options like heartbeat in the URL, but it's done now)
The code in master branch now lets you supply client properties when you connect -- see #98 for an example.
As above, I'd rather you didn't override existing properties, since that loses information.
The feature referred to above is in release v0.3.0.