Add clientProperties object to ConnectionOptions (#20277)

This commit is contained in:
Mark Line
2017-10-04 14:26:54 +01:00
committed by Masahiro Wakame
parent d06df01e3c
commit 0840a8fe71
2 changed files with 15 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ import * as amqp from 'amqp';
async function connect() {
const promise = new Promise<amqp.AMQPClient>((resolve, reject) => {
const client = amqp.createConnection({
clientProperties: { applicationName: 'typing' },
url: 'amqp://admin:password@localhost:5672'
});

14
types/amqp/index.d.ts vendored
View File

@@ -1,6 +1,7 @@
// Type definitions for amqp 0.2
// Project: https://github.com/postwait/node-amqp
// Definitions by: Carl Winkler <https://github.com/seikho>
// Mark Line <https://github.com/jonnysparkplugs>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
@@ -125,6 +126,19 @@ export interface ConnectionOptions {
/** Default: 1000 */
reconnectBackoffTime?: number;
clientProperties?: {
applicationName?: string;
capabilities?: {
consumer_cancel_notify?: boolean
}
/** Default: 'node-' + process.version */
platform?: string;
/** Default: node-amqp */
product?: string;
/** Default: 'nodeAMQPVersion' */
version?: string;
};
}
export interface QueueOptions {