theLink 10.0
|
Documentation of the MyTransaction tool used for example.test
.
The MyTransaction tool is used to test the longterm-transaction-feature of atlmqmsgque.
To test this feature the client connect to the server and send two service-calls:
The service-call itself is quite simple:
Privat_Data_1 or Privat_Data_2
1111 or 2222
The GOAL for this test is:
package require lib_85 package require atlmqmsgque namespace import MqContextC::* proc callback {ctx} { ReadT_START $ctx set myPrivateHandle [ReadSTR $ctx] ReadT_END $ctx set myServiceResult [ReadI32 $ctx] puts "myPrivateHandle=$myPrivateHandle, myServiceResult=$myServiceResult" } # setup the client-context set ctx [myooX::NewN ::MqContextC] try { ConfigSetName $ctx "MyTransaction" # setup commandline arguments used for parsing set args [MkBufferListC::CreateLA {*}$argv] # check if the '--token' option is available, default "SRVC" set token [MkBufferListC::CheckOptionSTR $args "--token" "SRVC"] # connect to the server LinkCreate $ctx $args # register callback ServiceCreate $ctx CLB1 callback # send block using the LOW-Api SendSTART $ctx SendT_START $ctx SendSTR $ctx "Privat_Data_1" SendT_END $ctx SendI32 $ctx 11111 SendEND_AND_TRANSACTION $ctx $token CLB1 # send block using the HIGN-Api -> same as above, but shorter Send $ctx "T" CLB1 "$token:(C)I" "Privat_Data_2" 22222 # now we wait for exact ONE result of the $ctx ProcessEvent $ctx MQ_WAIT_OWN } on error {} { ErrorCatch $ctx } finally { Exit $ctx }