Enable "tracing" of callbacks, without any requirements to callback itself, or rewriting commands etc.#45
Open
kratkyzobak wants to merge 17 commits into
Open
Enable "tracing" of callbacks, without any requirements to callback itself, or rewriting commands etc.#45kratkyzobak wants to merge 17 commits into
kratkyzobak wants to merge 17 commits into
Conversation
Producers currently had method "setRoutingKey" (from AMQPMember), but this was not used at all. This commit allows to use this parameter as default routing key, instead of need to send it always to publish method. Also routingKey parameter for producer introduced in config section. In most use cases, there is application forced to publish with "magic constant" routingKey, which has to be same as routingKeys defined in consumers (for Multiple Consumers). By allowing to set default routingKey is easy to move from simple Consumer (one per queue) to MultipleConsumer. Also this commit brings more abstraction, since routingKey in simple cases could remain only in config.neon and there is no need for routingKey in app code.
…onsumer recognition).
Author
|
Hi, is it possible to review this pull request? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request to enable "tracing" of callbacks, without any requirements to callback itself, or rewriting commands etc.
Interface Kdyby\RabbitMq\IConsumerStartListener introduced
Every registered service implementign this interface will be registered to Consumer::onStart event. Service then can lregister any other event. Another approach needs to use Kdyby\Events (in some projects for this only purpose), or there would be requirements to "callback" classes.
onConsume append queueName and callback
Mostly for MultipleConsumer, there were introduced 3rd and 4th argument to onConsume event. 3rd = queueName (string), 4th = callback (callable).
Both of this allow you to "monitor" callback efficiency "externaly" without need to rewrite commands, or without need to make common parents for callback classes etc.
Commit 9841164
Fixed issue #40
Commit bbd98ba
As for memory, allowed to set time limit for consumer. It's usable for dirty apps, for example with MultipleConsumer, where can increase number of opened resources, which should be freed sometimes. When application doesn't do freeing in code, its good to be able "restart" it in predefined intervals to do this wrong way. (Restart = self-suicide and restart by supervisord. When parameter- t were introduced, you can now do this whole in supervisor config)