@@ -769,7 +769,10 @@ open(info, {OK, S, Data},
769
769
StatemData # statem_data {connection = Connection1 ,
770
770
connection_state = State2 }}
771
771
end ;
772
- open (info , {sac , {{subscription_id , SubId }, {active , Active }}},
772
+ open (info ,
773
+ {sac ,
774
+ {{subscription_id , SubId }, {active , Active },
775
+ {side_effects , Effects }}},
773
776
# statem_data {transport = Transport ,
774
777
connection = Connection0 ,
775
778
connection_state = ConnState0 } =
@@ -787,7 +790,8 @@ open(info, {sac, {{subscription_id, SubId}, {active, Active}}},
787
790
Connection0 ,
788
791
SubId ,
789
792
Active ,
790
- true ),
793
+ true ,
794
+ Effects ),
791
795
{Conn1 ,
792
796
ConnState0 # stream_connection_state {consumers =
793
797
Consumers0 #{SubId =>
@@ -1850,6 +1854,11 @@ handle_frame_post_auth(Transport,
1850
1854
ConsumerCounters =
1851
1855
atomics :new (2 , [{signed , false }]),
1852
1856
1857
+ response_ok (Transport ,
1858
+ Connection ,
1859
+ subscribe ,
1860
+ CorrelationId ),
1861
+
1853
1862
Active =
1854
1863
maybe_register_consumer (VirtualHost ,
1855
1864
Stream ,
@@ -1858,13 +1867,6 @@ handle_frame_post_auth(Transport,
1858
1867
Properties ,
1859
1868
Sac ),
1860
1869
1861
- Connection1 =
1862
- maybe_notify_consumer (Transport ,
1863
- Connection ,
1864
- SubscriptionId ,
1865
- Active ,
1866
- Sac ),
1867
-
1868
1870
ConsumerState =
1869
1871
# consumer {member_pid = LocalMemberPid ,
1870
1872
offset = OffsetSpec ,
@@ -1877,20 +1879,15 @@ handle_frame_post_auth(Transport,
1877
1879
properties = Properties ,
1878
1880
active = Active },
1879
1881
1880
- Connection2 =
1882
+ Connection1 =
1881
1883
maybe_monitor_stream (LocalMemberPid , Stream ,
1882
- Connection1 ),
1883
-
1884
- response_ok (Transport ,
1885
- Connection ,
1886
- subscribe ,
1887
- CorrelationId ),
1884
+ Connection ),
1888
1885
1889
1886
State1 =
1890
1887
maybe_dispatch_on_subscription (Transport ,
1891
1888
State ,
1892
1889
ConsumerState ,
1893
- Connection2 ,
1890
+ Connection1 ,
1894
1891
Consumers ,
1895
1892
Stream ,
1896
1893
SubscriptionId ,
@@ -1907,7 +1904,7 @@ handle_frame_post_auth(Transport,
1907
1904
StreamSubscriptions #{Stream =>
1908
1905
[SubscriptionId ]}
1909
1906
end ,
1910
- {Connection2 # stream_connection {stream_subscriptions
1907
+ {Connection1 # stream_connection {stream_subscriptions
1911
1908
=
1912
1909
StreamSubscriptions1 },
1913
1910
State1 }
@@ -2400,7 +2397,8 @@ handle_frame_post_auth(Transport,
2400
2397
ResponseOffsetSpec }}) ->
2401
2398
% % FIXME check response code? It's supposed to be OK all the time.
2402
2399
case maps :take (CorrelationId , Requests0 ) of
2403
- {{{subscription_id , SubscriptionId }}, Rs } ->
2400
+ {{{subscription_id , SubscriptionId }, {side_effects , _SideEffects }},
2401
+ Rs } ->
2404
2402
rabbit_log :debug (" Received consumer update response for subscription ~p " ,
2405
2403
[SubscriptionId ]),
2406
2404
Consumers1 =
@@ -2634,7 +2632,7 @@ maybe_register_consumer(VirtualHost,
2634
2632
SubscriptionId ),
2635
2633
Active .
2636
2634
2637
- maybe_notify_consumer (_ , Connection , _ , _ , false = _Sac ) ->
2635
+ maybe_notify_consumer (_ , Connection , _ , _ , _ , false = _Sac ) ->
2638
2636
Connection ;
2639
2637
maybe_notify_consumer (Transport ,
2640
2638
# stream_connection {socket = S ,
@@ -2644,15 +2642,18 @@ maybe_notify_consumer(Transport,
2644
2642
Connection ,
2645
2643
SubscriptionId ,
2646
2644
Active ,
2647
- true = _Sac ) ->
2645
+ true = _Sac ,
2646
+ SideEffects ) ->
2648
2647
rabbit_log :debug (" SAC subscription ~p , active = ~p " ,
2649
2648
[SubscriptionId , Active ]),
2650
2649
Frame =
2651
2650
rabbit_stream_core :frame ({request , CorrIdSeq ,
2652
2651
{consumer_update , SubscriptionId , Active }}),
2653
2652
2654
2653
OutstandingRequests1 =
2655
- maps :put (CorrIdSeq , {{subscription_id , SubscriptionId }},
2654
+ maps :put (CorrIdSeq ,
2655
+ {{subscription_id , SubscriptionId },
2656
+ {side_effects , SideEffects }},
2656
2657
OutstandingRequests0 ),
2657
2658
send (Transport , S , Frame ),
2658
2659
Connection # stream_connection {correlation_id_sequence = CorrIdSeq + 1 ,
0 commit comments