Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hardcoded values in exchange_declare call #11

Closed
eng1neer opened this issue Nov 9, 2011 · 5 comments
Closed

hardcoded values in exchange_declare call #11

eng1neer opened this issue Nov 9, 2011 · 5 comments

Comments

@eng1neer
Copy link

eng1neer commented Nov 9, 2011

Hi,

RabbitMq/Producer.php, line 12:
$this->ch->exchange_declare($this->exchangeOptions['name'], $this->exchangeOptions['type'], false, true, false);

Why are you using hardcoded values here? I have completely equal declaration of producer and consumer (with auto_delete set to true, and durable to false) and the code above tries to redeclare (with no success of course) the queue with other options just because it ignores my settings

Is it a bug or am I missing something?

Thanks

@videlalvaro
Copy link
Collaborator

Yes, the idea behind this library is to use messaging patterns, that is… to declare exchange and queues in certain ways for what it wants to provide to the developer.

If you want to customize exchange or queue declarations then you can extend the classes whenever that possible and add your own consumers/producers. If you think what you are doing is generic enough merits a new class into the library then don't hesitate to fork the project and add your own and the issue a pull request with the respective explanation on why that is needed.

Of course you can always use the underlying php-amqp library to do whatever you want with AMQP… the bundle doesn't stop you to do that but at the moment the idea behind is to provide a set of ready to use classes for developers.

I hope this clears up the concern regarding the design decision I took. Let me know if I can go and close this ticket.

@eng1neer
Copy link
Author

eng1neer commented Nov 9, 2011

Changing it to
$this->ch->exchange_declare($this->exchangeOptions['name'], $this->exchangeOptions['type'], $this->exchangeOption s['passive'], $this->exchangeOptions['durable'], $this->exchangeOptions['auto_delete']);
would solve the problem still allowing to use defaults in case not all options were supplied through the configuration. I really appreciate your work, the bundle saved a lot of my time and it would be great if you applied this fix.

@videlalvaro
Copy link
Collaborator

Could you please fork the project and add that? ATM I can't dedicate time to this project but I've plan to do it as soon as I finish writing the book.

@eng1neer
Copy link
Author

eng1neer commented Nov 9, 2011

Ok, thank you.

videlalvaro added a commit that referenced this issue Nov 24, 2011
The code also addressed issues #7 and #11
@videlalvaro
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants