Skip to content

Commit

Permalink
Merge pull request #14 from depop/DD-9086-add-consumer-prefetch-count
Browse files Browse the repository at this point in the history
DD-9086 Add PREFETCH_COUNT setting for the kombu consumer
  • Loading branch information
pallamidessi committed Dec 10, 2018
2 parents 9034be8 + 9eb3c2e commit 8d25d85
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion event_consumer/__about__.py
@@ -1,4 +1,4 @@
__version__ = '1.1.0'
__version__ = '1.1.1'


if __name__ == '__main__':
Expand Down
3 changes: 3 additions & 0 deletions event_consumer/conf/defaults.py
Expand Up @@ -28,6 +28,9 @@

RETRY_HEADER = 'x-retry-count'

# Set the consumer prefetch limit
PREFETCH_COUNT = 1

# to set TTL for archived message (milliseconds)
ARCHIVE_EXPIRY = int(timedelta(days=24).total_seconds() * 1000) # type: int
# max size of archive queue before dropping messages
Expand Down
2 changes: 2 additions & 0 deletions event_consumer/handlers.py
Expand Up @@ -300,6 +300,8 @@ def __init__(self,
accept=settings.ACCEPT,
)

self.consumer.qos(prefetch_count=settings.PREFETCH_COUNT)

def __repr__(self):
return (
"AMQPRetryHandler("
Expand Down

0 comments on commit 8d25d85

Please sign in to comment.