@@ -243,9 +243,14 @@ list(VHostPath) ->
243
243
destination = VHostResource ,
244
244
_ = '_' },
245
245
_ = '_' },
246
- [B || # route {binding = B } <- mnesia :dirty_match_object (rabbit_route ,
247
- Route )].
248
-
246
+ implicit_bindings (VHostPath ) ++
247
+ [B || # route {binding = B } <- mnesia :dirty_match_object (rabbit_route ,
248
+ Route )].
249
+
250
+ list_for_source (# resource {kind = exchange ,
251
+ virtual_host = VHostPath ,
252
+ name = <<>>}) ->
253
+ implicit_bindings (VHostPath );
249
254
list_for_source (SrcName ) ->
250
255
mnesia :async_dirty (
251
256
fun () ->
@@ -255,16 +260,46 @@ list_for_source(SrcName) ->
255
260
end ).
256
261
257
262
list_for_destination (DstName ) ->
258
- mnesia :async_dirty (
259
- fun () ->
260
- Route = # route {binding = # binding {destination = DstName ,
261
- _ = '_' }},
262
- [reverse_binding (B ) ||
263
- # reverse_route {reverse_binding = B } <-
264
- mnesia :match_object (rabbit_reverse_route ,
265
- reverse_route (Route ), read )]
266
- end ).
267
-
263
+ implicit_for_destination (DstName ) ++
264
+ mnesia :async_dirty (
265
+ fun () ->
266
+ Route = # route {binding = # binding {destination = DstName ,
267
+ _ = '_' }},
268
+ [reverse_binding (B ) ||
269
+ # reverse_route {reverse_binding = B } <-
270
+ mnesia :match_object (rabbit_reverse_route ,
271
+ reverse_route (Route ), read )]
272
+ end ).
273
+
274
+ implicit_bindings (VHostPath ) ->
275
+ DstQueues = rabbit_amqqueue :list_names (VHostPath ),
276
+ DefaultExchange = # resource {virtual_host = VHostPath ,
277
+ kind = exchange ,
278
+ name = <<>>},
279
+ [ # binding {source = DefaultExchange ,
280
+ destination = DstQueue ,
281
+ key = QName }
282
+ || DstQueue = # resource {name = QName } <- DstQueues ].
283
+
284
+ implicit_for_destination (DstQueue = # resource {kind = queue ,
285
+ virtual_host = VHostPath ,
286
+ name = QName }) ->
287
+ DefaultExchange = # resource {virtual_host = VHostPath ,
288
+ kind = exchange ,
289
+ name = <<>>},
290
+ [# binding {source = DefaultExchange ,
291
+ destination = DstQueue ,
292
+ key = QName }];
293
+ implicit_for_destination (_ ) ->
294
+ [].
295
+
296
+ list_for_source_and_destination (# resource {kind = exchange ,
297
+ virtual_host = VHostPath ,
298
+ name = <<>>} = DefaultExchange ,
299
+ # resource {kind = queue ,
300
+ virtual_host = VHostPath ,
301
+ name = QName } = DstQueue ) ->
302
+ [# binding {source = DefaultExchange , destination = DstQueue , key = QName }];
268
303
list_for_source_and_destination (SrcName , DstName ) ->
269
304
mnesia :async_dirty (
270
305
fun () ->
0 commit comments