@@ -38,7 +38,7 @@ description() ->
3838 {description , <<" Picks one random local binding (queue) to route via (to)." >>}].
3939
4040route (# exchange {name = Name }, _Msg , _Opts ) ->
41- Matches = rabbit_router :match_routing_key (Name , ['_' ]),
41+ Matches = rabbit_router :match_routing_key (Name , [<<>> ]),
4242 case lists :filter (fun filter_local_queue /1 , Matches ) of
4343 [] ->
4444 [];
@@ -59,8 +59,9 @@ delete(_Serial, _X) -> ok.
5959policy_changed (_X1 , _X2 ) -> ok .
6060add_binding (_Serial , _X , _B ) -> ok .
6161remove_bindings (_Serial , _X , _Bs ) -> ok .
62- validate_binding (_X , # binding {destination = Dest }) ->
63- % % check destination is a classic queue
62+
63+ validate_binding (_X , # binding {destination = Dest ,
64+ key = <<>>}) ->
6465 case rabbit_amqqueue :lookup (Dest ) of
6566 {ok , Q } ->
6667 case amqqueue :get_type (Q ) of
@@ -75,12 +76,17 @@ validate_binding(_X, #binding{destination = Dest}) ->
7576 {error , {binding_invalid ,
7677 " Destination not found" ,
7778 []}}
78- end .
79+ end ;
80+ validate_binding (_X , # binding {key = BKey }) ->
81+ {error , {binding_invalid ,
82+ " Non empty binding '~s ' key not permitted" ,
83+ [BKey ]}}.
7984
8085assert_args_equivalence (X , Args ) ->
8186 rabbit_exchange :assert_args_equivalence (X , Args ).
8287
8388filter_local_queue (QName ) ->
89+ % % TODO: introduce lookup function that _only_ gets the pid
8490 case rabbit_amqqueue :lookup (QName ) of
8591 {ok , Q } ->
8692 case amqqueue :get_pid (Q ) of
0 commit comments