Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ headers that will be sent with every request from a connection. This setting
accepts a mapping of header names to `connection.header.Header` objects which
can retrieve values from get params, cookies etc.

### Fixed
- The message consumer queue is now declared `exclusive` instead of
`auto_delete`. RabbitMQ 4 refuses to declare a transient non-exclusive queue,
which stopped the consumer before it bound to the exchange, so no triggered
messages were delivered. The queue is private to a single consumer, so
`exclusive` is the correct declaration and also works on RabbitMQ 3. The test
suite pins RabbitMQ 3.13, matching the version our projects run, but the
consumer now works on both 3 and 4.

## [2.5.0] - 2019-10-02
### Added
- `Hub` objects now have the method `on_ping` that allows you to hook custom
Expand Down
6 changes: 2 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
version: '3.6'

services:
rabbitmq:
image: rabbitmq:management
image: rabbitmq:3.13-management
ports:
- ${RABBIT_MQ_PORT:-5672}:5672
- ${RABBIT_MQ_ADMIN_PORT:-15672}:15672
Expand Down Expand Up @@ -31,7 +29,7 @@ services:
- 8080:8080

nginx:
image: nginx
image: nginx:1.31
volumes:
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf
ports:
Expand Down
5 changes: 4 additions & 1 deletion high_templar/rabbitmq.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ async def run(app):

app.logger.debug("create queue {}".format(QUEUE_NAME))

# Exclusive rather than plain auto_delete: the queue is private
# to this consumer (its name carries a per-process uuid), and
# RabbitMQ 4 refuses to declare a transient non-exclusive queue.
queue = await channel.declare_queue(
QUEUE_NAME, auto_delete=True, durable=False
QUEUE_NAME, exclusive=True, durable=False
)
await queue.bind(exchange=config['exchange_name'], routing_key='*')

Expand Down
Loading