在当前事务提交之前,与返回的消息对应的消息将不被视为已收到。一旦接收被提交,此 QAnywhere API 或其它任何 QAnywhere API 就不能再次收到该消息。同样,对当前事务的回退表示未收到该消息,这样,对 ml_qa_getmessagenowait
的后续调用可能会返回同一个消息 ID。
begin
declare @msgid varchar(128);
loop
set @msgid = ml_qa_getmessagenowait( 'myaddress' );
if @msgid is null then leave end if;
message 'a message with content ' || ml_qa_gettextcontent( @msgid ) || ' has been received';
end loop;
commit;
end