Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.0 » QAnywhere » QAnywhere API Reference » QAnywhere SQL API reference » Message properties, headers, and content » Message headers

 

ml_qa_setexpiration

Sets the expiration time for a message.

Parameters
Item Description Remarks
1 Message ID VARCHAR(128). You can obtain the message ID from ml_qa_createmessage or ml_qa_getmessage.
2 Expiration TIMESTAMP
Remarks

You can read this header after a message is received and until a rollback or commit occurs; after that you cannot read it.

See also
Example

In the following example, a message is created so that if it is not delivered within the next 3 days it expires:

begin
    declare @msgid varchar(128);
    set @msgid = ml_qa_createmessage();
    call ml_qa_setexpiration( @msgid, dateadd( day, 3, current timestamp ) );
    call ml_qa_settextcontent( @msgid, 'time-limited offer' );
    call ml_qa_putmessage( @msgid, 'clientid\queuename' );
    commit;
end