To receive messages synchronously, your application explicitly polls the queue for messages. It may poll the queue periodically, or when a user initiates a particular action such as clicking a Refresh button.
To receive messages synchronously (.NET)
Declare message objects to hold the incoming messages.
QAMessage msg; QATextMessage text_msg; |
Poll the message queue, collecting messages:
if(mgr.start()) { for(;;) { msg = mgr.GetMessageNoWait("queue-name"); if( msg == null ) { break; } addMessage( msg ); } mgr.stop(); } |
To receive messages synchronously (C++)
Declare message objects to hold the incoming messages.
QAMessage * msg; QATextMessage * text_msg; |
Poll the message queue, collecting messages:
if( mgr->start() ) { for( ;; ) { msg = mgr->getMessageNoWait( "queue-name" ); if( msg == NULL ) { break; } addMessage(msg); } mgr->stop(); } |
To receive messages synchronously (Java)
Declare message objects to hold the incoming messages.
QAMessage msg; QATextMessage text_message; |
Poll the message queue, collecting messages:
if(mgr.start()) { for ( ;; ) { msg = mgr.getMessageNoWait("queue-name"); if ( msg == null ) { break; } addMessage(msg); } mgr.stop(); } |
To receive messages synchronously (SQL)
Declare an object to hold the message ID.
begin declare @msgid varchar(128); |
Poll the message queue, collecting messages.
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 |
See:
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |