Comparing version 3.4.0 to 3.5.0
3.5.0 / 2019-03-25 | ||
================== | ||
**features** | ||
* [[`073058b9d8`](https://github.com/ali-sdk/ali-ons/commit/073058b9d8)] - **feat**: support delay deliver message (#65) (MarvinWilliam <<la805779602@hotmail.com>>) | ||
3.4.0 / 2019-03-13 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -29,1 +29,4 @@ 'use strict'; | ||
exports.KEY_SEPARATOR = ' '; | ||
// 延迟消息配置key | ||
exports.SYSTEM_PROP_KEY_STARTDELIVERTIME = '__STARTDELIVERTIME'; |
@@ -134,4 +134,21 @@ 'use strict'; | ||
} | ||
/** | ||
* 延迟执行的时间点,毫秒 | ||
* @param {number} delayTime 延迟执行目标时间戳 | ||
*/ | ||
setStartDeliverTime(delayTime) { | ||
this.properties[MessageConst.SYSTEM_PROP_KEY_STARTDELIVERTIME] = delayTime; | ||
} | ||
/** | ||
* 获取消息延迟时间 | ||
* @return {number} 延迟执行目标时间戳 | ||
*/ | ||
getStartDeliverTime() { | ||
return this.properties[MessageConst.SYSTEM_PROP_KEY_STARTDELIVERTIME] || 0; | ||
} | ||
} | ||
module.exports = Message; |
{ | ||
"name": "ali-ons", | ||
"version": "3.4.0", | ||
"version": "3.5.0", | ||
"description": "Aliyun Open Notification Service Client", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -74,2 +74,5 @@ ali-ons | ||
// delay consume | ||
// msg.setStartDeliverTime(Date.now() + 5000); | ||
const sendResult = await producer.send(msg); | ||
@@ -76,0 +79,0 @@ console.log(sendResult); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
150376
4133
91