@@ -239,44 +239,44 @@ int TxReceiverHandler::getBatchSize() const
239
239
240
240
// reactor methods
241
241
242
- void TxReceiverHandler::on_session_open (session &s) override {
242
+ void TxReceiverHandler::on_session_open (session &s) {
243
243
sess = s;
244
244
std::cout << " [on_session_open] declare_txn started..." << std::endl;
245
245
s.declare_transaction (*this );
246
246
std::cout << " [on_session_open] declare_txn ended..." << std::endl;
247
247
}
248
248
249
- void on_transaction_declare_failed (transaction) {}
249
+ void TxReceiverHandler:: on_transaction_declare_failed (transaction) {}
250
250
251
- void on_transaction_commit_failed (proton:: transaction t) {
251
+ void TxReceiverHandler::on_transaction_commit_failed ( transaction t) {
252
252
std::cout << " Transaction Commit Failed" << std::endl;
253
253
t.connection ().close ();
254
254
exit (-1 );
255
255
}
256
256
257
- void TxReceiverHandler::on_transaction_declared (transaction t) override {
257
+ void TxReceiverHandler::on_transaction_declared (transaction t) {
258
258
std::cout << " [on_transaction_declared] txn called " << (&t)
259
259
<< std::endl;
260
260
std::cout << " [on_transaction_declared] txn is_empty " << (t.is_empty ())
261
- << " \t " << transaction .is_empty () << std::endl;
261
+ << " \t " << tx .is_empty () << std::endl;
262
262
recv.add_credit (batch_size);
263
- transaction = t;
263
+ tx = t;
264
264
}
265
265
266
- void TxReceiverHandler::on_message (delivery &d, message &msg) override {
266
+ void TxReceiverHandler::on_message (delivery &d, message &msg) {
267
267
std::cout<<" # MESSAGE: " << msg.id () <<" : " << msg.body () << std::endl;
268
- transaction .accept (d);
268
+ tx .accept (d);
269
269
current_batch += 1 ;
270
270
if (current_batch == batch_size) {
271
- transaction = proton:: transaction (); // null
271
+ tx = transaction (); // null
272
272
}
273
273
}
274
274
275
- void TxReceiverHandler::on_transaction_committed (transaction t) override {
276
- committed += current_batch;
275
+ void TxReceiverHandler::on_transaction_committed (transaction t) {
276
+ processed += current_batch;
277
277
current_batch = 0 ;
278
- std::cout<<" [OnTxnCommitted] Committed :" << committed << std::endl;
279
- if (committed == expected ) {
278
+ std::cout<<" [OnTxnCommitted] Processed :" << processed << std::endl;
279
+ if (processed == count ) {
280
280
std::cout << " All messages committed" << std::endl;
281
281
t.connection ().close ();
282
282
}
0 commit comments