You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -135,3 +135,26 @@ AioPikaBroker parameters:
135
135
*`qos` - number of messages that worker can prefetch.
136
136
*`declare_queues` - whether you want to declare queues even on
137
137
client side. May be useful for message persistance.
138
+
*`declare_queues_kwargs` - see [Custom Queue Arguments](#custom-queue-arguments) for more details.
139
+
140
+
## Custom Queue Arguments
141
+
142
+
You can pass custom arguments to the underlying RabbitMQ queue declaration by using the `declare_queues_kwargs` parameter of `AioPikaBroker`. If you want to set specific queue arguments (such as RabbitMQ extensions or custom behaviors), provide them in the `arguments` dictionary inside `declare_queues_kwargs`.
143
+
144
+
These arguments will be merged with the default arguments used by the broker (such as dead-lettering and priority settings).
145
+
146
+
**Example:**
147
+
148
+
```python
149
+
broker = AioPikaBroker(
150
+
declare_queues_kwargs={
151
+
"arguments": {
152
+
"x-message-ttl": 60000, # Set message TTL to 60 seconds
153
+
"x-queue-type": "quorum", # Use quorum queue type
154
+
}
155
+
}
156
+
)
157
+
```
158
+
159
+
This will ensure that the queue is created with your custom arguments, in addition to the broker's defaults.
0 commit comments