File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
src/api/qpid-proton/reactor/handler Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -138,12 +138,14 @@ void TxReceiverHandler::on_session_open(session &s) {
138138 s.transaction_declare (*this );
139139 } else {
140140 logger (trace) << " [on_session_open] Transaction is declared: " << s.transaction_id ();
141+ credit = batch_size;
141142 if (count != 0 && (processed + batch_size > count)) {
142- batch_size = count % batch_size;
143+ credit = count % batch_size;
143144 } else if (count == 0 ) {
144145 batch_size = 1 ;
146+ credit = batch_size;
145147 }
146- recv.add_credit (batch_size );
148+ recv.add_credit (credit );
147149 logger (debug) << " [on_session_open] Receiver credit: " << recv.credit ();
148150 }
149151}
Original file line number Diff line number Diff line change @@ -157,6 +157,7 @@ class TxReceiverHandler : public ReceiverHandler {
157157 int batch_size = 10 ;
158158 int current_batch = 0 ;
159159 int processed = 0 ;
160+ int credit = 0 ;
160161 string tx_action = " commit" ;
161162 string tx_endloop_action = " none" ;
162163};
You can’t perform that action at this time.
0 commit comments