Feature/sqs bulk messages#6
Merged
tejerka merged 7 commits intosemji:mastersemji/queue-client:masterfrom Jan 27, 2016
neverdane:feature/sqs-bulk-messagesneverdane/queue-client:feature/sqs-bulk-messagesCopy head branch name to clipboard
Merged
Feature/sqs bulk messages#6tejerka merged 7 commits intosemji:mastersemji/queue-client:masterfrom neverdane:feature/sqs-bulk-messagesneverdane/queue-client:feature/sqs-bulk-messagesCopy head branch name to clipboard
tejerka merged 7 commits intosemji:mastersemji/queue-client:masterfrom
neverdane:feature/sqs-bulk-messagesneverdane/queue-client:feature/sqs-bulk-messagesCopy head branch name to clipboard
Conversation
The addMessage method tested if the queues to process were contained in an array in order to iterate through them otherwise we assumed it was the queueName only. This condition was useless and duplicated some lines of code as we could directly cast the given queues as an array.
The addMessages method called the addMessage for each message. This addMessage resolved each time the alias queue name whereas it was already done the first time. We only had to resolve it at the beginning of addMessages and call the adapter's method for each message.
We have common behaviours in some adapters methods. In order to share these behaviours, we inherit all Adapters from an AbstractAdapter (which is empty for the moment).
Instead of iterating through each message, we can call the method addMessages of the adapter which can now be overridden by each adapter as it inherits from AbstractAdapter.
We used to iterate through each message and therefore send each message individually which added a performance issue. Instead, we prefer to send pools of 10 messages in order to minimize API calls.
Some addMessages conditions weren't tested which reduced the unit tests code coverage.
b04c824 to
a9914db
Compare
Contributor
There was a problem hiding this comment.
$this
->given($NullAdapter = new \ReputationVIP\QueueClient\Adapter\NullAdapter())
->then
->object($NullAdapter->addMessages('testQueue', ['test Message one']))
->isInstanceOf('\ReputationVIP\QueueClient\Adapter\AdapterInterface')
;
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.
We used to iterate through each message and therefore send each message individually which added a performance issue. Instead, we prefer to send pools of 10 messages in order to minimize API calls.