summaryrefslogtreecommitdiff
path: root/src/rabbit_exchange_type_direct.erl
diff options
context:
space:
mode:
authorEmile Joubert <emile@rabbitmq.com>2011-02-02 13:41:24 +0000
committerEmile Joubert <emile@rabbitmq.com>2011-02-02 13:41:24 +0000
commit8304d8f8a8618b6e3aae73c18b4b2594d62fd67a (patch)
tree8a01b35b7691bfd83e0174aad7c850c744e722a9 /src/rabbit_exchange_type_direct.erl
parentd887a84c64321582266051b9a26ac9a9f1d1f6f7 (diff)
downloadrabbitmq-server-8304d8f8a8618b6e3aae73c18b4b2594d62fd67a.tar.gz
Refactored sender-supplied routing keys
Diffstat (limited to 'src/rabbit_exchange_type_direct.erl')
-rw-r--r--src/rabbit_exchange_type_direct.erl45
1 files changed, 13 insertions, 32 deletions
diff --git a/src/rabbit_exchange_type_direct.erl b/src/rabbit_exchange_type_direct.erl
index 97988381..0baac1f8 100644
--- a/src/rabbit_exchange_type_direct.erl
+++ b/src/rabbit_exchange_type_direct.erl
@@ -1,37 +1,21 @@
-%% The contents of this file are subject to the Mozilla Public License
-%% Version 1.1 (the "License"); you may not use this file except in
-%% compliance with the License. You may obtain a copy of the License at
-%% http://www.mozilla.org/MPL/
+%% The contents of this file are subject to the Mozilla Public License
+%% Version 1.1 (the "License"); you may not use this file except in
+%% compliance with the License. You may obtain a copy of the License
+%% at http://www.mozilla.org/MPL/
%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-%% License for the specific language governing rights and limitations
-%% under the License.
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and
+%% limitations under the License.
%%
-%% The Original Code is RabbitMQ.
+%% The Original Code is RabbitMQ.
%%
-%% The Initial Developers of the Original Code are LShift Ltd,
-%% Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd.
-%%
-%% Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd,
-%% Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd
-%% are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
-%% Technologies LLC, and Rabbit Technologies Ltd.
-%%
-%% Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
-%% Ltd. Portions created by Cohesive Financial Technologies LLC are
-%% Copyright (C) 2007-2010 Cohesive Financial Technologies
-%% LLC. Portions created by Rabbit Technologies Ltd are Copyright
-%% (C) 2007-2010 Rabbit Technologies Ltd.
-%%
-%% All Rights Reserved.
-%%
-%% Contributor(s): ______________________________________.
+%% The Initial Developer of the Original Code is VMware, Inc.
+%% Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
%%
-module(rabbit_exchange_type_direct).
-include("rabbit.hrl").
--include("rabbit_framing.hrl").
-behaviour(rabbit_exchange_type).
@@ -52,12 +36,9 @@ description() ->
{description, <<"AMQP direct exchange, as per the AMQP specification">>}].
route(#exchange{name = Name},
- #delivery{message = #basic_message{routing_key = RoutingKey,
- content = Content}}) ->
- HeaderKeys = rabbit_exchange:header_routes(
- (Content#content.properties)#'P_basic'.headers),
+ #delivery{message = #basic_message{route_list = Routes}}) ->
lists:flatten([rabbit_router:match_routing_key(Name, RKey) ||
- RKey <- [RoutingKey | HeaderKeys]]).
+ RKey <- Routes]).
validate(_X) -> ok.
create(_Tx, _X) -> ok.