@@ -18,7 +18,7 @@ class SampleTxn(CommonService):
1818
1919 def initializing (self ):
2020 """Subscribe to a channel. Received messages must be acknowledged."""
21- self .subid = self ._transport .subscribe (
21+ self .subid = self .transport .subscribe (
2222 "transient.transaction" ,
2323 self .receive_message ,
2424 acknowledgement = True ,
@@ -41,29 +41,29 @@ def receive_message(self, header, message):
4141 self .log .info ("MsgID: {}" .format (header ["message-id" ]))
4242 assert header ["message-id" ]
4343
44- txn = self ._transport .transaction_begin ()
44+ txn = self .transport .transaction_begin ()
4545 self .log .info (f" 1. Txn: { txn } " )
4646 if self .crashpoint ():
47- self ._transport .transaction_abort (txn )
47+ self .transport .transaction_abort (txn )
4848 self .log .info ("--- Abort ---" )
4949 return
5050
51- self ._transport .ack (header ["message-id" ], self .subid , transaction = txn )
51+ self .transport .ack (header ["message-id" ], self .subid , transaction = txn )
5252 self .log .info (" 2. Ack" )
5353 if self .crashpoint ():
54- self ._transport .transaction_abort (txn )
54+ self .transport .transaction_abort (txn )
5555 self .log .info ("--- Abort ---" )
5656 return
5757
58- self ._transport .send ("transient.destination" , message , transaction = txn )
58+ self .transport .send ("transient.destination" , message , transaction = txn )
5959 self .log .info (" 3. Send" )
6060
6161 if self .crashpoint ():
62- self ._transport .transaction_abort (txn )
62+ self .transport .transaction_abort (txn )
6363 self .log .info ("--- Abort ---" )
6464 return
6565
66- self ._transport .transaction_commit (txn )
66+ self .transport .transaction_commit (txn )
6767 self .log .info (" 4. Commit" )
6868 self .log .info ("=== Done ===" )
6969
@@ -88,7 +88,7 @@ def initializing(self):
8888 def create_message (self ):
8989 """Create and send a unique message for this service."""
9090 self .counter += 1
91- self ._transport .send (
91+ self .transport .send (
9292 "transient.transaction" ,
9393 "TXMessage #%d\n ++++++++Produced@ %f"
9494 % (self .counter , (time .time () % 1000 ) * 1000 ),
0 commit comments