@@ -36,6 +36,7 @@ def __init__(
3636 binding_type : AmqpBindingType = AmqpBindingType .QUEUE ,
3737 queue_properties : dict [str , Any ] | None = None ,
3838 binding_arguments : dict [str , Any ] | None = None ,
39+ arguments : dict [str , Any ] | None = None ,
3940 ):
4041 self ._connection = connection
4142 self ._queue_name = queue_name
@@ -45,6 +46,7 @@ def __init__(
4546 self ._binding_type = binding_type
4647 self ._queue_properties = queue_properties or {}
4748 self ._binding_arguments = binding_arguments or {}
49+ self ._arguments = arguments or {}
4850 self ._channel : AbstractChannel | None = None
4951 self ._queue : AbstractQueue | None = None
5052 self ._exchange : AbstractExchange | None = None
@@ -67,6 +69,7 @@ async def start(self) -> None:
6769 durable = self ._queue_properties .get ("durable" , True ),
6870 exclusive = self ._queue_properties .get ("exclusive" , False ),
6971 auto_delete = self ._queue_properties .get ("auto_delete" , False ),
72+ arguments = self ._arguments ,
7073 )
7174
7275 # Simple queue binding pattern (default exchange)
@@ -76,6 +79,7 @@ async def start(self) -> None:
7679 durable = self ._queue_properties .get ("durable" , True ),
7780 exclusive = self ._queue_properties .get ("exclusive" , False ),
7881 auto_delete = self ._queue_properties .get ("auto_delete" , False ),
82+ arguments = self ._arguments ,
7983 )
8084
8185 # Routing key binding pattern (pub/sub with named exchange)
@@ -87,24 +91,28 @@ async def start(self) -> None:
8791 name = self ._exchange_name ,
8892 type = ExchangeType .DIRECT ,
8993 durable = True ,
94+ arguments = self ._arguments ,
9095 )
9196 case "topic" :
9297 self ._exchange = await self ._channel .declare_exchange (
9398 name = self ._exchange_name ,
9499 type = ExchangeType .TOPIC ,
95100 durable = True ,
101+ arguments = self ._arguments ,
96102 )
97103 case "fanout" :
98104 self ._exchange = await self ._channel .declare_exchange (
99105 name = self ._exchange_name ,
100106 type = ExchangeType .FANOUT ,
101107 durable = True ,
108+ arguments = self ._arguments ,
102109 )
103110 case "headers" :
104111 self ._exchange = await self ._channel .declare_exchange (
105112 name = self ._exchange_name ,
106113 type = ExchangeType .HEADERS ,
107114 durable = True ,
115+ arguments = self ._arguments ,
108116 )
109117 case unknown_type :
110118 raise ValueError (f"Unsupported exchange type: { unknown_type } " )
@@ -115,6 +123,7 @@ async def start(self) -> None:
115123 durable = self ._queue_properties .get ("durable" , False ),
116124 exclusive = self ._queue_properties .get ("exclusive" , True ),
117125 auto_delete = self ._queue_properties .get ("auto_delete" , True ),
126+ arguments = self ._arguments ,
118127 )
119128
120129 # Bind queue to exchange with routing key
@@ -129,24 +138,28 @@ async def start(self) -> None:
129138 name = self ._exchange_name ,
130139 type = ExchangeType .FANOUT ,
131140 durable = True ,
141+ arguments = self ._arguments ,
132142 )
133143 case "headers" :
134144 self ._exchange = await self ._channel .declare_exchange (
135145 name = self ._exchange_name ,
136146 type = ExchangeType .HEADERS ,
137147 durable = True ,
148+ arguments = self ._arguments ,
138149 )
139150 case "topic" :
140151 self ._exchange = await self ._channel .declare_exchange (
141152 name = self ._exchange_name ,
142153 type = ExchangeType .TOPIC ,
143154 durable = True ,
155+ arguments = self ._arguments ,
144156 )
145157 case "direct" :
146158 self ._exchange = await self ._channel .declare_exchange (
147159 name = self ._exchange_name ,
148160 type = ExchangeType .DIRECT ,
149161 durable = True ,
162+ arguments = self ._arguments ,
150163 )
151164 case unknown_type :
152165 raise ValueError (f"Unsupported exchange type: { unknown_type } " )
@@ -157,6 +170,7 @@ async def start(self) -> None:
157170 durable = self ._queue_properties .get ("durable" , False ),
158171 exclusive = self ._queue_properties .get ("exclusive" , True ),
159172 auto_delete = self ._queue_properties .get ("auto_delete" , True ),
173+ arguments = self ._arguments ,
160174 )
161175
162176 # Bind queue to exchange with binding arguments (for headers exchange)
0 commit comments