Comparing version 3.1.0 to 3.2.0
3.2.0 / 2018-10-17 | ||
================== | ||
**features** | ||
* [[`8ec58c8`](http://github.com/ali-sdk/ali-ons/commit/8ec58c8f773633a4f1bb0341306d89afda1972e5)] - feat: unify aliyun keys to accessKeyID and accessKeySecret (fengmk2 <<fengmk2@gmail.com>>) | ||
**others** | ||
* [[`9ecd381`](http://github.com/ali-sdk/ali-ons/commit/9ecd381f7079d7be6f2551a6baabfc51cdefde46)] - f (fengmk2 <<fengmk2@gmail.com>>) | ||
* [[`742f269`](http://github.com/ali-sdk/ali-ons/commit/742f269534c2e30f0772663ca3690ad000d9c75e)] - f (fengmk2 <<fengmk2@gmail.com>>) | ||
3.1.0 / 2018-09-14 | ||
@@ -3,0 +13,0 @@ ================== |
@@ -22,2 +22,5 @@ 'use strict'; | ||
const arr = address.split(':'); | ||
// support alias: accessKeyID and accessKeySecret | ||
options.accessKey = options.accessKey || options.accessKeyID; | ||
options.secretKey = options.secretKey || options.accessKeySecret; | ||
super(Object.assign({ | ||
@@ -24,0 +27,0 @@ host: arr[0], |
{ | ||
"name": "ali-ons", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "Aliyun Open Notification Service Client", | ||
"main": "./lib/index.js", | ||
"main": "lib/index.js", | ||
"files": [ | ||
@@ -7,0 +7,0 @@ "lib" |
@@ -7,3 +7,2 @@ ali-ons | ||
[![David deps][david-image]][david-url] | ||
[![node version][node-image]][node-url] | ||
@@ -16,4 +15,2 @@ [npm-image]: https://img.shields.io/npm/v/ali-ons.svg?style=flat-square | ||
[david-url]: https://david-dm.org/ali-sdk/ali-ons | ||
[node-image]: https://img.shields.io/badge/node.js-%3E=_4.2.3-green.svg?style=flat-square | ||
[node-url]: http://nodejs.org/download/ | ||
@@ -41,4 +38,4 @@ Aliyun Open Notification Service Client (base on opensource project [RocketMQ](https://github.com/alibaba/RocketMQ/tree/master/rocketmq-client)) | ||
httpclient, | ||
accessKey: 'your-accesskey', | ||
secretKey: 'your-secretkey', | ||
accessKeyID: 'your-AccessKeyID', | ||
accessKeySecret: 'your-AccessKeySecret', | ||
consumerGroup: 'your-consumer-group', | ||
@@ -59,3 +56,3 @@ // isBroadcast: true, | ||
'use strict'; | ||
const co = require('co'); | ||
const httpclient = require('urllib'); | ||
@@ -67,9 +64,8 @@ const Producer = require('ali-ons').Producer; | ||
httpclient, | ||
accessKey: 'your-accesskey', | ||
secretKey: 'your-secretkey', | ||
accessKeyID: 'your-AccessKeyID', | ||
accessKeySecret: 'your-AccessKeySecret', | ||
producerGroup: 'your-producer-group', | ||
}); | ||
producer.ready(() => { | ||
console.log('producer ready'); | ||
(async () => { | ||
const msg = new Message('your-topic', // topic | ||
@@ -80,4 +76,8 @@ 'TagA', // tag | ||
producer.send(msg, (err, sendResult) => console.log(err, sendResult)); | ||
}); | ||
// set Message#keys | ||
msg.keys = ['key1']; | ||
const sendResult = await producer.send(msg); | ||
console.log(sendResult); | ||
})().catch(err => console.error(err)) | ||
``` | ||
@@ -84,0 +84,0 @@ |
140268
3913