108
108
consumer_timeout ,
109
109
authz_context ,
110
110
% % defines how ofter gc will be executed
111
- writer_gc_threshold ,
112
- % % TODO delete
113
- % % true with AMQP 1.0 to include the publishing sequence
114
- % % in the return callback, false otherwise
115
- extended_return_callback
111
+ writer_gc_threshold
116
112
}).
117
113
118
114
-record (pending_ack , {
@@ -513,7 +509,6 @@ init([Channel, ReaderPid, WriterPid, ConnPid, ConnName, Protocol, User, VHost,
513
509
MaxMessageSize = get_max_message_size (),
514
510
ConsumerTimeout = get_consumer_timeout (),
515
511
OptionalVariables = extract_variable_map_from_amqp_params (AmqpParams ),
516
- UseExtendedReturnCallback = use_extended_return_callback (AmqpParams ),
517
512
{ok , GCThreshold } = application :get_env (rabbit , writer_gc_threshold ),
518
513
State = # ch {cfg = # conf {state = starting ,
519
514
protocol = Protocol ,
@@ -532,8 +527,7 @@ init([Channel, ReaderPid, WriterPid, ConnPid, ConnName, Protocol, User, VHost,
532
527
max_message_size = MaxMessageSize ,
533
528
consumer_timeout = ConsumerTimeout ,
534
529
authz_context = OptionalVariables ,
535
- writer_gc_threshold = GCThreshold ,
536
- extended_return_callback = UseExtendedReturnCallback
530
+ writer_gc_threshold = GCThreshold
537
531
},
538
532
limiter = Limiter ,
539
533
tx = none ,
@@ -1043,17 +1037,6 @@ extract_variable_map_from_amqp_params([Value]) ->
1043
1037
extract_variable_map_from_amqp_params (_ ) ->
1044
1038
#{}.
1045
1039
1046
- % %TODO delete
1047
- % %
1048
- % % Use tuple representation of amqp_params to avoid a dependency on amqp_client.
1049
- % % Used for AMQP 1.0
1050
- use_extended_return_callback ({amqp_params_direct ,_ ,_ ,_ ,_ ,
1051
- {amqp_adapter_info ,_ ,_ ,_ ,_ ,_ ,{'AMQP' ," 1.0" },_ },
1052
- _ }) ->
1053
- true ;
1054
- use_extended_return_callback (_ ) ->
1055
- false .
1056
-
1057
1040
check_msg_size (Content , MaxMessageSize , GCThreshold ) ->
1058
1041
Size = rabbit_basic :maybe_gc_large_msg (Content , GCThreshold ),
1059
1042
case Size of
@@ -1272,15 +1255,15 @@ handle_method(#'basic.publish'{exchange = ExchangeNameBin,
1272
1255
check_user_id_header (Props , State ),
1273
1256
check_expiration_header (Props ),
1274
1257
DoConfirm = Tx =/= none orelse ConfirmEnabled ,
1275
- {DeliveryOptions , SeqNum , State1 } =
1258
+ {DeliveryOptions , State1 } =
1276
1259
case DoConfirm of
1277
1260
false ->
1278
- {maps_put_truthy (flow , Flow , #{}), undefined , State0 };
1261
+ {maps_put_truthy (flow , Flow , #{}), State0 };
1279
1262
true ->
1280
1263
rabbit_global_counters :messages_received_confirm (amqp091 , 1 ),
1281
1264
SeqNo = State0 # ch .publish_seqno ,
1282
1265
Opts = maps_put_truthy (flow , Flow , #{correlation => SeqNo }),
1283
- {Opts , SeqNo , State0 # ch {publish_seqno = SeqNo + 1 }}
1266
+ {Opts , State0 # ch {publish_seqno = SeqNo + 1 }}
1284
1267
end ,
1285
1268
% rabbit_feature_flags:is_enabled(message_containers),
1286
1269
Message0 = mc_amqpl :message (ExchangeName ,
@@ -1291,7 +1274,7 @@ handle_method(#'basic.publish'{exchange = ExchangeNameBin,
1291
1274
[rabbit_channel :deliver_reply (RK , Message ) ||
1292
1275
{virtual_reply_queue , RK } <- QNames ],
1293
1276
Queues = rabbit_amqqueue :lookup_many (QNames ),
1294
- ok = process_routing_mandatory (Mandatory , Queues , SeqNum , Message , ExchangeName , State0 ),
1277
+ ok = process_routing_mandatory (Mandatory , Queues , Message , ExchangeName , State0 ),
1295
1278
rabbit_trace :tap_in (Message , QNames , ConnName , ChannelNum ,
1296
1279
Username , TraceState ),
1297
1280
% % TODO: call delivery_to_queues with plain args
@@ -2191,32 +2174,23 @@ deliver_to_queues(XName,
2191
2174
2192
2175
process_routing_mandatory (_Mandatory = true ,
2193
2176
_RoutedToQs = [],
2194
- MsgSeqNo ,
2195
2177
Msg ,
2196
2178
XName ,
2197
- State = # ch { cfg = # conf { extended_return_callback = ExtRetCallback }} ) ->
2179
+ State ) ->
2198
2180
rabbit_global_counters :messages_unroutable_returned (amqp091 , 1 ),
2199
2181
? INCR_STATS (exchange_stats , XName , 1 , return_unroutable , State ),
2200
- Content0 = mc :protocol_state (Msg ),
2201
- Content = case ExtRetCallback of
2202
- true ->
2203
- % % providing the publishing sequence for AMQP 1.0
2204
- {MsgSeqNo , Content0 };
2205
- false ->
2206
- Content0
2207
- end ,
2182
+ Content = mc :protocol_state (Msg ),
2208
2183
[RoutingKey | _ ] = mc :get_annotation (routing_keys , Msg ),
2209
2184
ok = basic_return (Content , RoutingKey , XName # resource .name , State , no_route );
2210
2185
process_routing_mandatory (_Mandatory = false ,
2211
2186
_RoutedToQs = [],
2212
- _MsgSeqNo ,
2213
2187
_Msg ,
2214
2188
XName ,
2215
2189
State ) ->
2216
2190
rabbit_global_counters :messages_unroutable_dropped (amqp091 , 1 ),
2217
2191
? INCR_STATS (exchange_stats , XName , 1 , drop_unroutable , State ),
2218
2192
ok ;
2219
- process_routing_mandatory (_ , _ , _ , _ , _ , _ ) ->
2193
+ process_routing_mandatory (_ , _ , _ , _ , _ ) ->
2220
2194
ok .
2221
2195
2222
2196
process_routing_confirm (undefined , _ , _ , State ) ->
0 commit comments