ricbra / rabbitmq-cli-consumer

Consume RabbitMQ messages into any cli program
MIT License
247 stars 49 forks source link

a conf file per consumer? #7

Closed ghost closed 8 years ago

ghost commented 9 years ago

is there a way to have 1 file with credentials instead of in every consumer config file?

ricbra commented 9 years ago

Currently there isn't.

I wonder how exactly you'd like to see this feature. A separate file for credentials and add a new option to pass it on to the consumer?

appeltaert commented 9 years ago

You dont want credentials as options and you dont want lose the flexibility of a conf per consumer.

How about the option to pass mutliple conf files so they get merged? Seems to be the most flexible option since you can have multiple hosts and still 1 conf with per host with credentials. This is also backwards compatible wit the current build.

ricbra commented 9 years ago

We certainly don't want to loose the flexibility of a config per consumer, so no worries thats not going to happen. Credentials as an option is too insecure (password can be seen by all users on the server using ps or something similar).

Solution 1: What about adding a optional --credentials option to pass in a file with the credentials? If given, the credentials in the --credentials file would override any credentials in the --configuration file. If credentials are found in both the --configuration and --credentials file, a warning should be shown to the user. This could lead to hard to debug cases, so we want to prevent that. This preserves BC. An example of how this could be called:

$ rabbitmq-cli-consumer --configuration=config.conf --credentials=credentials.conf 

Solution 2: Take the merging of configuration files even further and provide multiple levels of configuration (just as MySQL does: /etc/my.conf, .my.conf in home dir etc):

This also preserves BC.

I think I like solution 2 more then solution 1, what about you @appeltaert ? Too bad the ticket author has deleted his account (or has it something to do with the ddos on Github?)

appeltaert commented 9 years ago

Eh ghost? Idk what happened but that comment was mine :) Ye i agree solution 2 is excellent

ricbra commented 9 years ago

Funny, the first comment was originally places as "ecoli1". Weird shirt.

I'll add this as feature request.

alex-pex commented 9 years ago

Hello,

The only option which annoys me is the "queue" setting. I would like not to write the value in the config file and overwrite it at execution.

Something like :

$ rabbitmq-cli-consumer --configuration=config.conf --executable="php app/console test:event" --queue=hello

That way I can reuse the same config for several consumers

ricbra commented 9 years ago

I've been thinking about this problem past few days and I think it would be best if we (as a final resort) also could pass in all configuration options (where possible) as command line arguments. That provides ultimate flexibility.

tl;dr

ricbra commented 8 years ago

I'm closing this as it is implemented in 2.0 branch.