The following procedures describe how to send messages from QAnywhere applications. These procedures assume that you have created and opened a QAManager object.
Sending a message from your application does not ensure it is delivered from your device. It simply places the message on a queue to be delivered. The QAnywhere Agent performs the task of sending the message to the MobiLink server, which in turn delivers it to its destination.
For more information about when message transmission occurs, see Determining when message transmission should occur on the client.
Create a new message.
You can create either a text message or a binary message, using CreateTextMessage() or CreateBinaryMessage(), respectively.
QATextMessage msg; msg = mgr.CreateTextMessage(); |
Set message properties.
Use methods of the QATextMessage or QABinaryMessage class to set properties.
See QAnywhere messages.
Put the message on the queue, ready for sending.
mgr.PutMessage( "store-id\\queue-name", msg ); |
where store-id and queue-name are strings that combine to form the destination address.
See PutMessage method and Determining when message transmission should occur on the client.
Create a new message.
You can create either a text message or a binary message, using createTextMessage() or createBinaryMessage(), respectively.
QATextMessage * msg; msg = mgr->createTextMessage(); |
Set message properties.
Use methods of the QATextMessage or QABinaryMessage class to set message properties.
See QAnywhere messages.
Put the message on the queue, ready for sending.
if( msg != NULL ) { if( !mgr->putMessage( "store-id\\queue-name", msg ) ) { // Display error using mgr->getLastErrorMsg(). } mgr->deleteMessage( msg ); } |
where store-id and queue-name are strings that combine to form the destination address.
See putMessage method and Determining when message transmission should occur on the client.
Create a new message.
You can create a text message or a binary message, using QAManagerBase.createTextMessage() or QAManagerBase.createBinaryMessage(), respectively.
QATextMessage msg; msg = mgr.createTextMessage(); |
Set message properties.
Use QATextMessage or QABinaryMessage methods to set message properties.
See QAnywhere messages.
Put the message on the queue.
mgr.putMessage("store-id\\queue-name", msg); |
See putMessage method and Determining when message transmission should occur on the client.
Declare a variable to hold the message ID.
begin declare @msgid varchar(128); |
Create a new message.
set @msgid = ml_qa_createmessage(); |
Set message properties.
For more information, see Message properties.
Put the message on the queue.
call ml_qa_putmessage( @msgid, 'clientid\queuename' ); commit; end |
See ml_qa_putmessage and Determining when message transmission should occur on the client.
Implementing transactional messaging
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |