9090-define (MAX_PERMISSION_CACHE_SIZE , 12 ).
9191-define (HIBERNATE_AFTER , 6_000 ).
9292-define (CREDIT_REPLY_TIMEOUT , 30_000 ).
93- -define (CAP_RABBITMQ_VOLATILE_QUEUE , <<" rabbitmq:volatile-queue" >>).
9493% % Capability defined in amqp-bindmap-jms-v1.0-wd10 [5.2] and sent by Qpid JMS client.
9594-define (CAP_TEMPORARY_QUEUE , <<" temporary-queue" >>).
95+ -define (CAP_VOLATILE_QUEUE , <<" rabbitmq:volatile-queue" >>).
9696
9797-export ([start_link /9 ,
9898 process_frame /2 ,
@@ -2756,14 +2756,14 @@ ensure_source(#'v1_0.source'{
27562756 ConnPid , PermCache0 , TopicPermCache ) ->
27572757 FFEnabled = rabbit_volatile_queue :ff_enabled (),
27582758 case maps :from_keys (Caps , true ) of
2759- #{{symbol , ? CAP_RABBITMQ_VOLATILE_QUEUE } := true }
2759+ #{{symbol , ? CAP_VOLATILE_QUEUE } := true }
27602760 when (Durable =:= undefined orelse Durable =:= ? V_1_0_TERMINUS_DURABILITY_NONE ) andalso
27612761 ExpiryPolicy =:= ? V_1_0_TERMINUS_EXPIRY_POLICY_LINK_DETACH andalso
27622762 (Timeout =:= undefined orelse Timeout =:= {uint , 0 }) andalso
27632763 SndSettled andalso
27642764 FFEnabled ->
27652765 % % create volatile queue
2766- QNameBin = rabbit_volatile_queue :generate_name ( self () ),
2766+ QNameBin = rabbit_volatile_queue :new_name ( ),
27672767 Source = # 'v1_0.source' {
27682768 address = {utf8 , queue_address (QNameBin )},
27692769 durable = Durable ,
@@ -2772,7 +2772,7 @@ ensure_source(#'v1_0.source'{
27722772 dynamic = true ,
27732773 dynamic_node_properties = dynamic_node_properties (),
27742774 distribution_mode = ? V_1_0_STD_DIST_MODE_MOVE ,
2775- capabilities = rabbit_amqp_util :capabilities ([? CAP_RABBITMQ_VOLATILE_QUEUE ])
2775+ capabilities = rabbit_amqp_util :capabilities ([? CAP_VOLATILE_QUEUE ])
27762776 },
27772777 QName = rabbit_misc :queue_resource (Vhost , QNameBin ),
27782778 {ok , QName , Source , PermCache0 , TopicPermCache };
@@ -3521,30 +3521,15 @@ error_if_absent(Kind, Vhost, Name) when is_list(Name) ->
35213521error_if_absent (Kind , Vhost , Name ) when is_binary (Name ) ->
35223522 error_if_absent (rabbit_misc :r (Vhost , Kind , Name )).
35233523
3524- error_if_absent (# resource {kind = exchange } = XName ) ->
3525- case rabbit_exchange :exists (XName ) of
3526- true ->
3527- ok ;
3528- false ->
3529- link_error_not_found (XName )
3524+ error_if_absent (# resource {kind = exchange } = Name ) ->
3525+ case rabbit_exchange :exists (Name ) of
3526+ true -> ok ;
3527+ false -> link_error_not_found (Name )
35303528 end ;
3531- error_if_absent (# resource {kind = queue ,
3532- name = QNameBin } = QName ) ->
3533- case rabbit_volatile_queue :is (QNameBin ) of
3534- true ->
3535- case rabbit_volatile_queue :exists (QName ) of
3536- true ->
3537- ok ;
3538- false ->
3539- link_error_not_found (QName )
3540- end ;
3541- false ->
3542- case rabbit_amqqueue :exists (QName ) of
3543- true ->
3544- ok ;
3545- false ->
3546- link_error_not_found (QName )
3547- end
3529+ error_if_absent (# resource {kind = queue } = Name ) ->
3530+ case rabbit_amqqueue :exists (Name ) of
3531+ true -> ok ;
3532+ false -> link_error_not_found (Name )
35483533 end .
35493534
35503535generate_queue_name_v1 () ->
0 commit comments