summaryrefslogtreecommitdiff
path: root/src/rabbit_channel.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_channel.erl
parentd887a84c64321582266051b9a26ac9a9f1d1f6f7 (diff)
downloadrabbitmq-server-8304d8f8a8618b6e3aae73c18b4b2594d62fd67a.tar.gz
Refactored sender-supplied routing keys
Diffstat (limited to 'src/rabbit_channel.erl')
-rw-r--r--src/rabbit_channel.erl18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index 5c900b0b..e818dd54 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -527,18 +527,13 @@ handle_method(#'basic.publish'{exchange = ExchangeNameBin,
%% certain to want to look at delivery-mode and priority.
DecodedContent = rabbit_binary_parser:ensure_content_decoded(Content),
check_user_id_header(DecodedContent#content.properties, State),
- IsPersistent = is_message_persistent(DecodedContent),
{MsgSeqNo, State1} =
case ConfirmEnabled of
false -> {undefined, State};
true -> SeqNo = State#ch.publish_seqno,
{SeqNo, State#ch{publish_seqno = SeqNo + 1}}
end,
- Message = #basic_message{exchange_name = ExchangeName,
- routing_key = RoutingKey,
- content = DecodedContent,
- guid = rabbit_guid:guid(),
- is_persistent = IsPersistent},
+ Message = rabbit_basic:message(ExchangeName, RoutingKey, DecodedContent),
{RoutingRes, DeliveredQPids} =
rabbit_exchange:publish(
Exchange,
@@ -1200,17 +1195,6 @@ notify_limiter(LimiterPid, Acked) ->
Count -> rabbit_limiter:ack(LimiterPid, Count)
end.
-is_message_persistent(Content) ->
- case rabbit_basic:is_message_persistent(Content) of
- {invalid, Other} ->
- rabbit_log:warning("Unknown delivery mode ~p - "
- "treating as 1, non-persistent~n",
- [Other]),
- false;
- IsPersistent when is_boolean(IsPersistent) ->
- IsPersistent
- end.
-
process_routing_result(unroutable, _, MsgSeqNo, Message, State) ->
ok = basic_return(Message, State#ch.writer_pid, no_route),
send_confirms([MsgSeqNo], State);