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

SQL Anywhere 11.0.1 (中文) » QAnywhere » QAnywhere 参考 » QAnywhere SQL API 参考 » 消息属性、标头和内容 » 消息标头

 

ml_qa_setexpiration

设置消息到期时间。

参数
说明 注释
1 消息 ID VARCHAR(128)。可从 ml_qa_createmessage 或 ml_qa_getmessage 获取消息 ID。
2 到期时间 TIMESTAMP
注释

接收消息后就可以读取此标头,一直到执行回退或提交;执行回退或提交后就不能再读取此标头。

另请参见
示例

在下面的示例中,创建一条消息,如果在随后的 3 天内未传送,则该消息到期:

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