rhea-promise
Advanced tools
Sorry, the diff of this file is not supported yet
| "use strict"; | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the Apache License. See License in the project root for license information. | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| const rhea_1 = require("rhea"); | ||
| const log = require("./log"); | ||
| const sender_1 = require("./sender"); | ||
| const rhea_2 = require("rhea"); | ||
| const errorDefinitions_1 = require("./errorDefinitions"); | ||
| /** | ||
| * Describes the sender where one can await on the message being sent. | ||
| * @class AwaitableSender | ||
| */ | ||
| class AwaitableSender extends sender_1.BaseSender { | ||
| constructor(session, sender, options = {}) { | ||
| super(session, sender, options); | ||
| /** | ||
| * @property {Map<number, PromiseLike} deliveryDispositionMap Maintains a map of delivery of | ||
| * messages that are being sent. It acts as a store for correlating the dispositions received | ||
| * for sent messages. | ||
| */ | ||
| this.deliveryDispositionMap = new Map(); | ||
| this.sendTimeoutInSeconds = options.sendTimeoutInSeconds || 20; | ||
| /** | ||
| * The handler that will be added on the Sender for `accepted` event. If the delivery id is | ||
| * present in the disposition map then it will clear the timer and resolve the promise with the | ||
| * delivery. | ||
| * @param delivery Delivery associated with message that was sent. | ||
| */ | ||
| const onSendSuccess = (delivery) => { | ||
| const id = delivery.id; | ||
| if (this.deliveryDispositionMap.has(delivery.id)) { | ||
| const promise = this.deliveryDispositionMap.get(id); | ||
| clearTimeout(promise.timer); | ||
| const deleteResult = this.deliveryDispositionMap.delete(id); | ||
| log.sender("[%s] Event: 'Accepted', Successfully deleted the delivery with id %d from " + | ||
| "the map of sender '%s' on amqp session '%s' and cleared the timer: %s.", this.connection.id, id, this.name, this.session.id, deleteResult); | ||
| return promise.resolve(delivery); | ||
| } | ||
| }; | ||
| /** | ||
| * The handler is added on the Sender for `rejected`, `released` and `modified` events. | ||
| * If the delivery is found in the disposition map then the timer will be cleared and the | ||
| * promise will be rejected with an appropriate error message. | ||
| * @param eventName Name of the event that was raised. | ||
| * @param id Delivery id. | ||
| * @param error Error from the context if any. | ||
| */ | ||
| const onSendFailure = (eventName, id, error) => { | ||
| if (this.deliveryDispositionMap.has(id)) { | ||
| const promise = this.deliveryDispositionMap.get(id); | ||
| clearTimeout(promise.timer); | ||
| const deleteResult = this.deliveryDispositionMap.delete(id); | ||
| log.sender("[%s] Event: '%s', Successfully deleted the delivery with id %d from the " + | ||
| " map of sender '%s' on amqp session '%s' and cleared the timer: %s.", this.connection.id, eventName, id, this.name, this.session.id, deleteResult); | ||
| const msg = `Sender '${this.name}' on amqp session '${this.session.id}', received a ` + | ||
| `'${eventName}' disposition. Hence we are rejecting the promise.`; | ||
| const err = new errorDefinitions_1.SendOperationFailedError(msg, eventName, error); | ||
| log.error("[%s] %s", this.connection.id, msg); | ||
| return promise.reject(err); | ||
| } | ||
| }; | ||
| /** | ||
| * The handler that will be added on the Sender link for `sender_error` and on it's underlying | ||
| * session for `session_error` event. These events are raised when the sender link or it's | ||
| * underlying session get disconnected. | ||
| * The handler will clear the timer and reject the promise for every pending send in the map. | ||
| * @param eventName Name of the event that was raised. | ||
| * @param error Error from the context if any | ||
| */ | ||
| const onError = (eventName, error) => { | ||
| for (const id of this.deliveryDispositionMap.keys()) { | ||
| onSendFailure(eventName, id, error); | ||
| } | ||
| }; | ||
| this.on(rhea_2.SenderEvents.accepted, (context) => { | ||
| onSendSuccess(context.delivery); | ||
| }); | ||
| this.on(rhea_2.SenderEvents.rejected, (context) => { | ||
| const delivery = context.delivery; | ||
| onSendFailure(rhea_2.SenderEvents.rejected, delivery.id, delivery.remote_state && delivery.remote_state.error); | ||
| }); | ||
| this.on(rhea_2.SenderEvents.released, (context) => { | ||
| const delivery = context.delivery; | ||
| onSendFailure(rhea_2.SenderEvents.released, delivery.id, delivery.remote_state && delivery.remote_state.error); | ||
| }); | ||
| this.on(rhea_2.SenderEvents.modified, (context) => { | ||
| const delivery = context.delivery; | ||
| onSendFailure(rhea_2.SenderEvents.modified, delivery.id, delivery.remote_state && delivery.remote_state.error); | ||
| }); | ||
| // The user may have it's custom reconnect logic for bringing the sender link back online and | ||
| // retry logic for sending messages on failures hence they can provide their error handlers | ||
| // for `sender_error` and `session_error`. | ||
| // If the user did not provide its error handler for `sender_error` and `session_error`, | ||
| // then we add our handlers and make sure we clear the timer and reject the promise for sending | ||
| // messages with appropriate Error. | ||
| if (!options.onError) { | ||
| this.on(rhea_2.SenderEvents.senderError, (context) => { | ||
| onError(rhea_2.SenderEvents.senderError, context.sender.error); | ||
| }); | ||
| } | ||
| if (!options.onSessionError) { | ||
| this.session.on(rhea_1.SessionEvents.sessionError, (context) => { | ||
| onError(rhea_1.SessionEvents.sessionError, context.session.error); | ||
| }); | ||
| } | ||
| } | ||
| /** | ||
| * Sends the message on which one can await to ensure that the message has been successfully | ||
| * delivered. | ||
| * @param {Message | Buffer} msg The message to be sent. For default AMQP format msg parameter | ||
| * should be of type Message interface. For a custom format, the msg parameter should be a Buffer | ||
| * and a valid value should be passed to the `format` argument. | ||
| * @param {Buffer | string} [tag] The message tag if any. | ||
| * @param {number} [format] The message format. Specify this if a message with custom format needs | ||
| * to be sent. `0` implies the standard AMQP 1.0 defined format. If no value is provided, then the | ||
| * given message is assumed to be of type Message interface and encoded appropriately. | ||
| * @returns {Promise<Delivery>} Promise<Delivery> The delivery information about the sent message. | ||
| */ | ||
| send(msg, tag, format) { | ||
| return new Promise((resolve, reject) => { | ||
| log.sender("[%s] Sender '%s' on amqp session '%s', credit: %d available: %d", this.connection.id, this.name, this.session.id, this.credit, this.session.outgoing.available()); | ||
| if (this.sendable()) { | ||
| const timer = setTimeout(() => { | ||
| this.deliveryDispositionMap.delete(delivery.id); | ||
| const message = `Sender '${this.name}' on amqp session ` + | ||
| `'${this.session.id}', with address '${this.address}' was not able to send the ` + | ||
| `message with delivery id ${delivery.id} right now, due to operation timeout.`; | ||
| log.error("[%s] %s", this.connection.id, message); | ||
| return reject(new errorDefinitions_1.OperationTimeoutError(message)); | ||
| }, this.sendTimeoutInSeconds * 1000); | ||
| const delivery = this._link.send(msg, tag, format); | ||
| this.deliveryDispositionMap.set(delivery.id, { | ||
| resolve: resolve, | ||
| reject: reject, | ||
| timer: timer | ||
| }); | ||
| } | ||
| else { | ||
| // Please send the message after some time. | ||
| const msg = `Sender "${this.name}" on amqp session "${this.session.id}", with address ` + | ||
| `${this.address} cannot send the message right now as it does not have ` + | ||
| `enough credit. Please try later.`; | ||
| log.error("[%s] %s", this.connection.id, msg); | ||
| reject(new errorDefinitions_1.InsufficientCreditError(msg)); | ||
| } | ||
| }); | ||
| } | ||
| } | ||
| exports.AwaitableSender = AwaitableSender; | ||
| //# sourceMappingURL=awaitableSender.js.map |
| {"version":3,"file":"awaitableSender.js","sourceRoot":"","sources":["../../lib/awaitableSender.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,8FAA8F;;AAE9F,+BAEc;AACd,6BAA6B;AAC7B,qCAAyD;AACzD,+BAAoC;AAGpC,yDAE4B;AA8B5B;;;GAGG;AACH,MAAa,eAAgB,SAAQ,mBAAU;IAc7C,YAAY,OAAgB,EAAE,MAAkB,EAAE,UAAkC,EAAE;QACpF,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QARlC;;;;WAIG;QACH,2BAAsB,GAA6B,IAAI,GAAG,EAAuB,CAAC;QAIhF,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,IAAI,EAAE,CAAC;QAC/D;;;;;WAKG;QACH,MAAM,aAAa,GAAG,CAAC,QAAkB,EAAE,EAAE;YAC3C,MAAM,EAAE,GAAG,QAAQ,CAAC,EAAE,CAAC;YACvB,IAAI,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;gBAChD,MAAM,OAAO,GAAG,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,EAAE,CAAgB,CAAC;gBACnE,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBAC5B,MAAM,YAAY,GAAG,IAAI,CAAC,sBAAs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M,OAAO,GAAG,WAAW,IAAI,CAAC,IAAI,oBAAoB;wBACtD,IAAI,IAAI,CAAC,OAAO,CAAC,EAAE,oBAAoB,IAAI,CAAC,OAAO,6BAA6B;wBAChF,4BAA4B,QAAQ,CAAC,EAAE,uCAAuC,CAAC;oBACjF,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;oBAClD,OAAO,MAAM,CAAC,IAAI,wCAAqB,CAAC,OAAO,CAAC,CAAC,CAAC;gBACpD,CAAC,EAAE,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;gBAErC,MAAM,QAAQ,GAAI,IAAI,CAAC,KAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;gBACnE,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE;oBAC3C,OAAO,EAAE,OAAO;oBAChB,MAAM,EAAE,MAAM;oBACd,KAAK,EAAE,KAAK;iBACb,CAAC,CAAC;aACJ;iBAAM;gBACL,2CAA2C;gBAC3C,MAAM,GAAG,GACP,WAAW,IAAI,CAAC,IAAI,sBAAsB,IAAI,CAAC,OAAO,CAAC,EAAE,kBAAkB;oBAC3E,GAAG,IAAI,CAAC,OAAO,yDAAyD;oBACxE,kCAAkC,CAAC;gBACrC,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;gBAC9C,MAAM,CAAC,IAAI,0CAAuB,CAAC,GAAG,CAAC,CAAC,CAAC;aAC1C;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA/JD,0CA+JC"} |
| "use strict"; | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the Apache License. See License in the project root for license information. | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| /** | ||
| * Defines the error that occurs when an operation timeout occurs. | ||
| */ | ||
| class OperationTimeoutError extends Error { | ||
| constructor(message) { | ||
| super(message); | ||
| /** | ||
| * Describes the name of the error. | ||
| */ | ||
| this.name = "OperationTimeoutError"; | ||
| } | ||
| } | ||
| exports.OperationTimeoutError = OperationTimeoutError; | ||
| /** | ||
| * Defines the error that occurs when the Sender does not have enough credit. | ||
| */ | ||
| class InsufficientCreditError extends Error { | ||
| constructor(message) { | ||
| super(message); | ||
| /** | ||
| * Describes the name of the error. | ||
| */ | ||
| this.name = "InsufficientCreditError"; | ||
| } | ||
| } | ||
| exports.InsufficientCreditError = InsufficientCreditError; | ||
| /** | ||
| * Defines the error that occurs when the Sender fails to send a message. | ||
| */ | ||
| class SendOperationFailedError extends Error { | ||
| constructor( | ||
| /** | ||
| * Provides descriptive information about the error. | ||
| */ | ||
| message, | ||
| /** | ||
| * Provides the corresponding event associated with the `SendOperationFailedError`. | ||
| * - If the code is `"sender_error"` | `"session_error"`, then the send operation failed | ||
| * due to the sender link getting disconnected. | ||
| * - If the code is `"rejected"` | `"released"` | `"modified"`, then the send operation failed | ||
| * because the server is currently unable to accept the message being sent. Please take a look | ||
| * at the [AMQP 1.0 specification - "Section 3.4 Delivery State"](http://www.amqp.org/sites/amqp.org/files/amqp.pdf) | ||
| * for details about `"rejected"` | `"released"` | `"modified"` disposition. | ||
| */ | ||
| code, | ||
| /** | ||
| * Describes the underlying error that caused the send operation to fail. | ||
| */ | ||
| innerError) { | ||
| super(message); | ||
| this.message = message; | ||
| this.code = code; | ||
| this.innerError = innerError; | ||
| /** | ||
| * Describes the name of the error. | ||
| */ | ||
| this.name = "SendOperationFailedError"; | ||
| this.code = code; | ||
| this.innerError = innerError; | ||
| } | ||
| } | ||
| exports.SendOperationFailedError = SendOperationFailedError; | ||
| //# sourceMappingURL=errorDefinitions.js.map |
| {"version":3,"file":"errorDefinitions.js","sourceRoot":"","sources":["../../lib/errorDefinitions.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,8FAA8F;;AAE9F;;GAEG;AACH,MAAa,qBAAsB,SAAQ,KAAK;IAM9C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QANjB;;WAEG;QACM,SAAI,GAAW,uBAAuB,CAAC;IAIhD,CAAC;CACF;AATD,sDASC;AAED;;GAEG;AACH,MAAa,uBAAwB,SAAQ,KAAK;IAMhD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QANjB;;WAEG;QACM,SAAI,GAAW,yBAAyB,CAAC;IAIlD,CAAC;CACF;AATD,0DASC;AAED;;GAEG;AACH,MAAa,wBAAyB,SAAQ,KAAK;IAMjD;IACE;;OAEG;IACM,OAAe;IACxB;;;;;;;;OAQG;IACM,IAA6E;IACtF;;OAEG;IACM,UAAkB;QAC3B,KAAK,CAAC,OAAO,CAAC,CAAC;QAfN,YAAO,GAAP,OAAO,CAAQ;QAUf,SAAI,GAAJ,IAAI,CAAyE;QAI7E,eAAU,GAAV,UAAU,CAAQ;QAvB7B;;WAEG;QACM,SAAI,GAAW,0BAA0B,CAAC;QAsBjD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF;AA7BD,4DA6BC"} |
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the Apache License. See License in the project root for license information. | ||
| import { | ||
| Delivery, Message, Sender as RheaSender, SessionEvents | ||
| } from "rhea"; | ||
| import * as log from "./log"; | ||
| import { BaseSender, BaseSenderOptions } from "./sender"; | ||
| import { SenderEvents } from "rhea"; | ||
| import { OnAmqpEvent, EventContext } from "./eventContext"; | ||
| import { Session } from "./session"; | ||
| import { | ||
| OperationTimeoutError, InsufficientCreditError, SendOperationFailedError | ||
| } from "./errorDefinitions"; | ||
| /** | ||
| * Describes the interface for the send operation Promise which contains a reference to resolve, | ||
| * reject functions and the timer for that Promise. | ||
| * @interface PromiseLike | ||
| */ | ||
| export interface PromiseLike { | ||
| resolve: (value?: any) => void; | ||
| reject: (reason?: any) => void; | ||
| timer: NodeJS.Timer; | ||
| } | ||
| /** | ||
| * Describes the event listeners that can be added to the AwaitableSender. | ||
| * @interface Sender | ||
| */ | ||
| export declare interface AwaitableSender { | ||
| on(event: SenderEvents, listener: OnAmqpEvent): this; | ||
| } | ||
| export interface AwaitableSenderOptions extends BaseSenderOptions { | ||
| /** | ||
| * The duration in which the promise to send the message should complete (resolve/reject). | ||
| * If it is not completed, then the Promise will be rejected after timeout occurs. | ||
| * Default: `20 seconds`. | ||
| */ | ||
| sendTimeoutInSeconds?: number; | ||
| } | ||
| /** | ||
| * Describes the sender where one can await on the message being sent. | ||
| * @class AwaitableSender | ||
| */ | ||
| export class AwaitableSender extends BaseSender { | ||
| /** | ||
| * The duration in which the promise to send the message should complete (resolve/reject). | ||
| * If it is not completed, then the Promise will be rejected after timeout occurs. | ||
| * Default: `20 seconds`. | ||
| */ | ||
| sendTimeoutInSeconds: number; | ||
| /** | ||
| * @property {Map<number, PromiseLike} deliveryDispositionMap Maintains a map of delivery of | ||
| * messages that are being sent. It acts as a store for correlating the dispositions received | ||
| * for sent messages. | ||
| */ | ||
| deliveryDispositionMap: Map<number, PromiseLike> = new Map<number, PromiseLike>(); | ||
| constructor(session: Session, sender: RheaSender, options: AwaitableSenderOptions = {}) { | ||
| super(session, sender, options); | ||
| this.sendTimeoutInSeconds = options.sendTimeoutInSeconds || 20; | ||
| /** | ||
| * The handler that will be added on the Sender for `accepted` event. If the delivery id is | ||
| * present in the disposition map then it will clear the timer and resolve the promise with the | ||
| * delivery. | ||
| * @param delivery Delivery associated with message that was sent. | ||
| */ | ||
| const onSendSuccess = (delivery: Delivery) => { | ||
| const id = delivery.id; | ||
| if (this.deliveryDispositionMap.has(delivery.id)) { | ||
| const promise = this.deliveryDispositionMap.get(id) as PromiseLike; | ||
| clearTimeout(promise.timer); | ||
| const deleteResult = this.deliveryDispositionMap.delete(id); | ||
| log.sender( | ||
| "[%s] Event: 'Accepted', Successfully deleted the delivery with id %d from " + | ||
| "the map of sender '%s' on amqp session '%s' and cleared the timer: %s.", | ||
| this.connection.id, id, this.name, this.session.id, deleteResult | ||
| ); | ||
| return promise.resolve(delivery); | ||
| } | ||
| }; | ||
| /** | ||
| * The handler is added on the Sender for `rejected`, `released` and `modified` events. | ||
| * If the delivery is found in the disposition map then the timer will be cleared and the | ||
| * promise will be rejected with an appropriate error message. | ||
| * @param eventName Name of the event that was raised. | ||
| * @param id Delivery id. | ||
| * @param error Error from the context if any. | ||
| */ | ||
| const onSendFailure = ( | ||
| eventName: "rejected" | "released" | "modified" | "sender_error" | "session_error", | ||
| id: number, | ||
| error?: Error) => { | ||
| if (this.deliveryDispositionMap.has(id)) { | ||
| const promise = this.deliveryDispositionMap.get(id) as PromiseLike; | ||
| clearTimeout(promise.timer); | ||
| const deleteResult = this.deliveryDispositionMap.delete(id); | ||
| log.sender( | ||
| "[%s] Event: '%s', Successfully deleted the delivery with id %d from the " + | ||
| " map of sender '%s' on amqp session '%s' and cleared the timer: %s.", | ||
| this.connection.id, eventName, id, this.name, this.session.id, deleteResult | ||
| ); | ||
| const msg = `Sender '${this.name}' on amqp session '${this.session.id}', received a ` + | ||
| `'${eventName}' disposition. Hence we are rejecting the promise.`; | ||
| const err = new SendOperationFailedError(msg, eventName, error); | ||
| log.error("[%s] %s", this.connection.id, msg); | ||
| return promise.reject(err); | ||
| } | ||
| }; | ||
| /** | ||
| * The handler that will be added on the Sender link for `sender_error` and on it's underlying | ||
| * session for `session_error` event. These events are raised when the sender link or it's | ||
| * underlying session get disconnected. | ||
| * The handler will clear the timer and reject the promise for every pending send in the map. | ||
| * @param eventName Name of the event that was raised. | ||
| * @param error Error from the context if any | ||
| */ | ||
| const onError = (eventName: "sender_error" | "session_error", error?: Error) => { | ||
| for (const id of this.deliveryDispositionMap.keys()) { | ||
| onSendFailure(eventName, id, error); | ||
| } | ||
| }; | ||
| this.on(SenderEvents.accepted, (context: EventContext) => { | ||
| onSendSuccess(context.delivery!); | ||
| }); | ||
| this.on(SenderEvents.rejected, (context: EventContext) => { | ||
| const delivery = context.delivery!; | ||
| onSendFailure(SenderEvents.rejected, delivery.id, delivery.remote_state && delivery.remote_state.error); | ||
| }); | ||
| this.on(SenderEvents.released, (context: EventContext) => { | ||
| const delivery = context.delivery!; | ||
| onSendFailure(SenderEvents.released, delivery.id, delivery.remote_state && delivery.remote_state.error); | ||
| }); | ||
| this.on(SenderEvents.modified, (context: EventContext) => { | ||
| const delivery = context.delivery!; | ||
| onSendFailure(SenderEvents.modified, delivery.id, delivery.remote_state && delivery.remote_state.error); | ||
| }); | ||
| // The user may have it's custom reconnect logic for bringing the sender link back online and | ||
| // retry logic for sending messages on failures hence they can provide their error handlers | ||
| // for `sender_error` and `session_error`. | ||
| // If the user did not provide its error handler for `sender_error` and `session_error`, | ||
| // then we add our handlers and make sure we clear the timer and reject the promise for sending | ||
| // messages with appropriate Error. | ||
| if (!options.onError) { | ||
| this.on(SenderEvents.senderError, (context: EventContext) => { | ||
| onError(SenderEvents.senderError, context.sender!.error as Error); | ||
| }); | ||
| } | ||
| if (!options.onSessionError) { | ||
| this.session.on(SessionEvents.sessionError, (context: EventContext) => { | ||
| onError(SessionEvents.sessionError, context.session!.error as Error); | ||
| }); | ||
| } | ||
| } | ||
| /** | ||
| * Sends the message on which one can await to ensure that the message has been successfully | ||
| * delivered. | ||
| * @param {Message | Buffer} msg The message to be sent. For default AMQP format msg parameter | ||
| * should be of type Message interface. For a custom format, the msg parameter should be a Buffer | ||
| * and a valid value should be passed to the `format` argument. | ||
| * @param {Buffer | string} [tag] The message tag if any. | ||
| * @param {number} [format] The message format. Specify this if a message with custom format needs | ||
| * to be sent. `0` implies the standard AMQP 1.0 defined format. If no value is provided, then the | ||
| * given message is assumed to be of type Message interface and encoded appropriately. | ||
| * @returns {Promise<Delivery>} Promise<Delivery> The delivery information about the sent message. | ||
| */ | ||
| send(msg: Message | Buffer, tag?: Buffer | string, format?: number): Promise<Delivery> { | ||
| return new Promise<Delivery>((resolve, reject) => { | ||
| log.sender("[%s] Sender '%s' on amqp session '%s', credit: %d available: %d", | ||
| this.connection.id, this.name, this.session.id, this.credit, | ||
| this.session.outgoing.available()); | ||
| if (this.sendable()) { | ||
| const timer = setTimeout(() => { | ||
| this.deliveryDispositionMap.delete(delivery.id); | ||
| const message = `Sender '${this.name}' on amqp session ` + | ||
| `'${this.session.id}', with address '${this.address}' was not able to send the ` + | ||
| `message with delivery id ${delivery.id} right now, due to operation timeout.`; | ||
| log.error("[%s] %s", this.connection.id, message); | ||
| return reject(new OperationTimeoutError(message)); | ||
| }, this.sendTimeoutInSeconds * 1000); | ||
| const delivery = (this._link as RheaSender).send(msg, tag, format); | ||
| this.deliveryDispositionMap.set(delivery.id, { | ||
| resolve: resolve, | ||
| reject: reject, | ||
| timer: timer | ||
| }); | ||
| } else { | ||
| // Please send the message after some time. | ||
| const msg = | ||
| `Sender "${this.name}" on amqp session "${this.session.id}", with address ` + | ||
| `${this.address} cannot send the message right now as it does not have ` + | ||
| `enough credit. Please try later.`; | ||
| log.error("[%s] %s", this.connection.id, msg); | ||
| reject(new InsufficientCreditError(msg)); | ||
| } | ||
| }); | ||
| } | ||
| } |
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the Apache License. See License in the project root for license information. | ||
| /** | ||
| * Defines the error that occurs when an operation timeout occurs. | ||
| */ | ||
| export class OperationTimeoutError extends Error { | ||
| /** | ||
| * Describes the name of the error. | ||
| */ | ||
| readonly name: string = "OperationTimeoutError"; | ||
| constructor(message: string) { | ||
| super(message); | ||
| } | ||
| } | ||
| /** | ||
| * Defines the error that occurs when the Sender does not have enough credit. | ||
| */ | ||
| export class InsufficientCreditError extends Error { | ||
| /** | ||
| * Describes the name of the error. | ||
| */ | ||
| readonly name: string = "InsufficientCreditError"; | ||
| constructor(message: string) { | ||
| super(message); | ||
| } | ||
| } | ||
| /** | ||
| * Defines the error that occurs when the Sender fails to send a message. | ||
| */ | ||
| export class SendOperationFailedError extends Error { | ||
| /** | ||
| * Describes the name of the error. | ||
| */ | ||
| readonly name: string = "SendOperationFailedError"; | ||
| constructor( | ||
| /** | ||
| * Provides descriptive information about the error. | ||
| */ | ||
| readonly message: string, | ||
| /** | ||
| * Provides the corresponding event associated with the `SendOperationFailedError`. | ||
| * - If the code is `"sender_error"` | `"session_error"`, then the send operation failed | ||
| * due to the sender link getting disconnected. | ||
| * - If the code is `"rejected"` | `"released"` | `"modified"`, then the send operation failed | ||
| * because the server is currently unable to accept the message being sent. Please take a look | ||
| * at the [AMQP 1.0 specification - "Section 3.4 Delivery State"](http://www.amqp.org/sites/amqp.org/files/amqp.pdf) | ||
| * for details about `"rejected"` | `"released"` | `"modified"` disposition. | ||
| */ | ||
| readonly code: "rejected" | "released" | "modified" | "sender_error" | "session_error", | ||
| /** | ||
| * Describes the underlying error that caused the send operation to fail. | ||
| */ | ||
| readonly innerError?: Error) { | ||
| super(message); | ||
| this.code = code; | ||
| this.innerError = innerError; | ||
| } | ||
| } |
| /// <reference types="node" /> | ||
| import { Delivery, Message, Sender as RheaSender } from "rhea"; | ||
| import { BaseSender, BaseSenderOptions } from "./sender"; | ||
| import { SenderEvents } from "rhea"; | ||
| import { OnAmqpEvent } from "./eventContext"; | ||
| import { Session } from "./session"; | ||
| /** | ||
| * Describes the interface for the send operation Promise which contains a reference to resolve, | ||
| * reject functions and the timer for that Promise. | ||
| * @interface PromiseLike | ||
| */ | ||
| export interface PromiseLike { | ||
| resolve: (value?: any) => void; | ||
| reject: (reason?: any) => void; | ||
| timer: NodeJS.Timer; | ||
| } | ||
| /** | ||
| * Describes the event listeners that can be added to the AwaitableSender. | ||
| * @interface Sender | ||
| */ | ||
| export declare interface AwaitableSender { | ||
| on(event: SenderEvents, listener: OnAmqpEvent): this; | ||
| } | ||
| export interface AwaitableSenderOptions extends BaseSenderOptions { | ||
| /** | ||
| * The duration in which the promise to send the message should complete (resolve/reject). | ||
| * If it is not completed, then the Promise will be rejected after timeout occurs. | ||
| * Default: `20 seconds`. | ||
| */ | ||
| sendTimeoutInSeconds?: number; | ||
| } | ||
| /** | ||
| * Describes the sender where one can await on the message being sent. | ||
| * @class AwaitableSender | ||
| */ | ||
| export declare class AwaitableSender extends BaseSender { | ||
| /** | ||
| * The duration in which the promise to send the message should complete (resolve/reject). | ||
| * If it is not completed, then the Promise will be rejected after timeout occurs. | ||
| * Default: `20 seconds`. | ||
| */ | ||
| sendTimeoutInSeconds: number; | ||
| /** | ||
| * @property {Map<number, PromiseLike} deliveryDispositionMap Maintains a map of delivery of | ||
| * messages that are being sent. It acts as a store for correlating the dispositions received | ||
| * for sent messages. | ||
| */ | ||
| deliveryDispositionMap: Map<number, PromiseLike>; | ||
| constructor(session: Session, sender: RheaSender, options?: AwaitableSenderOptions); | ||
| /** | ||
| * Sends the message on which one can await to ensure that the message has been successfully | ||
| * delivered. | ||
| * @param {Message | Buffer} msg The message to be sent. For default AMQP format msg parameter | ||
| * should be of type Message interface. For a custom format, the msg parameter should be a Buffer | ||
| * and a valid value should be passed to the `format` argument. | ||
| * @param {Buffer | string} [tag] The message tag if any. | ||
| * @param {number} [format] The message format. Specify this if a message with custom format needs | ||
| * to be sent. `0` implies the standard AMQP 1.0 defined format. If no value is provided, then the | ||
| * given message is assumed to be of type Message interface and encoded appropriately. | ||
| * @returns {Promise<Delivery>} Promise<Delivery> The delivery information about the sent message. | ||
| */ | ||
| send(msg: Message | Buffer, tag?: Buffer | string, format?: number): Promise<Delivery>; | ||
| } | ||
| //# sourceMappingURL=awaitableSender.d.ts.map |
| {"version":3,"file":"awaitableSender.d.ts","sourceRoot":"","sources":["../../lib/awaitableSender.ts"],"names":[],"mappings":";AAGA,OAAO,EACL,QAAQ,EAAE,OAAO,EAAE,MAAM,IAAI,UAAU,EACxC,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,WAAW,EAAgB,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,WAAW,eAAe;IACtC,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;CACtD;AAED,MAAM,WAAW,sBAAuB,SAAQ,iBAAiB;IAC/D;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,UAAU;IAC7C;;;;OAIG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAC7B;;;;OAIG;IACH,sBAAsB,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAkC;gBAEtE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAE,sBAA2B;IAqGtF;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;CAgCvF"} |
| /** | ||
| * Defines the error that occurs when an operation timeout occurs. | ||
| */ | ||
| export declare class OperationTimeoutError extends Error { | ||
| /** | ||
| * Describes the name of the error. | ||
| */ | ||
| readonly name: string; | ||
| constructor(message: string); | ||
| } | ||
| /** | ||
| * Defines the error that occurs when the Sender does not have enough credit. | ||
| */ | ||
| export declare class InsufficientCreditError extends Error { | ||
| /** | ||
| * Describes the name of the error. | ||
| */ | ||
| readonly name: string; | ||
| constructor(message: string); | ||
| } | ||
| /** | ||
| * Defines the error that occurs when the Sender fails to send a message. | ||
| */ | ||
| export declare class SendOperationFailedError extends Error { | ||
| /** | ||
| * Provides descriptive information about the error. | ||
| */ | ||
| readonly message: string; | ||
| /** | ||
| * Provides the corresponding event associated with the `SendOperationFailedError`. | ||
| * - If the code is `"sender_error"` | `"session_error"`, then the send operation failed | ||
| * due to the sender link getting disconnected. | ||
| * - If the code is `"rejected"` | `"released"` | `"modified"`, then the send operation failed | ||
| * because the server is currently unable to accept the message being sent. Please take a look | ||
| * at the [AMQP 1.0 specification - "Section 3.4 Delivery State"](http://www.amqp.org/sites/amqp.org/files/amqp.pdf) | ||
| * for details about `"rejected"` | `"released"` | `"modified"` disposition. | ||
| */ | ||
| readonly code: "rejected" | "released" | "modified" | "sender_error" | "session_error"; | ||
| /** | ||
| * Describes the underlying error that caused the send operation to fail. | ||
| */ | ||
| readonly innerError?: Error | undefined; | ||
| /** | ||
| * Describes the name of the error. | ||
| */ | ||
| readonly name: string; | ||
| constructor( | ||
| /** | ||
| * Provides descriptive information about the error. | ||
| */ | ||
| message: string, | ||
| /** | ||
| * Provides the corresponding event associated with the `SendOperationFailedError`. | ||
| * - If the code is `"sender_error"` | `"session_error"`, then the send operation failed | ||
| * due to the sender link getting disconnected. | ||
| * - If the code is `"rejected"` | `"released"` | `"modified"`, then the send operation failed | ||
| * because the server is currently unable to accept the message being sent. Please take a look | ||
| * at the [AMQP 1.0 specification - "Section 3.4 Delivery State"](http://www.amqp.org/sites/amqp.org/files/amqp.pdf) | ||
| * for details about `"rejected"` | `"released"` | `"modified"` disposition. | ||
| */ | ||
| code: "rejected" | "released" | "modified" | "sender_error" | "session_error", | ||
| /** | ||
| * Describes the underlying error that caused the send operation to fail. | ||
| */ | ||
| innerError?: Error | undefined); | ||
| } | ||
| //# sourceMappingURL=errorDefinitions.d.ts.map |
| {"version":3,"file":"errorDefinitions.d.ts","sourceRoot":"","sources":["../../lib/errorDefinitions.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAA2B;gBAEpC,OAAO,EAAE,MAAM;CAG5B;AAED;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAChD;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAA6B;gBAEtC,OAAO,EAAE,MAAM;CAG5B;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;IAO/C;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM;IACxB;;;;;;;;OAQG;IACH,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,cAAc,GAAG,eAAe;IACtF;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC;IAvBtB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAA8B;;IAGjD;;OAEG;IACM,OAAO,EAAE,MAAM;IACxB;;;;;;;;OAQG;IACM,IAAI,EAAE,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,cAAc,GAAG,eAAe;IACtF;;OAEG;IACM,UAAU,CAAC,mBAAO;CAK9B"} |
+12
-0
@@ -0,1 +1,13 @@ | ||
| ### 1.0.0 - 2019-06-27 | ||
| - Updated minimum version of `rhea` to `^1.0.8`. | ||
| - Added a read only property `id` to the `Session` object. The id property is created by concatenating session's local channel, remote channel and the connection id `"local-<number>_remote-<number>_<connection-id>"`, thus making it unique for that connection. | ||
| - Improved log statements by adding the session `id` and the sender, receiver `name` to help while debugging applications. | ||
| - Added `options` to `Link.close({closeSession: true | false})`, thus the user can specify whether the underlying session should be closed while closing the `Sender|Receiver`. Default is `true`. | ||
| - Improved `open` and `close` operations on `Connection`, `Session` and `Link` by creating timer in case the connection gets disconnected. Fixes [#41](https://github.com/amqp/rhea-promise/issues/41). | ||
| - The current `Sender` does not have a provision of **"awaiting"** on sending a message. The user needs to add handlers on the `Sender` for `accepted`, `rejected`, `released`, `modified` to ensure whether the message was successfully sent. | ||
| Now, we have added a new `AwaitableSender` which adds the handlers internally and provides an **awaitable** `send()` operation to the customer. Fixes [#45](https://github.com/amqp/rhea-promise/issues/45). | ||
| - Exporting new Errors: | ||
| - `InsufficientCreditError`: Defines the error that occurs when the Sender does not have enough credit. | ||
| - `SendOperationFailedError`: Defines the error that occurs when the Sender fails to send a message. | ||
| ### 0.2.0 - 2019-05-17 | ||
@@ -2,0 +14,0 @@ - Updated `OperationTimeoutError` to be a non-AMQP Error as pointed out in [#42](https://github.com/amqp/rhea-promise/issues/42). Fixed in [PR](https://github.com/amqp/rhea-promise/pull/43). |
@@ -13,3 +13,3 @@ "use strict"; | ||
| const entity_1 = require("./entity"); | ||
| const operationTimeoutError_1 = require("./operationTimeoutError"); | ||
| const errorDefinitions_1 = require("./errorDefinitions"); | ||
| // Determines whether the given object is a CreatedRheConnectionOptions object. | ||
@@ -167,2 +167,3 @@ function isCreatedRheaConnectionOptions(obj) { | ||
| let onError; | ||
| let onDisconnected; | ||
| let waitTimer; | ||
@@ -174,2 +175,3 @@ const removeListeners = () => { | ||
| this._connection.removeListener(rhea_1.ConnectionEvents.connectionClose, onClose); | ||
| this._connection.removeListener(rhea_1.ConnectionEvents.disconnected, onDisconnected); | ||
| }; | ||
@@ -186,2 +188,9 @@ onClose = (context) => { | ||
| }; | ||
| onDisconnected = (context) => { | ||
| removeListeners(); | ||
| const error = context.connection && context.connection.error | ||
| ? context.connection.error | ||
| : context.error; | ||
| log.error("[%s] Connection got disconnected while closing itself: %O.", this.id, error); | ||
| }; | ||
| const actionAfterTimeout = () => { | ||
@@ -196,2 +205,3 @@ removeListeners(); | ||
| this._connection.once(rhea_1.ConnectionEvents.connectionError, onError); | ||
| this._connection.once(rhea_1.ConnectionEvents.disconnected, onDisconnected); | ||
| waitTimer = setTimeout(actionAfterTimeout, this.options.operationTimeoutInSeconds * 1000); | ||
@@ -277,2 +287,3 @@ this._connection.close(); | ||
| let onClose; | ||
| let onDisconnected; | ||
| let waitTimer; | ||
@@ -284,6 +295,7 @@ const removeListeners = () => { | ||
| rheaSession.removeListener(rhea_1.SessionEvents.sessionClose, onClose); | ||
| rheaSession.connection.removeListener(rhea_1.ConnectionEvents.disconnected, onDisconnected); | ||
| }; | ||
| onOpen = (context) => { | ||
| removeListeners(); | ||
| log.session("[%s] Resolving the promise with amqp session.", this.id); | ||
| log.session("[%s] Resolving the promise with amqp session '%s'.", this.id, session.id); | ||
| return resolve(session); | ||
@@ -296,2 +308,10 @@ }; | ||
| }; | ||
| onDisconnected = (context) => { | ||
| removeListeners(); | ||
| const error = context.connection && context.connection.error | ||
| ? context.connection.error | ||
| : context.error; | ||
| log.error("[%s] Connection got disconnected while creating amqp session '%s': %O.", this.id, session.id, error); | ||
| return reject(error); | ||
| }; | ||
| const actionAfterTimeout = () => { | ||
@@ -301,3 +321,3 @@ removeListeners(); | ||
| log.error("[%s] %s", this.id, msg); | ||
| return reject(new operationTimeoutError_1.OperationTimeoutError(msg)); | ||
| return reject(new errorDefinitions_1.OperationTimeoutError(msg)); | ||
| }; | ||
@@ -307,2 +327,3 @@ // listeners that we add for completing the operation are added directly to rhea's objects. | ||
| rheaSession.once(rhea_1.SessionEvents.sessionClose, onClose); | ||
| rheaSession.connection.once(rhea_1.ConnectionEvents.disconnected, onDisconnected); | ||
| log.session("[%s] Calling amqp session.begin().", this.id); | ||
@@ -328,2 +349,23 @@ waitTimer = setTimeout(actionAfterTimeout, this.options.operationTimeoutInSeconds * 1000); | ||
| /** | ||
| * Creates an awaitable amqp sender. It either uses the provided session or creates a new one. | ||
| * @param options Optional parameters to create an awaitable sender link. | ||
| * - If `onError` and `onSessionError` handlers are not provided then the `AwaitableSender` will | ||
| * clear the timer and reject the Promise for all the entries of inflight send operation in its | ||
| * `deliveryDispositionMap`. | ||
| * - If the user is handling the reconnection of sender link or the underlying connection in it's | ||
| * app, then the `onError` and `onSessionError` handlers must be provided by the user and (s)he | ||
| * shall be responsible of clearing the `deliveryDispotionMap` of inflight `send()` operation. | ||
| * | ||
| * @return Promise<AwaitableSender>. | ||
| */ | ||
| createAwaitableSender(options) { | ||
| return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
| if (options && options.session && options.session.createAwaitableSender) { | ||
| return options.session.createAwaitableSender(options); | ||
| } | ||
| const session = yield this.createSession(); | ||
| return session.createAwaitableSender(options); | ||
| }); | ||
| } | ||
| /** | ||
| * Creates an amqp receiver link. It either uses the provided session or creates a new one. | ||
@@ -365,3 +407,4 @@ * @param {ReceiverOptionsWithSession} options Optional parameters to create a receiver link. | ||
| ]); | ||
| log.connection("[%s] Successfully created the sender and receiver links on the same session.", this.id); | ||
| log.connection("[%s] Successfully created the sender '%s' and receiver '%s' on the same " + | ||
| "amqp session '%s'.", this.id, sender.name, receiver.name, session.id); | ||
| return { | ||
@@ -390,2 +433,5 @@ session: session, | ||
| }; | ||
| if (eventName === rhea_1.ConnectionEvents.protocolError) { | ||
| log.connection("[%s] ProtocolError is: %O.", this.id, context); | ||
| } | ||
| utils_1.emitEvent(params); | ||
@@ -392,0 +438,0 @@ }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"connection.js","sourceRoot":"","sources":["../../lib/connection.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,8FAA8F;;;AAI9F,6BAA6B;AAC7B,uCAAoC;AAGpC,2CAAwC;AACxC,gDAAoE;AACpE,wCAA+D;AAC/D,+BAIc;AAGd,qCAAkC;AAClC,mEAAgE;AAuFhE,+EAA+E;AAC/E,SAAS,8BAA8B,CAAC,GAAQ;IAC9C,OAAO,CAAC,GAAG,IAAI,OAAO,GAAG,CAAC,SAAS,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,cAAc,KAAK,QAAQ,CAAC,CAAC;AAC9F,CAAC;AAgCD;;;GAGG;AACH,MAAa,UAAW,SAAQ,eAAM;IAiB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;gBACnF,wCAAwC,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC;SACrF;IACH,CAAC;CACF;AAvhBD,gCAuhBC"} |
@@ -20,9 +20,8 @@ "use strict"; | ||
| function translate(rheaContext, emitter, eventName) { | ||
| const connectionId = (rheaContext.connection && rheaContext.connection.options) ? rheaContext.connection.options.id : ""; | ||
| log.contextTranslator("[%s] Translating the context for event: '%s'.", connectionId, eventName); | ||
| // initialize the result | ||
| const result = Object.assign({ _context: rheaContext }, rheaContext); | ||
| const connection = emitter instanceof connection_1.Connection | ||
| ? emitter | ||
| : emitter.connection; | ||
| log.contextTranslator("[%s] Translating the context for event: '%s'.", connection.id, eventName); | ||
| // initialize the result | ||
| const result = Object.assign({ _context: rheaContext }, rheaContext); | ||
| // set rhea-promise connection and container | ||
@@ -29,0 +28,0 @@ result.connection = connection; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"eventContext.js","sourceRoot":"","sources":["../../lib/eventContext.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,8FAA8F;;AAE9F,6CAA0C;AAE1C,uCAAoC;AAMpC,iCAAwC;AACxC,6BAA6B;AAuE7B,IAAc,YAAY,CA2CzB;AA3CD,WAAc,YAAY;IACxB;;;;;;;OAOG;IACH,SAAgB,SAAS,CACvB,WAA6B,EAC7B,OAAoC,EACpC,SAAiB;QACjB,MAAM,YAAY,GAAG,CAAC,WAAW,CAAC,UAAU,IAAI,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzH,GAAG,CAAC,iBAAiB,CAAC,+CAA+C,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;QAChG,wBAAwB;QACxB,MAAM,MAAM,GAAiB,gBAC3B,QAAQ,EAAE,WAAW,IAClB,WAAW,CACR,CAAC;QAET,MA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AG,CAAC,iBAAiB,CAAC,+CAA+C,EAAE,UAAU,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QAEjG,wBAAwB;QACxB,MAAM,MAAM,GAAiB,gBAC3B,QAAQ,EAAE,WAAW,IAClB,WAAW,CACR,CAAC;QAET,4CAA4C;QAC5C,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC;QAC/B,MAAM,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QAExC,6CAA6C;QAC7C,IAAI,OAAO,YAAY,WAAI,EAAE;YAC3B,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;YACjC,IAAI,OAAO,CAAC,IAAI,KAAK,eAAQ,CAAC,QAAQ,IAAI,WAAW,CAAC,QAAQ,EAAE;gBAC9D,MAAM,CAAC,QAAQ,GAAG,OAAmB,CAAC;aACvC;iBAAM,IAAI,OAAO,CAAC,IAAI,KAAK,eAAQ,CAAC,MAAM,IAAI,WAAW,CAAC,MAAM,EAAE;gBACjE,MAAM,CAAC,MAAM,GAAG,OAAiB,CAAC;aACnC;SACF;aAAM,IAAI,OAAO,YAAY,iBAAO,EAAE;YACrC,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;SAC1B;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAjCe,sBAAS,YAiCxB,CAAA;AACH,CAAC,EA3Ca,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QA2CzB"} |
@@ -29,2 +29,4 @@ "use strict"; | ||
| exports.Sender = sender_1.Sender; | ||
| var awaitableSender_1 = require("./awaitableSender"); | ||
| exports.AwaitableSender = awaitableSender_1.AwaitableSender; | ||
| var utils_1 = require("./util/utils"); | ||
@@ -37,2 +39,6 @@ exports.AmqpResponseStatusCode = utils_1.AmqpResponseStatusCode; | ||
| exports.parseConnectionString = utils_1.parseConnectionString; | ||
| var errorDefinitions_1 = require("./errorDefinitions"); | ||
| exports.InsufficientCreditError = errorDefinitions_1.InsufficientCreditError; | ||
| exports.OperationTimeoutError = errorDefinitions_1.OperationTimeoutError; | ||
| exports.SendOperationFailedError = errorDefinitions_1.SendOperationFailedError; | ||
| //# sourceMappingURL=index.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,8FAA8F;;AAE9F,6BAOc;AALuD,uBAAA,KAAK,CAAA;AAAE,yBAAA,OAAO,CAAA;AAAE,wBAAA,MAAM,CAAA;AACzF,gCAAA,cAAc,CAAA;AAAE,+BAAA,aAAa,CAAA;AAAE,gCAAA,cAAc,CAAA;AACJ,gCAAA,cAAc,CAAA;AAAE,8BAAA,YAAY,CAAA;AAAE,kCAAA,gBAAgB,CAAA;AACvF,+BAAA,aAAa,CAAA;AACkE,uBAAA,KAAK,CAAA;AAGtF,+CAA2D;AAAlD,sCAAA,YAAY,CAAA;AACrB,yCAA0D;AAAjD,gCAAA,SAAS,CAAA;AAClB,2CAEsB;AADpB,kCAAA,UAAU,CAAA;AAEZ,qCAAoC;AAA3B,4BAAA,OAAO,CAAA;AAChB,uCAAuD;AAA9C,8BAAA,QAAQ,CAAA;AACjB,mCAAiD;AAAxC,0BAAA,MAAM,CAAA;AACf,sCAGsB;AAFd,yCAAA,sBAAsB,CAAA;AAAE,8BAAA,WAAW,CAAA;AAAgC,wBAAA,KAAK,CAAA;AAAE,gCAAA,aAAa,CAAA;AAC7F,oCAAA,iBAAiB,CAAA;AAAE,wCAAA,qBAAqB,CAAA"} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,8FAA8F;;AAE9F,6BAQc;AANuD,uBAAA,KAAK,CAAA;AAAE,yBAAA,OAAO,CAAA;AAAE,wBAAA,MAAM,CAAA;AACzF,gCAAA,cAAc,CAAA;AAAE,+BAAA,aAAa,CAAA;AAAE,gCAAA,cAAc,CAAA;AACJ,gCAAA,cAAc,CAAA;AAAE,8BAAA,YAAY,CAAA;AAAE,kCAAA,gBAAgB,CAAA;AACvF,+BAAA,aAAa,CAAA;AACkE,uBAAA,KAAK,CAAA;AAItF,+CAA2D;AAAlD,sCAAA,YAAY,CAAA;AACrB,yCAA0D;AAAjD,gCAAA,SAAS,CAAA;AAClB,2CAEsB;AADpB,kCAAA,UAAU,CAAA;AAEZ,qCAAoC;AAA3B,4BAAA,OAAO,CAAA;AAChB,uCAAuD;AAA9C,8BAAA,QAAQ,CAAA;AACjB,mCAAiD;AAAxC,0BAAA,MAAM,CAAA;AACf,qDAAyF;AAAxD,4CAAA,eAAe,CAAA;AAEhD,sCAGsB;AAFd,yCAAA,sBAAsB,CAAA;AAAE,8BAAA,WAAW,CAAA;AAAgC,wBAAA,KAAK,CAAA;AAAE,gCAAA,aAAa,CAAA;AAC7F,oCAAA,iBAAiB,CAAA;AAAE,wCAAA,qBAAqB,CAAA;AAE1C,uDAE4B;AAD1B,qDAAA,uBAAuB,CAAA;AAAE,mDAAA,qBAAqB,CAAA;AAAE,sDAAA,wBAAwB,CAAA"} |
+33
-13
@@ -10,3 +10,3 @@ "use strict"; | ||
| const entity_1 = require("./entity"); | ||
| const operationTimeoutError_1 = require("./operationTimeoutError"); | ||
| const errorDefinitions_1 = require("./errorDefinitions"); | ||
| var LinkType; | ||
@@ -177,5 +177,6 @@ (function (LinkType) { | ||
| /** | ||
| * Closes the underlying amqp link and session in rhea if open. Also removes all the event | ||
| * handlers added in the rhea-promise library on the link and it's session | ||
| * @return {Promise<void>} Promise<void> | ||
| * Closes the underlying amqp link and optionally the session as well in rhea if open. | ||
| * Also removes all the event handlers added in the rhea-promise library on the link | ||
| * and optionally it's session. | ||
| * @returns Promise<void> | ||
| * - **Resolves** the promise when rhea emits the "sender_close" | "receiver_close" event. | ||
@@ -185,7 +186,11 @@ * - **Rejects** the promise with an AmqpError when rhea emits the | ||
| */ | ||
| close() { | ||
| close(options) { | ||
| return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
| if (!options) | ||
| options = {}; | ||
| if (options.closeSession == undefined) | ||
| options.closeSession = true; | ||
| this.removeAllListeners(); | ||
| yield new Promise((resolve, reject) => { | ||
| log.error("[%s] The %s is open ? -> %s", this.connection.id, this.type, this.isOpen()); | ||
| log.error("[%s] The %s '%s' on amqp session '%s' is open ? -> %s", this.connection.id, this.type, this.name, this.session.id, this.isOpen()); | ||
| if (this.isOpen()) { | ||
@@ -200,2 +205,3 @@ const errorEvent = this.type === LinkType.sender | ||
| let onClose; | ||
| let onDisconnected; | ||
| let waitTimer; | ||
@@ -207,6 +213,8 @@ const removeListeners = () => { | ||
| this._link.removeListener(closeEvent, onClose); | ||
| this._link.connection.removeListener(rhea_1.ConnectionEvents.disconnected, onDisconnected); | ||
| }; | ||
| onClose = (context) => { | ||
| removeListeners(); | ||
| log[this.type]("[%s] Resolving the promise as the amqp %s has been closed.", this.connection.id, this.type); | ||
| log[this.type]("[%s] Resolving the promise as the %s '%s' on amqp session '%s' " + | ||
| "has been closed.", this.connection.id, this.type, this.name, this.session.id); | ||
| return resolve(); | ||
@@ -216,10 +224,19 @@ }; | ||
| removeListeners(); | ||
| log.error("[%s] Error occurred while closing amqp %s: %O.", this.connection.id, this.type, context.session.error); | ||
| log.error("[%s] Error occurred while closing %s '%s' on amqp session '%s': %O.", this.connection.id, this.type, this.name, this.session.id, context.session.error); | ||
| return reject(context.session.error); | ||
| }; | ||
| onDisconnected = (context) => { | ||
| removeListeners(); | ||
| const error = context.connection && context.connection.error | ||
| ? context.connection.error | ||
| : context.error; | ||
| log.error("[%s] Connection got disconnected while closing amqp %s '%s' on amqp " + | ||
| "session '%s': %O.", this.connection.id, this.type, this.name, this.session.id, error); | ||
| }; | ||
| const actionAfterTimeout = () => { | ||
| removeListeners(); | ||
| const msg = `Unable to close the amqp %s ${this.name} due to operation timeout.`; | ||
| log.error("[%s] %s", this.connection.id, this.type, msg); | ||
| return reject(new operationTimeoutError_1.OperationTimeoutError(msg)); | ||
| const msg = `Unable to close the ${this.type} '${this.name}' ` + | ||
| `on amqp session '${this.session.id}' due to operation timeout.`; | ||
| log.error("[%s] %s", this.connection.id, msg); | ||
| return reject(new errorDefinitions_1.OperationTimeoutError(msg)); | ||
| }; | ||
@@ -229,2 +246,3 @@ // listeners that we add for completing the operation are added directly to rhea's objects. | ||
| this._link.once(errorEvent, onError); | ||
| this._link.connection.once(rhea_1.ConnectionEvents.disconnected, onDisconnected); | ||
| waitTimer = setTimeout(actionAfterTimeout, this.connection.options.operationTimeoutInSeconds * 1000); | ||
@@ -238,4 +256,6 @@ this._link.close(); | ||
| }); | ||
| log[this.type]("[%s] %s has been closed, now closing it's session.", this.connection.id, this.type); | ||
| return this._session.close(); | ||
| if (options.closeSession) { | ||
| log[this.type]("[%s] %s '%s' has been closed, now closing it's amqp session '%s'.", this.connection.id, this.type, this.name, this.session.id); | ||
| return this._session.close(); | ||
| } | ||
| }); | ||
@@ -242,0 +262,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"link.js","sourceRoot":"","sources":["../../lib/link.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,8FAA8F;;;AAE9F,6BAA6B;AAC7B,+BAGc;AAGd,wCAA+D;AAC/D,qCAAkC;AAClC,mEAAgE;AAEhE,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,6BAAiB,CAAA;IACjB,iCAAqB,CAAA;AACvB,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB;AAED,MAAsB,IAAK,SAAQ,eAAM;IAKvC,YAAY,IAAc,EAAE,OAAgB,EAAE,IAAU,EAAE,OAAqB;QAC7E,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;QAC3B,IAAI,CAAC,yBAAyB,EAAE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AC7B,CAAC,OAAyB,EAAE,EAAE;gBAC5B,MAAM,MAAM,GAAmB;oBAC7B,WAAW,EAAE,OAAO;oBACpB,OAAO,EAAE,IAAI;oBACb,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC;oBAC5B,WAAW,EAAE,IAAI,CAAC,IAAI;oBACtB,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE;iBACjC,CAAC;gBACF,iBAAS,CAAC,MAAM,CAAC,CAAC;YACpB,CAAC,CAAC,CAAC;SACN;QACD,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,KAAK,UAAU,EAAE;YAC/C,GAAG,CAAC,YAAY,CAAC,4DAA4D;gBAC3E,gCAAgC,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAC/D,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;SACvC;QACD,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,KAAK,UAAU,EAAE;YAClD,GAAG,CAAC,YAAY,CAAC,uEAAuE,EACtF,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC;SAC7F;IACH,CAAC;CACF;AApTD,oBAoTC"} |
+13
-3
@@ -7,6 +7,6 @@ "use strict"; | ||
| /** | ||
| * Describes the sender that wraps the rhea sender. | ||
| * @class Sender | ||
| * Describes the base sender that wraps the rhea sender. | ||
| * @class BaseSender | ||
| */ | ||
| class Sender extends link_1.Link { | ||
| class BaseSender extends link_1.Link { | ||
| constructor(session, sender, options) { | ||
@@ -25,2 +25,12 @@ super(link_1.LinkType.sender, session, sender, options); | ||
| } | ||
| } | ||
| exports.BaseSender = BaseSender; | ||
| /** | ||
| * Describes the AMQP Sender. | ||
| * @class Sender | ||
| */ | ||
| class Sender extends BaseSender { | ||
| constructor(session, sender, options) { | ||
| super(session, sender, options); | ||
| } | ||
| /** | ||
@@ -27,0 +37,0 @@ * Sends the message |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"sender.js","sourceRoot":"","sources":["../../lib/sender.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,8FAA8F;;AAO9F,iCAAwC;AA0DxC;;;GAGG;AACH,MAAa,MAAO,SAAQ,WAAI;IAG9B,YAAY,OAAgB,EAAE,MAAkB,EAAE,OAAuB;QACvE,KAAK,CAAC,eAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IAED,UAAU,CAAC,OAAgB;QACxB,IAAI,CAAC,KAAoB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC;IAED;;;OAGG;IACH,QAAQ;QACN,OAAQ,IAAI,CAAC,KAAoB,CAAC,QAAQ,EAAE,CAAC;IAC/C,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CAAC,GAAqB,EAAE,GAAqB,EAAE,MAAe;QAChE,OAAQ,IAAI,CAAC,KAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IAC3D,CAAC;CACF;AAjCD,wBAiCC"} | ||
| {"version":3,"file":"sender.js","sourceRoot":"","sources":["../../lib/sender.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,8FAA8F;;AAO9F,iCAAwC;AAiExC;;;GAGG;AACH,MAAa,UAAW,SAAQ,WAAI;IAElC,YAAY,OAAgB,EAAE,MAAkB,EAAE,OAA2B;QAC3E,KAAK,CAAC,eAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IAED,UAAU,CAAC,OAAgB;QACxB,IAAI,CAAC,KAAoB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC;IAED;;;OAGG;IACH,QAAQ;QACN,OAAQ,IAAI,CAAC,KAAoB,CAAC,QAAQ,EAAE,CAAC;IAC/C,CAAC;CACF;AAjBD,gCAiBC;AAED;;;GAGG;AACH,MAAa,MAAO,SAAQ,UAAU;IAEpC,YAAY,OAAgB,EAAE,MAAkB,EAAE,OAAuB;QACvE,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CAAC,GAAqB,EAAE,GAAqB,EAAE,MAAe;QAChE,OAAQ,IAAI,CAAC,KAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IAC3D,CAAC;CACF;AApBD,wBAoBC"} |
+143
-44
@@ -11,4 +11,13 @@ "use strict"; | ||
| const entity_1 = require("./entity"); | ||
| const operationTimeoutError_1 = require("./operationTimeoutError"); | ||
| const errorDefinitions_1 = require("./errorDefinitions"); | ||
| const awaitableSender_1 = require("./awaitableSender"); | ||
| /** | ||
| * @internal | ||
| */ | ||
| var SenderType; | ||
| (function (SenderType) { | ||
| SenderType["sender"] = "sender"; | ||
| SenderType["AwaitableSender"] = "AwaitableSender"; | ||
| })(SenderType || (SenderType = {})); | ||
| /** | ||
| * Describes the session that wraps the rhea session. | ||
@@ -38,2 +47,21 @@ * @class Session | ||
| /** | ||
| * Returns the unique identifier for the session in the format: | ||
| * "local_<number>-remote_<number>-<connection-id>" or an empty string if the local channel or | ||
| * remote channel are not yet defined. | ||
| */ | ||
| get id() { | ||
| let result = ""; | ||
| const session = this._session; | ||
| if (session.local) { | ||
| result += `local-${session.local.channel}_`; | ||
| } | ||
| if (session.remote) { | ||
| result += `remote-${session.remote.channel}_`; | ||
| } | ||
| if (result) { | ||
| result += `${this._connection.id}`; | ||
| } | ||
| return result; | ||
| } | ||
| /** | ||
| * Determines whether the session and the underlying connection is open. | ||
@@ -95,6 +123,7 @@ * @returns {boolean} result `true` - is open; `false` otherwise. | ||
| return new Promise((resolve, reject) => { | ||
| log.error("[%s] The session is open ? -> %s", this.connection.id, this.isOpen()); | ||
| log.error("[%s] The amqp session '%s' is open ? -> %s", this.connection.id, this.id, this.isOpen()); | ||
| if (this.isOpen()) { | ||
| let onError; | ||
| let onClose; | ||
| let onDisconnected; | ||
| let waitTimer; | ||
@@ -106,6 +135,7 @@ const removeListeners = () => { | ||
| this._session.removeListener(rhea_1.SessionEvents.sessionClose, onClose); | ||
| this._session.connection.removeListener(rhea_1.ConnectionEvents.disconnected, onDisconnected); | ||
| }; | ||
| onClose = (context) => { | ||
| removeListeners(); | ||
| log.session("[%s] Resolving the promise as the amqp session has been closed.", this.connection.id); | ||
| log.session("[%s] Resolving the promise as the amqp session '%s' has been closed.", this.connection.id, this.id); | ||
| return resolve(); | ||
@@ -115,10 +145,17 @@ }; | ||
| removeListeners(); | ||
| log.error("[%s] Error occurred while closing amqp session.", this.connection.id, context.session.error); | ||
| log.error("[%s] Error occurred while closing amqp session '%s'.", this.connection.id, this.id, context.session.error); | ||
| reject(context.session.error); | ||
| }; | ||
| onDisconnected = (context) => { | ||
| removeListeners(); | ||
| const error = context.connection && context.connection.error | ||
| ? context.connection.error | ||
| : context.error; | ||
| log.error("[%s] Connection got disconnected while closing amqp session '%s': %O.", this.connection.id, this.id, error); | ||
| }; | ||
| const actionAfterTimeout = () => { | ||
| removeListeners(); | ||
| const msg = `Unable to close the amqp session due to operation timeout.`; | ||
| const msg = `Unable to close the amqp session ${this.id} due to operation timeout.`; | ||
| log.error("[%s] %s", this.connection.id, msg); | ||
| reject(new operationTimeoutError_1.OperationTimeoutError(msg)); | ||
| reject(new errorDefinitions_1.OperationTimeoutError(msg)); | ||
| }; | ||
@@ -128,3 +165,4 @@ // listeners that we add for completing the operation are added directly to rhea's objects. | ||
| this._session.once(rhea_1.SessionEvents.sessionError, onError); | ||
| log.session("[%s] Calling session.close()", this.connection.id); | ||
| this._session.connection.once(rhea_1.ConnectionEvents.disconnected, onDisconnected); | ||
| log.session("[%s] Calling session.close() for amqp session '%s'.", this.connection.id, this.id); | ||
| waitTimer = setTimeout(actionAfterTimeout, this.connection.options.operationTimeoutInSeconds * 1000); | ||
@@ -141,5 +179,5 @@ this._session.close(); | ||
| * Creates an amqp receiver on this session. | ||
| * @param {Session} session The amqp session object on which the receiver link needs to be established. | ||
| * @param {ReceiverOptions} [options] Options that can be provided while creating an amqp receiver. | ||
| * @return {Promise<Receiver>} Promise<Receiver> | ||
| * @param session The amqp session object on which the receiver link needs to be established. | ||
| * @param options Options that can be provided while creating an amqp receiver. | ||
| * @return Promise<Receiver> | ||
| * - **Resolves** the promise with the Receiver object when rhea emits the "receiver_open" event. | ||
@@ -174,9 +212,9 @@ * - **Rejects** the promise with an AmqpError when rhea emits the "receiver_close" event while trying | ||
| this.on(rhea_1.SessionEvents.sessionError, options.onSessionError); | ||
| log.session("[%s] Added event handler for event '%s' on rhea-promise 'session', " + | ||
| "while creating the 'receiver'.", this.connection.id, rhea_1.SessionEvents.sessionError); | ||
| log.session("[%s] Added event handler for event '%s' on rhea-promise 'session: %s', " + | ||
| "while creating the 'receiver'.", this.connection.id, rhea_1.SessionEvents.sessionError, this.id); | ||
| } | ||
| if (options && options.onSessionClose) { | ||
| this.on(rhea_1.SessionEvents.sessionClose, options.onSessionClose); | ||
| log.session("[%s] Added event handler for event '%s' on rhea-promise 'session', " + | ||
| " while creating the 'receiver'.", this.connection.id, rhea_1.SessionEvents.sessionClose); | ||
| log.session("[%s] Added event handler for event '%s' on rhea-promise 'session: %s', " + | ||
| " while creating the 'receiver'.", this.connection.id, rhea_1.SessionEvents.sessionClose, this.id); | ||
| } | ||
@@ -188,2 +226,3 @@ const rheaReceiver = this._session.attach_receiver(options); | ||
| let onClose; | ||
| let onDisconnected; | ||
| let waitTimer; | ||
@@ -211,6 +250,7 @@ if (options && options.onMessage) { | ||
| rheaReceiver.removeListener(rhea_1.ReceiverEvents.receiverClose, onClose); | ||
| rheaReceiver.session.connection.removeListener(rhea_1.ConnectionEvents.disconnected, onDisconnected); | ||
| }; | ||
| onOpen = (context) => { | ||
| removeListeners(); | ||
| log.receiver("[%s] Resolving the promise with amqp receiver '%s'.", this.connection.id, receiver.name); | ||
| log.receiver("[%s] Resolving the promise with amqp receiver '%s' on amqp session '%s'.", this.connection.id, receiver.name, this.id); | ||
| return resolve(receiver); | ||
@@ -220,11 +260,21 @@ }; | ||
| removeListeners(); | ||
| log.error("[%s] Error occurred while creating a receiver over amqp connection: %O.", this.connection.id, context.receiver.error); | ||
| log.error("[%s] Error occurred while creating the amqp receiver '%s' on amqp session " + | ||
| "'%s' over amqp connection: %O.", this.connection.id, receiver.name, this.id, context.receiver.error); | ||
| return reject(context.receiver.error); | ||
| }; | ||
| onDisconnected = (context) => { | ||
| removeListeners(); | ||
| const error = context.connection && context.connection.error | ||
| ? context.connection.error | ||
| : context.error; | ||
| log.error("[%s] Connection got disconnected while creating amqp receiver '%s' on amqp " + | ||
| "session '%s': %O.", this.connection.id, receiver.name, this.id, error); | ||
| return reject(error); | ||
| }; | ||
| const actionAfterTimeout = () => { | ||
| removeListeners(); | ||
| const msg = `Unable to create the amqp receiver ${receiver.name} due to ` + | ||
| `operation timeout.`; | ||
| const msg = `Unable to create the amqp receiver '${receiver.name}' on amqp ` + | ||
| `session '${this.id}' due to operation timeout.`; | ||
| log.error("[%s] %s", this.connection.id, msg); | ||
| return reject(new operationTimeoutError_1.OperationTimeoutError(msg)); | ||
| return reject(new errorDefinitions_1.OperationTimeoutError(msg)); | ||
| }; | ||
@@ -234,2 +284,3 @@ // listeners that we add for completing the operation are added directly to rhea's objects. | ||
| rheaReceiver.once(rhea_1.ReceiverEvents.receiverClose, onClose); | ||
| rheaReceiver.session.connection.on(rhea_1.ConnectionEvents.disconnected, onDisconnected); | ||
| waitTimer = setTimeout(actionAfterTimeout, this.connection.options.operationTimeoutInSeconds * 1000); | ||
@@ -240,4 +291,4 @@ }); | ||
| * Creates an amqp sender on this session. | ||
| * @param {SenderOptions} [options] Options that can be provided while creating an amqp sender. | ||
| * @return {Promise<Sender>} Promise<Sender> | ||
| * @param options Options that can be provided while creating an amqp sender. | ||
| * @return Promise<Sender> | ||
| * - **Resolves** the promise with the Sender object when rhea emits the "sender_open" event. | ||
@@ -248,2 +299,29 @@ * - **Rejects** the promise with an AmqpError when rhea emits the "sender_close" event while trying | ||
| createSender(options) { | ||
| return this._createSender(SenderType.sender, options); | ||
| } | ||
| /** | ||
| * Creates an awaitable amqp sender on this session. | ||
| * @param options Options that can be provided while creating an async amqp sender. | ||
| * - If `onError` and `onSessionError` handlers are not provided then the `AwaitableSender` will | ||
| * clear the timer and reject the Promise for all the entries of inflight send operation in its | ||
| * `deliveryDispositionMap`. | ||
| * - If the user is handling the reconnection of sender link or the underlying connection in it's | ||
| * app, then the `onError` and `onSessionError` handlers must be provided by the user and (s)he | ||
| * shall be responsible of clearing the `deliveryDispotionMap` of inflight `send()` operation. | ||
| * | ||
| * @return Promise<AwaitableSender> | ||
| * - **Resolves** the promise with the Sender object when rhea emits the "sender_open" event. | ||
| * - **Rejects** the promise with an AmqpError when rhea emits the "sender_close" event while trying | ||
| * to create an amqp sender or the operation timeout occurs. | ||
| */ | ||
| createAwaitableSender(options) { | ||
| return this._createSender(SenderType.AwaitableSender, options); | ||
| } | ||
| /** | ||
| * Creates the Sender based on the provided type. | ||
| * @internal | ||
| * @param type The type of sender | ||
| * @param options Options to be provided while creating the sender. | ||
| */ | ||
| _createSender(type, options) { | ||
| return new Promise((resolve, reject) => { | ||
@@ -253,15 +331,22 @@ // Register session handlers for session_error and session_close if provided. | ||
| this.on(rhea_1.SessionEvents.sessionError, options.onSessionError); | ||
| log.session("[%s] Added event handler for event '%s' on rhea-promise 'session', " + | ||
| "while creating the sender.", this.connection.id, rhea_1.SessionEvents.sessionError); | ||
| log.session("[%s] Added event handler for event '%s' on rhea-promise 'session: %s', " + | ||
| "while creating the sender.", this.connection.id, rhea_1.SessionEvents.sessionError, this.id); | ||
| } | ||
| if (options && options.onSessionClose) { | ||
| this.on(rhea_1.SessionEvents.sessionClose, options.onSessionClose); | ||
| log.session("[%s] Added event handler for event '%s' on rhea-promise 'session', " + | ||
| "while creating the sender.", this.connection.id, rhea_1.SessionEvents.sessionClose); | ||
| log.session("[%s] Added event handler for event '%s' on rhea-promise 'session: %s', " + | ||
| "while creating the sender.", this.connection.id, rhea_1.SessionEvents.sessionClose, this.id); | ||
| } | ||
| const rheaSender = this._session.attach_sender(options); | ||
| const sender = new sender_1.Sender(this, rheaSender, options); | ||
| let sender; | ||
| if (type === SenderType.sender) { | ||
| sender = new sender_1.Sender(this, rheaSender, options); | ||
| } | ||
| else { | ||
| sender = new awaitableSender_1.AwaitableSender(this, rheaSender, options); | ||
| } | ||
| sender.actionInitiated++; | ||
| let onSendable; | ||
| let onClose; | ||
| let onDisconnected; | ||
| let waitTimer; | ||
@@ -277,14 +362,16 @@ // listeners provided by the user in the options object should be added | ||
| } | ||
| if (options.onAccepted) { | ||
| sender.on(rhea_1.SenderEvents.accepted, options.onAccepted); | ||
| if (type === SenderType.sender) { | ||
| if (options.onAccepted) { | ||
| sender.on(rhea_1.SenderEvents.accepted, options.onAccepted); | ||
| } | ||
| if (options.onRejected) { | ||
| sender.on(rhea_1.SenderEvents.rejected, options.onRejected); | ||
| } | ||
| if (options.onReleased) { | ||
| sender.on(rhea_1.SenderEvents.released, options.onReleased); | ||
| } | ||
| if (options.onModified) { | ||
| sender.on(rhea_1.SenderEvents.modified, options.onModified); | ||
| } | ||
| } | ||
| if (options.onRejected) { | ||
| sender.on(rhea_1.SenderEvents.rejected, options.onRejected); | ||
| } | ||
| if (options.onReleased) { | ||
| sender.on(rhea_1.SenderEvents.released, options.onReleased); | ||
| } | ||
| if (options.onModified) { | ||
| sender.on(rhea_1.SenderEvents.modified, options.onModified); | ||
| } | ||
| } | ||
@@ -296,6 +383,7 @@ const removeListeners = () => { | ||
| rheaSender.removeListener(rhea_1.SenderEvents.senderClose, onClose); | ||
| rheaSender.session.connection.removeListener(rhea_1.ConnectionEvents.disconnected, onDisconnected); | ||
| }; | ||
| onSendable = (context) => { | ||
| removeListeners(); | ||
| log.sender("[%s] Resolving the promise with amqp sender '%s'.", this.connection.id, sender.name); | ||
| log.sender("[%s] Resolving the promise with amqp sender '%s' on amqp session '%s'.", this.connection.id, sender.name, this.id); | ||
| return resolve(sender); | ||
@@ -305,11 +393,21 @@ }; | ||
| removeListeners(); | ||
| log.error("[%s] Error occurred while creating a sender over amqp connection: %O.", this.connection.id, context.sender.error); | ||
| log.error("[%s] Error occurred while creating the amqp sender '%s' on amqp session '%s' " + | ||
| "over amqp connection: %O.", this.connection.id, sender.name, this.id, context.sender.error); | ||
| return reject(context.sender.error); | ||
| }; | ||
| onDisconnected = (context) => { | ||
| removeListeners(); | ||
| const error = context.connection && context.connection.error | ||
| ? context.connection.error | ||
| : context.error; | ||
| log.error("[%s] Connection got disconnected while creating amqp sender '%s' on amqp " + | ||
| "session '%s': %O.", this.connection.id, sender.name, this.id, error); | ||
| return reject(error); | ||
| }; | ||
| const actionAfterTimeout = () => { | ||
| removeListeners(); | ||
| const msg = `Unable to create the amqp sender ${sender.name} due to ` + | ||
| `operation timeout.`; | ||
| const msg = `Unable to create the amqp sender '${sender.name}' on amqp session ` + | ||
| `'${this.id}' due to operation timeout.`; | ||
| log.error("[%s] %s", this.connection.id, msg); | ||
| return reject(new operationTimeoutError_1.OperationTimeoutError(msg)); | ||
| return reject(new errorDefinitions_1.OperationTimeoutError(msg)); | ||
| }; | ||
@@ -319,2 +417,3 @@ // listeners that we add for completing the operation are added directly to rhea's objects. | ||
| rheaSender.once(rhea_1.SenderEvents.senderClose, onClose); | ||
| rheaSender.session.connection.on(rhea_1.ConnectionEvents.disconnected, onDisconnected); | ||
| waitTimer = setTimeout(actionAfterTimeout, this.connection.options.operationTimeoutInSeconds * 1000); | ||
@@ -387,4 +486,4 @@ }); | ||
| if (typeof this._session.eventNames === "function") { | ||
| log.eventHandler("[%s] rhea-promise 'session' object is listening for events: %o " + | ||
| "emitted by rhea's 'session' object.", this.connection.id, this._session.eventNames()); | ||
| log.eventHandler("[%s] rhea-promise 'session' object '%s' is listening for events: %o " + | ||
| "emitted by rhea's 'session' object.", this.connection.id, this.id, this._session.eventNames()); | ||
| } | ||
@@ -391,0 +490,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"session.js","sourceRoot":"","sources":["../../lib/session.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,8FAA8F;;AAE9F,6BAA6B;AAE7B,yCAAuD;AACvD,qCAAiD;AACjD,+BAGc;AACd,wCAA+D;AAE/D,qCAAkC;AAClC,mEAAgE;AAUhE;;;GAGG;AACH,MAAa,OAAQ,SAAQ,eAAM;IAIjC,YAAY,UAAsB,EAAE,OAAoB;QACtD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,yBAAyB,EAAE,CAAC;IACnC,CAAC;IACD;;;OAGG;IACH,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAI,QAAQ;QACV,OAAQ,IAAI,CAAC,QAAgB,CAAC,QAAQ,CAAC;IACzC,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACH,MAAM;QACJ,IAAI,MAAM,GAAG,KAAK,CAAC;QACnB,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE;YACxD,MAAM,GAAG,IAAI,CAAC;SACf;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;OAGG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IACnC,CAAC;IAED;;;;;;;OAOG;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AAW,EAAE,SAAS;gBACtB,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE;aACjC,CAAC;YACF,iBAAS,CAAC,MAAM,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;QAEH,WAAW;QACX,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,qBAAc,CAAC,aAAa,EAAE,CAAC,OAAO,EAAE,EAAE;YACzD,MAAM,MAAM,GAAmB;gBAC7B,WAAW,EAAE,OAAO;gBACpB,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,qBAAc,CAAC,aAAa;gBACvC,WAAW,EAAE,SAAS;gBACtB,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE;aACjC,CAAC;YACF,iBAAS,CAAC,MAAM,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,qBAAc,CAAC,aAAa,EAAE,CAAC,OAAO,EAAE,EAAE;YACzD,MAAM,MAAM,GAAmB;gBAC7B,WAAW,EAAE,OAAO;gBACpB,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,qBAAc,CAAC,aAAa;gBACvC,WAAW,EAAE,SAAS;gBACtB,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE;aACjC,CAAC;YACF,iBAAS,CAAC,MAAM,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;QACH,IAAI,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,KAAK,UAAU,EAAE;YAClD,GAAG,CAAC,YAAY,CAAC,sEAAsE;gBACrF,qCAAqC,EACrC,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;SAC5D;IACH,CAAC;CACF;AA7fD,0BA6fC"} |
@@ -128,3 +128,5 @@ "use strict"; | ||
| const emit = () => { | ||
| log[params.emitterType]("[%s] %s got event: '%s'. Re-emitting the translated context.", params.connectionId, params.emitterType, params.eventName); | ||
| const id = params.emitter && | ||
| (params.emitter.id || params.emitter.name); | ||
| log[params.emitterType]("[%s] %s '%s' got event: '%s'. Re-emitting the translated context.", params.connectionId, params.emitterType, id, params.eventName); | ||
| params.emitter.emit(params.eventName, eventContext_1.EventContext.translate(params.rheaContext, params.emitter, params.eventName)); | ||
@@ -131,0 +133,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../lib/util/utils.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,8FAA8F;;AAM9F,8BAA8B;AAC9B,kDAA+C;AAE/C;;;;GAIG;AACH,IAAY,sBAgDX;AAhDD,WAAY,sBAAsB;IAChC,6EAAc,CAAA;IACd,iGAAwB,CAAA;IACxB,iEAAQ,CAAA;IACR,2EAAa,CAAA;IACb,6EAAc,CAAA;IACd,mHAAiC,CAAA;IACjC,+EAAe,CAAA;IACf,qFAAkB,CAAA;IAClB,yFAAoB,CAAA;IACpB,+EAAe,CAAA;IACf,2FAAqB,CAAA;IACrB,uEAAW,CAAA;IACX,6FAAsB,CAAA;IACtB,uEAAW,CAAA;IACX,6EAAc,CAAA;IACd,yFAAoB,CAAA;IACpB,6EAAc,CAAA;IACd,mFAAiB,CAAA;IACjB,6EAAc,CAAA;IACd,yEAAY,CAAA;IACZ,6FAAsB,CAAA;IACtB,+FAAuB,CAAA;IACvB,iFAAgB,CAAA;IAChB,qFAAkB,CAAA;IAClB,2FAAqB,CAAA;IACrB,+EAAe,CAAA;IACf,6EAAc,CAAA;IACd,6FAAsB,CAAA;IACtB,uFAAmB,CAAA;IACnB,mHAAiC,CAAA;IACjC,yFAAoB,CAAA;IACpB,6EAAc,CAAA;IACd,qEAAU,CAAA;IACV,yFAAoB,CAAA;IACpB,iGAAwB,CAAA;IACxB,uGAA2B,CAAA;IAC3B,+FAAuB,CAAA;IACvB,qGAA0B,CAAA;IAC1B,qHAAkC,CAAA;IAClC,+FAAuB,CAAA;I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W,CAAC,CAAC,mEAAmE,EACzF,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,WAAW,EAAE,EAAE,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;QACjE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,EAClC,2BAAY,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;IAClF,CAAC,CAAC;IACF,IAAI,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,eAAe,GAAG,CAAC,EAAE;QAClF,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,gEAAgE;YACtF,iEAAiE,EAAE,MAAM,CAAC,YAAY,EACtF,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;QACxC,6FAA6F;QAC7F,wFAAwF;QACxF,uEAAuE;QACvE,UAAU,CAAC,IAAI,CAAC,CAAC;KAClB;SAAM;QACL,IAAI,EAAE,CAAC;KACR;AACH,CAAC;AApBD,8BAoBC"} |
+61
-4
@@ -21,3 +21,4 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| import { Entity } from "./entity"; | ||
| import { OperationTimeoutError } from "./operationTimeoutError"; | ||
| import { OperationTimeoutError } from "./errorDefinitions"; | ||
| import { AwaitableSender, AwaitableSenderOptions } from "./awaitableSender"; | ||
@@ -34,2 +35,11 @@ /** | ||
| /** | ||
| * Describes the options that can be provided while creating an Async AMQP sender. | ||
| * One can also provide a session if it was already created. | ||
| * @interface AwaitableSenderOptionsWithSession | ||
| */ | ||
| export interface AwaitableSenderOptionsWithSession extends AwaitableSenderOptions { | ||
| session?: Session; | ||
| } | ||
| /** | ||
| * Describes the options that can be provided while creating an AMQP receiver. One can also provide | ||
@@ -329,2 +339,3 @@ * a session if it was already created. | ||
| let onError: Func<RheaEventContext, void>; | ||
| let onDisconnected: Func<RheaEventContext, void>; | ||
| let waitTimer: any; | ||
@@ -336,2 +347,3 @@ const removeListeners = () => { | ||
| this._connection.removeListener(ConnectionEvents.connectionClose, onClose); | ||
| this._connection.removeListener(ConnectionEvents.disconnected, onDisconnected); | ||
| }; | ||
@@ -353,2 +365,10 @@ | ||
| onDisconnected = (context: RheaEventContext) => { | ||
| removeListeners(); | ||
| const error = context.connection && context.connection.error | ||
| ? context.connection.error | ||
| : context.error; | ||
| log.error("[%s] Connection got disconnected while closing itself: %O.", this.id, error); | ||
| }; | ||
| const actionAfterTimeout = () => { | ||
@@ -364,2 +384,3 @@ removeListeners(); | ||
| this._connection.once(ConnectionEvents.connectionError, onError); | ||
| this._connection.once(ConnectionEvents.disconnected, onDisconnected); | ||
| waitTimer = setTimeout(actionAfterTimeout, this.options!.operationTimeoutInSeconds! * 1000); | ||
@@ -452,2 +473,3 @@ this._connection.close(); | ||
| let onClose: Func<RheaEventContext, void>; | ||
| let onDisconnected: Func<RheaEventContext, void>; | ||
| let waitTimer: any; | ||
@@ -460,2 +482,3 @@ | ||
| rheaSession.removeListener(SessionEvents.sessionClose, onClose); | ||
| rheaSession.connection.removeListener(ConnectionEvents.disconnected, onDisconnected); | ||
| }; | ||
@@ -465,3 +488,3 @@ | ||
| removeListeners(); | ||
| log.session("[%s] Resolving the promise with amqp session.", this.id); | ||
| log.session("[%s] Resolving the promise with amqp session '%s'.", this.id, session.id); | ||
| return resolve(session); | ||
@@ -477,2 +500,12 @@ }; | ||
| onDisconnected = (context: RheaEventContext) => { | ||
| removeListeners(); | ||
| const error = context.connection && context.connection.error | ||
| ? context.connection.error | ||
| : context.error; | ||
| log.error("[%s] Connection got disconnected while creating amqp session '%s': %O.", | ||
| this.id, session.id, error); | ||
| return reject(error); | ||
| }; | ||
| const actionAfterTimeout = () => { | ||
@@ -488,2 +521,3 @@ removeListeners(); | ||
| rheaSession.once(SessionEvents.sessionClose, onClose); | ||
| rheaSession.connection.once(ConnectionEvents.disconnected, onDisconnected); | ||
| log.session("[%s] Calling amqp session.begin().", this.id); | ||
@@ -509,2 +543,22 @@ waitTimer = setTimeout(actionAfterTimeout, this.options!.operationTimeoutInSeconds! * 1000); | ||
| /** | ||
| * Creates an awaitable amqp sender. It either uses the provided session or creates a new one. | ||
| * @param options Optional parameters to create an awaitable sender link. | ||
| * - If `onError` and `onSessionError` handlers are not provided then the `AwaitableSender` will | ||
| * clear the timer and reject the Promise for all the entries of inflight send operation in its | ||
| * `deliveryDispositionMap`. | ||
| * - If the user is handling the reconnection of sender link or the underlying connection in it's | ||
| * app, then the `onError` and `onSessionError` handlers must be provided by the user and (s)he | ||
| * shall be responsible of clearing the `deliveryDispotionMap` of inflight `send()` operation. | ||
| * | ||
| * @return Promise<AwaitableSender>. | ||
| */ | ||
| async createAwaitableSender(options?: AwaitableSenderOptionsWithSession): Promise<AwaitableSender> { | ||
| if (options && options.session && options.session.createAwaitableSender) { | ||
| return options.session.createAwaitableSender(options); | ||
| } | ||
| const session = await this.createSession(); | ||
| return session.createAwaitableSender(options); | ||
| } | ||
| /** | ||
| * Creates an amqp receiver link. It either uses the provided session or creates a new one. | ||
@@ -545,4 +599,4 @@ * @param {ReceiverOptionsWithSession} options Optional parameters to create a receiver link. | ||
| ]); | ||
| log.connection("[%s] Successfully created the sender and receiver links on the same session.", | ||
| this.id); | ||
| log.connection("[%s] Successfully created the sender '%s' and receiver '%s' on the same " + | ||
| "amqp session '%s'.", this.id, sender.name, receiver.name, session.id); | ||
| return { | ||
@@ -571,2 +625,5 @@ session: session, | ||
| }; | ||
| if (eventName === ConnectionEvents.protocolError) { | ||
| log.connection("[%s] ProtocolError is: %O.", this.id, context); | ||
| } | ||
| emitEvent(params); | ||
@@ -573,0 +630,0 @@ }); |
@@ -97,4 +97,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| eventName: string): EventContext { | ||
| const connectionId = (rheaContext.connection && rheaContext.connection.options) ? rheaContext.connection.options.id : ""; | ||
| log.contextTranslator("[%s] Translating the context for event: '%s'.", connectionId, eventName); | ||
| const connection: Connection = emitter instanceof Connection | ||
| ? emitter | ||
| : (emitter as Link | Session).connection; | ||
| log.contextTranslator("[%s] Translating the context for event: '%s'.", connection.id, eventName); | ||
| // initialize the result | ||
@@ -106,6 +110,2 @@ const result: EventContext = { | ||
| const connection: Connection = emitter instanceof Connection | ||
| ? emitter | ||
| : (emitter as Link | Session).connection; | ||
| // set rhea-promise connection and container | ||
@@ -112,0 +112,0 @@ result.connection = connection; |
+7
-1
@@ -10,3 +10,4 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| SessionEvents, ContainerOptions as ContainerOptionsBase, TerminusOptions, Types, Sasl, | ||
| EndpointOptions, MessageUtil, TypeError, SimpleError, Source, ConnectionError, Typed, WebSocketImpl, WebSocketInstance | ||
| EndpointOptions, MessageUtil, TypeError, SimpleError, Source, ConnectionError, Typed, | ||
| WebSocketImpl, WebSocketInstance, TargetTerminusOptions | ||
| } from "rhea"; | ||
@@ -22,2 +23,4 @@ | ||
| export { Sender, SenderOptions } from "./sender"; | ||
| export { AwaitableSenderOptions, AwaitableSender, PromiseLike } from "./awaitableSender"; | ||
| export { LinkCloseOptions } from "./link"; | ||
| export { | ||
@@ -27,1 +30,4 @@ Func, AmqpResponseStatusCode, isAmqpError, ConnectionStringParseOptions, delay, messageHeader, | ||
| } from "./util/utils"; | ||
| export { | ||
| InsufficientCreditError, OperationTimeoutError, SendOperationFailedError | ||
| } from "./errorDefinitions"; |
+49
-16
@@ -7,3 +7,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| link, LinkOptions, AmqpError, Dictionary, Source, TerminusOptions, SenderEvents, ReceiverEvents, | ||
| EventContext as RheaEventContext | ||
| EventContext as RheaEventContext, ConnectionEvents | ||
| } from "rhea"; | ||
@@ -14,3 +14,3 @@ import { Session } from "./session"; | ||
| import { Entity } from "./entity"; | ||
| import { OperationTimeoutError } from "./operationTimeoutError"; | ||
| import { OperationTimeoutError } from "./errorDefinitions"; | ||
@@ -22,2 +22,15 @@ export enum LinkType { | ||
| /** | ||
| * @interface LinkCloseOptions | ||
| * Describes the options that can be provided while closing the link. | ||
| */ | ||
| export interface LinkCloseOptions { | ||
| /** | ||
| * Indicates whether the underlying amqp session should also be closed when the | ||
| * link is being closed. | ||
| * - **Default: `true`**. | ||
| */ | ||
| closeSession?: boolean; | ||
| } | ||
| export abstract class Link extends Entity { | ||
@@ -214,5 +227,6 @@ linkOptions?: LinkOptions; | ||
| /** | ||
| * Closes the underlying amqp link and session in rhea if open. Also removes all the event | ||
| * handlers added in the rhea-promise library on the link and it's session | ||
| * @return {Promise<void>} Promise<void> | ||
| * Closes the underlying amqp link and optionally the session as well in rhea if open. | ||
| * Also removes all the event handlers added in the rhea-promise library on the link | ||
| * and optionally it's session. | ||
| * @returns Promise<void> | ||
| * - **Resolves** the promise when rhea emits the "sender_close" | "receiver_close" event. | ||
@@ -222,6 +236,9 @@ * - **Rejects** the promise with an AmqpError when rhea emits the | ||
| */ | ||
| async close(): Promise<void> { | ||
| async close(options?: LinkCloseOptions): Promise<void> { | ||
| if (!options) options = {}; | ||
| if (options.closeSession == undefined) options.closeSession = true; | ||
| this.removeAllListeners(); | ||
| await new Promise<void>((resolve, reject) => { | ||
| log.error("[%s] The %s is open ? -> %s", this.connection.id, this.type, this.isOpen()); | ||
| log.error("[%s] The %s '%s' on amqp session '%s' is open ? -> %s", | ||
| this.connection.id, this.type, this.name, this.session.id, this.isOpen()); | ||
| if (this.isOpen()) { | ||
@@ -236,2 +253,3 @@ const errorEvent = this.type === LinkType.sender | ||
| let onClose: Func<RheaEventContext, void>; | ||
| let onDisconnected: Func<RheaEventContext, void>; | ||
| let waitTimer: any; | ||
@@ -244,2 +262,3 @@ | ||
| this._link.removeListener(closeEvent, onClose); | ||
| this._link.connection.removeListener(ConnectionEvents.disconnected, onDisconnected); | ||
| }; | ||
@@ -249,4 +268,4 @@ | ||
| removeListeners(); | ||
| log[this.type]("[%s] Resolving the promise as the amqp %s has been closed.", | ||
| this.connection.id, this.type); | ||
| log[this.type]("[%s] Resolving the promise as the %s '%s' on amqp session '%s' " + | ||
| "has been closed.", this.connection.id, this.type, this.name, this.session.id); | ||
| return resolve(); | ||
@@ -257,11 +276,21 @@ }; | ||
| removeListeners(); | ||
| log.error("[%s] Error occurred while closing amqp %s: %O.", | ||
| this.connection.id, this.type, context.session!.error); | ||
| log.error("[%s] Error occurred while closing %s '%s' on amqp session '%s': %O.", | ||
| this.connection.id, this.type, this.name, this.session.id, context.session!.error); | ||
| return reject(context.session!.error); | ||
| }; | ||
| onDisconnected = (context: RheaEventContext) => { | ||
| removeListeners(); | ||
| const error = context.connection && context.connection.error | ||
| ? context.connection.error | ||
| : context.error; | ||
| log.error("[%s] Connection got disconnected while closing amqp %s '%s' on amqp " + | ||
| "session '%s': %O.", this.connection.id, this.type, this.name, this.session.id, error); | ||
| }; | ||
| const actionAfterTimeout = () => { | ||
| removeListeners(); | ||
| const msg: string = `Unable to close the amqp %s ${this.name} due to operation timeout.`; | ||
| log.error("[%s] %s", this.connection.id, this.type, msg); | ||
| const msg: string = `Unable to close the ${this.type} '${this.name}' ` + | ||
| `on amqp session '${this.session.id}' due to operation timeout.`; | ||
| log.error("[%s] %s", this.connection.id, msg); | ||
| return reject(new OperationTimeoutError(msg)); | ||
@@ -273,2 +302,3 @@ }; | ||
| this._link.once(errorEvent, onError); | ||
| this._link.connection.once(ConnectionEvents.disconnected, onDisconnected); | ||
| waitTimer = setTimeout(actionAfterTimeout, | ||
@@ -282,5 +312,8 @@ this.connection.options!.operationTimeoutInSeconds! * 1000); | ||
| }); | ||
| log[this.type]("[%s] %s has been closed, now closing it's session.", | ||
| this.connection.id, this.type); | ||
| return this._session.close(); | ||
| if (options.closeSession) { | ||
| log[this.type]("[%s] %s '%s' has been closed, now closing it's amqp session '%s'.", | ||
| this.connection.id, this.type, this.name, this.session.id); | ||
| return this._session.close(); | ||
| } | ||
| } | ||
@@ -287,0 +320,0 @@ |
+43
-26
@@ -13,6 +13,33 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| /** | ||
| * Descibes the options that can be provided while creating an AMQP Basesender. | ||
| * @interface BaseSenderOptions | ||
| */ | ||
| export interface BaseSenderOptions extends RheaSenderOptions { | ||
| /** | ||
| * @property {OnAmqpEvent} [onError] The handler that can be provided for receiving any | ||
| * errors that occur on the "sender_error" event. | ||
| */ | ||
| onError?: OnAmqpEvent; | ||
| /** | ||
| * @property {OnAmqpEvent} [onClose] The handler that can be provided for receiving the | ||
| * "sender_close" event. | ||
| */ | ||
| onClose?: OnAmqpEvent; | ||
| /** | ||
| * @property {OnAmqpEvent} [onSessionError] The handler that can be provided for receiving | ||
| * the "session_error" event that occurs on the underlying session. | ||
| */ | ||
| onSessionError?: OnAmqpEvent; | ||
| /** | ||
| * @property {OnAmqpEvent} [onSessionClose] The handler that can be provided for receiving the | ||
| * "session_close" event that occurs on the underlying session. | ||
| */ | ||
| onSessionClose?: OnAmqpEvent; | ||
| } | ||
| /** | ||
| * Descibes the options that can be provided while creating an AMQP sender. | ||
| * @interface SenderOptions | ||
| */ | ||
| export interface SenderOptions extends RheaSenderOptions { | ||
| export interface SenderOptions extends BaseSenderOptions { | ||
| /** | ||
@@ -38,22 +65,2 @@ * @property {OnAmqpEvent} [onAccepted] The handler that can be provided for receiving the | ||
| onModified?: OnAmqpEvent; | ||
| /** | ||
| * @property {OnAmqpEvent} [onError] The handler that can be provided for receiving any | ||
| * errors that occur on the "sender_error" event. | ||
| */ | ||
| onError?: OnAmqpEvent; | ||
| /** | ||
| * @property {OnAmqpEvent} [onClose] The handler that can be provided for receiving the | ||
| * "sender_close" event. | ||
| */ | ||
| onClose?: OnAmqpEvent; | ||
| /** | ||
| * @property {OnAmqpEvent} [onSessionError] The handler that can be provided for receiving | ||
| * the "session_error" event that occurs on the underlying session. | ||
| */ | ||
| onSessionError?: OnAmqpEvent; | ||
| /** | ||
| * @property {OnAmqpEvent} [onSessionClose] The handler that can be provided for receiving the | ||
| * "session_close" event that occurs on the underlying session. | ||
| */ | ||
| onSessionClose?: OnAmqpEvent; | ||
| } | ||
@@ -70,9 +77,8 @@ | ||
| /** | ||
| * Describes the sender that wraps the rhea sender. | ||
| * @class Sender | ||
| * Describes the base sender that wraps the rhea sender. | ||
| * @class BaseSender | ||
| */ | ||
| export class Sender extends Link { | ||
| senderOptions?: SenderOptions; | ||
| export class BaseSender extends Link { | ||
| constructor(session: Session, sender: RheaSender, options?: SenderOptions) { | ||
| constructor(session: Session, sender: RheaSender, options?: BaseSenderOptions) { | ||
| super(LinkType.sender, session, sender, options); | ||
@@ -92,3 +98,14 @@ } | ||
| } | ||
| } | ||
| /** | ||
| * Describes the AMQP Sender. | ||
| * @class Sender | ||
| */ | ||
| export class Sender extends BaseSender { | ||
| constructor(session: Session, sender: RheaSender, options?: SenderOptions) { | ||
| super(session, sender, options); | ||
| } | ||
| /** | ||
@@ -95,0 +112,0 @@ * Sends the message |
+159
-48
@@ -10,3 +10,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| SenderEvents, ReceiverEvents, SessionEvents, AmqpError, Session as RheaSession, | ||
| EventContext as RheaEventContext | ||
| EventContext as RheaEventContext, ConnectionEvents | ||
| } from "rhea"; | ||
@@ -16,3 +16,4 @@ import { Func, EmitParameters, emitEvent } from "./util/utils"; | ||
| import { Entity } from "./entity"; | ||
| import { OperationTimeoutError } from "./operationTimeoutError"; | ||
| import { OperationTimeoutError } from "./errorDefinitions"; | ||
| import { AwaitableSender, AwaitableSenderOptions } from "./awaitableSender"; | ||
@@ -28,2 +29,10 @@ /** | ||
| /** | ||
| * @internal | ||
| */ | ||
| enum SenderType { | ||
| sender = "sender", | ||
| AwaitableSender = "AwaitableSender" | ||
| } | ||
| /** | ||
| * Describes the session that wraps the rhea session. | ||
@@ -59,2 +68,25 @@ * @class Session | ||
| /** | ||
| * Returns the unique identifier for the session in the format: | ||
| * "local_<number>-remote_<number>-<connection-id>" or an empty string if the local channel or | ||
| * remote channel are not yet defined. | ||
| */ | ||
| get id(): string { | ||
| let result: string = ""; | ||
| const session: any = this._session; | ||
| if (session.local) { | ||
| result += `local-${session.local.channel}_`; | ||
| } | ||
| if (session.remote) { | ||
| result += `remote-${session.remote.channel}_`; | ||
| } | ||
| if (result) { | ||
| result += `${this._connection.id}`; | ||
| } | ||
| return result; | ||
| } | ||
| /** | ||
| * Determines whether the session and the underlying connection is open. | ||
@@ -121,6 +153,7 @@ * @returns {boolean} result `true` - is open; `false` otherwise. | ||
| return new Promise<void>((resolve, reject) => { | ||
| log.error("[%s] The session is open ? -> %s", this.connection.id, this.isOpen()); | ||
| log.error("[%s] The amqp session '%s' is open ? -> %s", this.connection.id, this.id, this.isOpen()); | ||
| if (this.isOpen()) { | ||
| let onError: Func<RheaEventContext, void>; | ||
| let onClose: Func<RheaEventContext, void>; | ||
| let onDisconnected: Func<RheaEventContext, void>; | ||
| let waitTimer: any; | ||
@@ -133,2 +166,3 @@ | ||
| this._session.removeListener(SessionEvents.sessionClose, onClose); | ||
| this._session.connection.removeListener(ConnectionEvents.disconnected, onDisconnected); | ||
| }; | ||
@@ -138,4 +172,4 @@ | ||
| removeListeners(); | ||
| log.session("[%s] Resolving the promise as the amqp session has been closed.", | ||
| this.connection.id); | ||
| log.session("[%s] Resolving the promise as the amqp session '%s' has been closed.", | ||
| this.connection.id, this.id); | ||
| return resolve(); | ||
@@ -146,10 +180,19 @@ }; | ||
| removeListeners(); | ||
| log.error("[%s] Error occurred while closing amqp session.", | ||
| this.connection.id, context.session!.error); | ||
| log.error("[%s] Error occurred while closing amqp session '%s'.", | ||
| this.connection.id, this.id, context.session!.error); | ||
| reject(context.session!.error); | ||
| }; | ||
| onDisconnected = (context: RheaEventContext) => { | ||
| removeListeners(); | ||
| const error = context.connection && context.connection.error | ||
| ? context.connection.error | ||
| : context.error; | ||
| log.error("[%s] Connection got disconnected while closing amqp session '%s': %O.", | ||
| this.connection.id, this.id, error); | ||
| }; | ||
| const actionAfterTimeout = () => { | ||
| removeListeners(); | ||
| const msg: string = `Unable to close the amqp session due to operation timeout.`; | ||
| const msg: string = `Unable to close the amqp session ${this.id} due to operation timeout.`; | ||
| log.error("[%s] %s", this.connection.id, msg); | ||
@@ -162,3 +205,4 @@ reject(new OperationTimeoutError(msg)); | ||
| this._session.once(SessionEvents.sessionError, onError); | ||
| log.session("[%s] Calling session.close()", this.connection.id); | ||
| this._session.connection.once(ConnectionEvents.disconnected, onDisconnected); | ||
| log.session("[%s] Calling session.close() for amqp session '%s'.", this.connection.id, this.id); | ||
| waitTimer = setTimeout(actionAfterTimeout, this.connection.options!.operationTimeoutInSeconds! * 1000); | ||
@@ -175,5 +219,5 @@ this._session.close(); | ||
| * Creates an amqp receiver on this session. | ||
| * @param {Session} session The amqp session object on which the receiver link needs to be established. | ||
| * @param {ReceiverOptions} [options] Options that can be provided while creating an amqp receiver. | ||
| * @return {Promise<Receiver>} Promise<Receiver> | ||
| * @param session The amqp session object on which the receiver link needs to be established. | ||
| * @param options Options that can be provided while creating an amqp receiver. | ||
| * @return Promise<Receiver> | ||
| * - **Resolves** the promise with the Receiver object when rhea emits the "receiver_open" event. | ||
@@ -209,4 +253,4 @@ * - **Rejects** the promise with an AmqpError when rhea emits the "receiver_close" event while trying | ||
| this.on(SessionEvents.sessionError, options.onSessionError); | ||
| log.session("[%s] Added event handler for event '%s' on rhea-promise 'session', " + | ||
| "while creating the 'receiver'.", this.connection.id, SessionEvents.sessionError); | ||
| log.session("[%s] Added event handler for event '%s' on rhea-promise 'session: %s', " + | ||
| "while creating the 'receiver'.", this.connection.id, SessionEvents.sessionError, this.id); | ||
| } | ||
@@ -216,4 +260,4 @@ | ||
| this.on(SessionEvents.sessionClose, options.onSessionClose); | ||
| log.session("[%s] Added event handler for event '%s' on rhea-promise 'session', " + | ||
| " while creating the 'receiver'.", this.connection.id, SessionEvents.sessionClose); | ||
| log.session("[%s] Added event handler for event '%s' on rhea-promise 'session: %s', " + | ||
| " while creating the 'receiver'.", this.connection.id, SessionEvents.sessionClose, this.id); | ||
| } | ||
@@ -225,2 +269,3 @@ const rheaReceiver = this._session.attach_receiver(options); | ||
| let onClose: Func<RheaEventContext, void>; | ||
| let onDisconnected: Func<RheaEventContext, void>; | ||
| let waitTimer: any; | ||
@@ -256,2 +301,3 @@ | ||
| rheaReceiver.removeListener(ReceiverEvents.receiverClose, onClose); | ||
| rheaReceiver.session.connection.removeListener(ConnectionEvents.disconnected, onDisconnected); | ||
| }; | ||
@@ -261,4 +307,4 @@ | ||
| removeListeners(); | ||
| log.receiver("[%s] Resolving the promise with amqp receiver '%s'.", | ||
| this.connection.id, receiver.name); | ||
| log.receiver("[%s] Resolving the promise with amqp receiver '%s' on amqp session '%s'.", | ||
| this.connection.id, receiver.name, this.id); | ||
| return resolve(receiver); | ||
@@ -269,11 +315,22 @@ }; | ||
| removeListeners(); | ||
| log.error("[%s] Error occurred while creating a receiver over amqp connection: %O.", | ||
| this.connection.id, context.receiver!.error); | ||
| log.error("[%s] Error occurred while creating the amqp receiver '%s' on amqp session " + | ||
| "'%s' over amqp connection: %O.", | ||
| this.connection.id, receiver.name, this.id, context.receiver!.error); | ||
| return reject(context.receiver!.error); | ||
| }; | ||
| onDisconnected = (context: RheaEventContext) => { | ||
| removeListeners(); | ||
| const error = context.connection && context.connection.error | ||
| ? context.connection.error | ||
| : context.error; | ||
| log.error("[%s] Connection got disconnected while creating amqp receiver '%s' on amqp " + | ||
| "session '%s': %O.", this.connection.id, receiver.name, this.id, error); | ||
| return reject(error); | ||
| }; | ||
| const actionAfterTimeout = () => { | ||
| removeListeners(); | ||
| const msg: string = `Unable to create the amqp receiver ${receiver.name} due to ` + | ||
| `operation timeout.`; | ||
| const msg: string = `Unable to create the amqp receiver '${receiver.name}' on amqp ` + | ||
| `session '${this.id}' due to operation timeout.`; | ||
| log.error("[%s] %s", this.connection.id, msg); | ||
@@ -286,2 +343,3 @@ return reject(new OperationTimeoutError(msg)); | ||
| rheaReceiver.once(ReceiverEvents.receiverClose, onClose); | ||
| rheaReceiver.session.connection.on(ConnectionEvents.disconnected, onDisconnected); | ||
| waitTimer = setTimeout(actionAfterTimeout, this.connection.options!.operationTimeoutInSeconds! * 1000); | ||
@@ -293,4 +351,4 @@ }); | ||
| * Creates an amqp sender on this session. | ||
| * @param {SenderOptions} [options] Options that can be provided while creating an amqp sender. | ||
| * @return {Promise<Sender>} Promise<Sender> | ||
| * @param options Options that can be provided while creating an amqp sender. | ||
| * @return Promise<Sender> | ||
| * - **Resolves** the promise with the Sender object when rhea emits the "sender_open" event. | ||
@@ -301,2 +359,33 @@ * - **Rejects** the promise with an AmqpError when rhea emits the "sender_close" event while trying | ||
| createSender(options?: SenderOptions): Promise<Sender> { | ||
| return this._createSender(SenderType.sender, options) as Promise<Sender>; | ||
| } | ||
| /** | ||
| * Creates an awaitable amqp sender on this session. | ||
| * @param options Options that can be provided while creating an async amqp sender. | ||
| * - If `onError` and `onSessionError` handlers are not provided then the `AwaitableSender` will | ||
| * clear the timer and reject the Promise for all the entries of inflight send operation in its | ||
| * `deliveryDispositionMap`. | ||
| * - If the user is handling the reconnection of sender link or the underlying connection in it's | ||
| * app, then the `onError` and `onSessionError` handlers must be provided by the user and (s)he | ||
| * shall be responsible of clearing the `deliveryDispotionMap` of inflight `send()` operation. | ||
| * | ||
| * @return Promise<AwaitableSender> | ||
| * - **Resolves** the promise with the Sender object when rhea emits the "sender_open" event. | ||
| * - **Rejects** the promise with an AmqpError when rhea emits the "sender_close" event while trying | ||
| * to create an amqp sender or the operation timeout occurs. | ||
| */ | ||
| createAwaitableSender(options?: AwaitableSenderOptions): Promise<AwaitableSender> { | ||
| return this._createSender(SenderType.AwaitableSender, options) as Promise<AwaitableSender>; | ||
| } | ||
| /** | ||
| * Creates the Sender based on the provided type. | ||
| * @internal | ||
| * @param type The type of sender | ||
| * @param options Options to be provided while creating the sender. | ||
| */ | ||
| private _createSender( | ||
| type: SenderType, | ||
| options?: SenderOptions | AwaitableSenderOptions): Promise<Sender | AwaitableSender> { | ||
| return new Promise((resolve, reject) => { | ||
@@ -306,4 +395,4 @@ // Register session handlers for session_error and session_close if provided. | ||
| this.on(SessionEvents.sessionError, options.onSessionError); | ||
| log.session("[%s] Added event handler for event '%s' on rhea-promise 'session', " + | ||
| "while creating the sender.", this.connection.id, SessionEvents.sessionError); | ||
| log.session("[%s] Added event handler for event '%s' on rhea-promise 'session: %s', " + | ||
| "while creating the sender.", this.connection.id, SessionEvents.sessionError, this.id); | ||
| } | ||
@@ -313,11 +402,17 @@ | ||
| this.on(SessionEvents.sessionClose, options.onSessionClose); | ||
| log.session("[%s] Added event handler for event '%s' on rhea-promise 'session', " + | ||
| "while creating the sender.", this.connection.id, SessionEvents.sessionClose); | ||
| log.session("[%s] Added event handler for event '%s' on rhea-promise 'session: %s', " + | ||
| "while creating the sender.", this.connection.id, SessionEvents.sessionClose, this.id); | ||
| } | ||
| const rheaSender = this._session.attach_sender(options); | ||
| const sender = new Sender(this, rheaSender, options); | ||
| let sender: Sender | AwaitableSender; | ||
| if (type === SenderType.sender) { | ||
| sender = new Sender(this, rheaSender, options); | ||
| } else { | ||
| sender = new AwaitableSender(this, rheaSender, options); | ||
| } | ||
| sender.actionInitiated++; | ||
| let onSendable: Func<RheaEventContext, void>; | ||
| let onClose: Func<RheaEventContext, void>; | ||
| let onDisconnected: Func<RheaEventContext, void>; | ||
| let waitTimer: any; | ||
@@ -334,14 +429,16 @@ | ||
| } | ||
| if (options.onAccepted) { | ||
| sender.on(SenderEvents.accepted, options.onAccepted); | ||
| if (type === SenderType.sender) { | ||
| if ((options as SenderOptions).onAccepted) { | ||
| sender.on(SenderEvents.accepted, (options as SenderOptions).onAccepted!); | ||
| } | ||
| if ((options as SenderOptions).onRejected) { | ||
| sender.on(SenderEvents.rejected, (options as SenderOptions).onRejected!); | ||
| } | ||
| if ((options as SenderOptions).onReleased) { | ||
| sender.on(SenderEvents.released, (options as SenderOptions).onReleased!); | ||
| } | ||
| if ((options as SenderOptions).onModified) { | ||
| sender.on(SenderEvents.modified, (options as SenderOptions).onModified!); | ||
| } | ||
| } | ||
| if (options.onRejected) { | ||
| sender.on(SenderEvents.rejected, options.onRejected); | ||
| } | ||
| if (options.onReleased) { | ||
| sender.on(SenderEvents.released, options.onReleased); | ||
| } | ||
| if (options.onModified) { | ||
| sender.on(SenderEvents.modified, options.onModified); | ||
| } | ||
| } | ||
@@ -354,2 +451,3 @@ | ||
| rheaSender.removeListener(SenderEvents.senderClose, onClose); | ||
| rheaSender.session.connection.removeListener(ConnectionEvents.disconnected, onDisconnected); | ||
| }; | ||
@@ -359,4 +457,4 @@ | ||
| removeListeners(); | ||
| log.sender("[%s] Resolving the promise with amqp sender '%s'.", | ||
| this.connection.id, sender.name); | ||
| log.sender("[%s] Resolving the promise with amqp sender '%s' on amqp session '%s'.", | ||
| this.connection.id, sender.name, this.id); | ||
| return resolve(sender); | ||
@@ -367,11 +465,22 @@ }; | ||
| removeListeners(); | ||
| log.error("[%s] Error occurred while creating a sender over amqp connection: %O.", | ||
| this.connection.id, context.sender!.error); | ||
| log.error("[%s] Error occurred while creating the amqp sender '%s' on amqp session '%s' " + | ||
| "over amqp connection: %O.", | ||
| this.connection.id, sender.name, this.id, context.sender!.error); | ||
| return reject(context.sender!.error); | ||
| }; | ||
| onDisconnected = (context: RheaEventContext) => { | ||
| removeListeners(); | ||
| const error = context.connection && context.connection.error | ||
| ? context.connection.error | ||
| : context.error; | ||
| log.error("[%s] Connection got disconnected while creating amqp sender '%s' on amqp " + | ||
| "session '%s': %O.", this.connection.id, sender.name, this.id, error); | ||
| return reject(error); | ||
| }; | ||
| const actionAfterTimeout = () => { | ||
| removeListeners(); | ||
| const msg: string = `Unable to create the amqp sender ${sender.name} due to ` + | ||
| `operation timeout.`; | ||
| const msg: string = `Unable to create the amqp sender '${sender.name}' on amqp session ` + | ||
| `'${this.id}' due to operation timeout.`; | ||
| log.error("[%s] %s", this.connection.id, msg); | ||
@@ -384,2 +493,3 @@ return reject(new OperationTimeoutError(msg)); | ||
| rheaSender.once(SenderEvents.senderClose, onClose); | ||
| rheaSender.session.connection.on(ConnectionEvents.disconnected, onDisconnected); | ||
| waitTimer = setTimeout(actionAfterTimeout, this.connection.options!.operationTimeoutInSeconds! * 1000); | ||
@@ -458,6 +568,7 @@ }); | ||
| if (typeof this._session.eventNames === "function") { | ||
| log.eventHandler("[%s] rhea-promise 'session' object is listening for events: %o " + | ||
| "emitted by rhea's 'session' object.", this.connection.id, this._session.eventNames()); | ||
| log.eventHandler("[%s] rhea-promise 'session' object '%s' is listening for events: %o " + | ||
| "emitted by rhea's 'session' object.", | ||
| this.connection.id, this.id, this._session.eventNames()); | ||
| } | ||
| } | ||
| } |
@@ -181,4 +181,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| const emit = () => { | ||
| log[params.emitterType]("[%s] %s got event: '%s'. Re-emitting the translated context.", | ||
| params.connectionId, params.emitterType, params.eventName); | ||
| const id = params.emitter && | ||
| ((params.emitter as Connection | Session).id || (params.emitter as Link).name); | ||
| log[params.emitterType]("[%s] %s '%s' got event: '%s'. Re-emitting the translated context.", | ||
| params.connectionId, params.emitterType, id, params.eventName); | ||
| params.emitter.emit(params.eventName, | ||
@@ -185,0 +187,0 @@ EventContext.translate(params.rheaContext, params.emitter, params.eventName)); |
+6
-6
| { | ||
| "name": "rhea-promise", | ||
| "version": "0.2.0", | ||
| "version": "1.0.0", | ||
| "description": "A Promisified layer over rhea AMQP client", | ||
@@ -10,4 +10,4 @@ "license": "Apache-2.0", | ||
| "debug": "^3.1.0", | ||
| "rhea": "^1.0.7", | ||
| "tslib": "^1.9.3" | ||
| "rhea": "^1.0.8", | ||
| "tslib": "^1.10.0" | ||
| }, | ||
@@ -26,5 +26,5 @@ "keywords": [ | ||
| "rimraf": "^2.6.3", | ||
| "ts-node": "^8.1.0", | ||
| "tslint": "^5.16.0", | ||
| "typescript": "^3.4.5", | ||
| "ts-node": "^8.2.0", | ||
| "tslint": "^5.17.0", | ||
| "typescript": "^3.5.1", | ||
| "dotenv": "^8.0.0" | ||
@@ -31,0 +31,0 @@ }, |
+79
-4
| # rhea-promise | ||
| A Promisified layer over rhea AMQP client. | ||
| A Promisified layer over [rhea](https://githhub.com/amqp/rhea) AMQP client. | ||
@@ -76,3 +76,3 @@ ## Pre-requisite ## | ||
| #### Sending a message. | ||
| #### Sending a message via `Sender`. | ||
| - Running the example from terminal: `> ts-node ./examples/send.ts`. | ||
@@ -134,4 +134,9 @@ | ||
| const delivery: Delivery = await sender.send(message); | ||
| console.log(">>>>>[%s] Delivery id: ", connection.id, delivery.id); | ||
| // Please, note that we are not awaiting on sender.send() | ||
| // You will notice that `delivery.settled` will be `false`. | ||
| const delivery: Delivery = sender.send(message); | ||
| console.log(">>>>>[%s] Delivery id: %d, settled: %s", | ||
| connection.id, | ||
| delivery.id, | ||
| delivery.settled); | ||
@@ -145,2 +150,68 @@ await sender.close(); | ||
| ### Sending a message via `AwaitableSender` | ||
| - Running the example from terminal: `> ts-node ./examples/awaitableSend.ts`. | ||
| ```typescript | ||
| import { | ||
| Connection, Message, ConnectionOptions, Delivery, AwaitableSenderOptions, AwaitableSender | ||
| } from "rhea-promise"; | ||
| import * as dotenv from "dotenv"; // Optional for loading environment configuration from a .env (config) file | ||
| dotenv.config(); | ||
| const host = process.env.AMQP_HOST || "host"; | ||
| const username = process.env.AMQP_USERNAME || "sharedAccessKeyName"; | ||
| const password = process.env.AMQP_PASSWORD || "sharedAccessKeyValue"; | ||
| const port = parseInt(process.env.AMQP_PORT || "5671"); | ||
| const senderAddress = process.env.SENDER_ADDRESS || "address"; | ||
| async function main(): Promise<void> { | ||
| const connectionOptions: ConnectionOptions = { | ||
| transport: "tls", | ||
| host: host, | ||
| hostname: host, | ||
| username: username, | ||
| password: password, | ||
| port: port, | ||
| reconnect: false | ||
| }; | ||
| const connection: Connection = new Connection(connectionOptions); | ||
| const senderName = "sender-1"; | ||
| const awaitableSenderOptions: AwaitableSenderOptions = { | ||
| name: senderName, | ||
| target: { | ||
| address: senderAddress | ||
| }, | ||
| sendTimeoutInSeconds: 10 | ||
| }; | ||
| await connection.open(); | ||
| // Notice that we are awaiting on the message being sent. | ||
| const sender: AwaitableSender = await connection.createAwaitableSender( | ||
| awaitableSenderOptions | ||
| ); | ||
| for (let i = 0; i < 10; i++) { | ||
| const message: Message = { | ||
| body: `Hello World - ${i}`, | ||
| message_id: i | ||
| }; | ||
| // Note: Here we are awaiting for the send to complete. | ||
| // You will notice that `delivery.settled` will be `true`, irrespective of whether the promise resolves or rejects. | ||
| const delivery: Delivery = await sender.send(message); | ||
| console.log( | ||
| "[%s] await sendMessage -> Delivery id: %d, settled: %s", | ||
| connection.id, | ||
| delivery.id, | ||
| delivery.settled | ||
| ); | ||
| } | ||
| await sender.close(); | ||
| await connection.close(); | ||
| } | ||
| main().catch((err) => console.log(err)); | ||
| ``` | ||
| ### Receiving a message | ||
@@ -228,1 +299,5 @@ - Running the example from terminal: `> ts-node ./examples/receive.ts`. | ||
| ``` | ||
| ## AMQP Protocol specification | ||
| Amqp protocol specification can be found [here](http://www.amqp.org/sites/amqp.org/files/amqp.pdf). |
+0
-1
@@ -44,3 +44,2 @@ { | ||
| "no-unused-variable": false, | ||
| "no-use-before-declare": true, | ||
| "no-var-keyword": true, | ||
@@ -47,0 +46,0 @@ "no-floating-promises": true, |
@@ -11,2 +11,3 @@ /// <reference types="node" /> | ||
| import { Entity } from "./entity"; | ||
| import { AwaitableSender, AwaitableSenderOptions } from "./awaitableSender"; | ||
| /** | ||
@@ -21,2 +22,10 @@ * Describes the options that can be provided while creating an AMQP sender. One can also provide | ||
| /** | ||
| * Describes the options that can be provided while creating an Async AMQP sender. | ||
| * One can also provide a session if it was already created. | ||
| * @interface AwaitableSenderOptionsWithSession | ||
| */ | ||
| export interface AwaitableSenderOptionsWithSession extends AwaitableSenderOptions { | ||
| session?: Session; | ||
| } | ||
| /** | ||
| * Describes the options that can be provided while creating an AMQP receiver. One can also provide | ||
@@ -249,2 +258,15 @@ * a session if it was already created. | ||
| /** | ||
| * Creates an awaitable amqp sender. It either uses the provided session or creates a new one. | ||
| * @param options Optional parameters to create an awaitable sender link. | ||
| * - If `onError` and `onSessionError` handlers are not provided then the `AwaitableSender` will | ||
| * clear the timer and reject the Promise for all the entries of inflight send operation in its | ||
| * `deliveryDispositionMap`. | ||
| * - If the user is handling the reconnection of sender link or the underlying connection in it's | ||
| * app, then the `onError` and `onSessionError` handlers must be provided by the user and (s)he | ||
| * shall be responsible of clearing the `deliveryDispotionMap` of inflight `send()` operation. | ||
| * | ||
| * @return Promise<AwaitableSender>. | ||
| */ | ||
| createAwaitableSender(options?: AwaitableSenderOptionsWithSession): Promise<AwaitableSender>; | ||
| /** | ||
| * Creates an amqp receiver link. It either uses the provided session or creates a new one. | ||
@@ -251,0 +273,0 @@ * @param {ReceiverOptionsWithSession} options Optional parameters to create a receiver link. |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../lib/connection.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,EACL,gBAAgB,EAChB,iBAAiB,IAAI,qBAAqB,EAAE,UAAU,IAAI,cAAc,EAAE,SAAS,EAAE,UAAU,EAC/F,eAAe,EAChB,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC;;;;GAIG;AACH,MAAM,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S,GAAG,KAAK,GAAG,SAAS;IAI1C;;;;OAIG;IACH,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAIrC;;;;;;OAMG;IACH,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;IAoD3B;;;;;;OAMG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA0DtB;;;OAGG;IACH,MAAM,IAAI,OAAO;IAQjB;;;;OAIG;IACH,iBAAiB,IAAI,IAAI;IAMzB;;;OAGG;IACH,YAAY,IAAI,OAAO;IAIvB;;;OAGG;IACH,QAAQ,IAAI,eAAe,GAAG,SAAS;IAIvC;;;OAGG;IACH,kBAAkB,IAAI,eAAe,GAAG,SAAS;IAIjD;;;OAGG;IACH,YAAY,IAAI,MAAM,GAAG,SAAS;IAIlC;;;;OAIG;IACH,iBAAiB,IAAI,OAAO;IAI5B;;;;;;OAMG;IACH,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;IA0DjC;;;;OAIG;IACG,YAAY,CAAC,OAAO,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC;IAQvE;;;;;;;;;;;OAWG;IACG,qBAAqB,CAAC,OAAO,CAAC,EAAE,iCAAiC,GAAG,OAAO,CAAC,eAAe,CAAC;IAQlG;;;;OAIG;IACG,cAAc,CAAC,OAAO,CAAC,EAAE,0BAA0B,GAAG,OAAO,CAAC,QAAQ,CAAC;IAQ7E;;;;;;;;;OASG;IACG,yBAAyB,CAAC,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAC5F,eAAe,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;IAqBjD;;;;;OAKG;IACH,OAAO,CAAC,yBAAyB;CA0FlC"} |
@@ -1,2 +0,2 @@ | ||
| export { Delivery, Message, MessageProperties, MessageHeader, EventContext as RheaEventContext, ConnectionOptions as ConnectionOptionsBase, AmqpError, Dictionary, types, message, filter, Filter, uuid_to_string, generate_uuid, string_to_uuid, LinkError, ProtocolError, LinkOptions, DeliveryAnnotations, MessageAnnotations, ReceiverEvents, SenderEvents, ConnectionEvents, SessionEvents, ContainerOptions as ContainerOptionsBase, TerminusOptions, Types, Sasl, EndpointOptions, MessageUtil, TypeError, SimpleError, Source, ConnectionError, Typed, WebSocketImpl, WebSocketInstance } from "rhea"; | ||
| export { Delivery, Message, MessageProperties, MessageHeader, EventContext as RheaEventContext, ConnectionOptions as ConnectionOptionsBase, AmqpError, Dictionary, types, message, filter, Filter, uuid_to_string, generate_uuid, string_to_uuid, LinkError, ProtocolError, LinkOptions, DeliveryAnnotations, MessageAnnotations, ReceiverEvents, SenderEvents, ConnectionEvents, SessionEvents, ContainerOptions as ContainerOptionsBase, TerminusOptions, Types, Sasl, EndpointOptions, MessageUtil, TypeError, SimpleError, Source, ConnectionError, Typed, WebSocketImpl, WebSocketInstance, TargetTerminusOptions } from "rhea"; | ||
| export { EventContext, OnAmqpEvent } from "./eventContext"; | ||
@@ -8,3 +8,6 @@ export { Container, ContainerOptions } from "./container"; | ||
| export { Sender, SenderOptions } from "./sender"; | ||
| export { AwaitableSenderOptions, AwaitableSender, PromiseLike } from "./awaitableSender"; | ||
| export { LinkCloseOptions } from "./link"; | ||
| export { Func, AmqpResponseStatusCode, isAmqpError, ConnectionStringParseOptions, delay, messageHeader, messageProperties, parseConnectionString, ParsedOutput } from "./util/utils"; | ||
| export { InsufficientCreditError, OperationTimeoutError, SendOperationFailedError } from "./errorDefinitions"; | ||
| //# sourceMappingURL=index.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,QAAQ,EAAE,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,IAAI,gBAAgB,EACrF,iBAAiB,IAAI,qBAAqB,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EACjG,cAAc,EAAE,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,EAAE,kBAAkB,EAAE,cAAc,EAAE,YAAY,EAAE,gBAAgB,EACvF,aAAa,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,eAAe,EAAE,KAAK,EAAE,IAAI,EACrF,eAAe,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,KAAK,EACpF,aAAa,EAAE,iBAAiB,EAAE,qBAAqB,EACxD,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EACL,UAAU,EAAE,UAAU,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,wBAAwB,EAChG,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EACL,IAAI,EAAE,sBAAsB,EAAE,WAAW,EAAE,4BAA4B,EAAE,KAAK,EAAE,aAAa,EAC7F,iBAAiB,EAAE,qBAAqB,EAAE,YAAY,EACvD,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,uBAAuB,EAAE,qBAAqB,EAAE,wBAAwB,EACzE,MAAM,oBAAoB,CAAC"} |
@@ -9,2 +9,14 @@ import { link, LinkOptions, AmqpError, Dictionary, Source, TerminusOptions } from "rhea"; | ||
| } | ||
| /** | ||
| * @interface LinkCloseOptions | ||
| * Describes the options that can be provided while closing the link. | ||
| */ | ||
| export interface LinkCloseOptions { | ||
| /** | ||
| * Indicates whether the underlying amqp session should also be closed when the | ||
| * link is being closed. | ||
| * - **Default: `true`**. | ||
| */ | ||
| closeSession?: boolean; | ||
| } | ||
| export declare abstract class Link extends Entity { | ||
@@ -101,5 +113,6 @@ linkOptions?: LinkOptions; | ||
| /** | ||
| * Closes the underlying amqp link and session in rhea if open. Also removes all the event | ||
| * handlers added in the rhea-promise library on the link and it's session | ||
| * @return {Promise<void>} Promise<void> | ||
| * Closes the underlying amqp link and optionally the session as well in rhea if open. | ||
| * Also removes all the event handlers added in the rhea-promise library on the link | ||
| * and optionally it's session. | ||
| * @returns Promise<void> | ||
| * - **Resolves** the promise when rhea emits the "sender_close" | "receiver_close" event. | ||
@@ -109,3 +122,3 @@ * - **Rejects** the promise with an AmqpError when rhea emits the | ||
| */ | ||
| close(): Promise<void>; | ||
| close(options?: LinkCloseOptions): Promise<void>; | ||
| /** | ||
@@ -112,0 +125,0 @@ * Adds event listeners for the possible events that can occur on the link object and |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../lib/link.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe,EAElE,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,oBAAY,QAAQ;IAClB,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB;AAED,8BAAsB,IAAK,SAAQ,MAAM;IACvC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC;IACtB,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC;gBAChB,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE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AAU,IAAI,OAAO;IAIrB;;;;;;;;OAQG;IACH,QAAQ,IAAI,OAAO;IAInB;;;;;;;OAOG;IACH,cAAc,IAAI,OAAO;IAIzB;;;;;;;;;OASG;IACH,eAAe,IAAI,OAAO;IAI1B;;;;;;;OAOG;IACH,qBAAqB,IAAI,OAAO;IAIhC;;;;OAIG;IACH,MAAM,IAAI,IAAI;IAYd;;;;;;;;OAQG;IACG,KAAK,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IA8EtD;;;;;OAKG;IACH,OAAO,CAAC,yBAAyB;CAyBlC"} |
+38
-26
@@ -8,6 +8,32 @@ /// <reference types="node" /> | ||
| /** | ||
| * Descibes the options that can be provided while creating an AMQP Basesender. | ||
| * @interface BaseSenderOptions | ||
| */ | ||
| export interface BaseSenderOptions extends RheaSenderOptions { | ||
| /** | ||
| * @property {OnAmqpEvent} [onError] The handler that can be provided for receiving any | ||
| * errors that occur on the "sender_error" event. | ||
| */ | ||
| onError?: OnAmqpEvent; | ||
| /** | ||
| * @property {OnAmqpEvent} [onClose] The handler that can be provided for receiving the | ||
| * "sender_close" event. | ||
| */ | ||
| onClose?: OnAmqpEvent; | ||
| /** | ||
| * @property {OnAmqpEvent} [onSessionError] The handler that can be provided for receiving | ||
| * the "session_error" event that occurs on the underlying session. | ||
| */ | ||
| onSessionError?: OnAmqpEvent; | ||
| /** | ||
| * @property {OnAmqpEvent} [onSessionClose] The handler that can be provided for receiving the | ||
| * "session_close" event that occurs on the underlying session. | ||
| */ | ||
| onSessionClose?: OnAmqpEvent; | ||
| } | ||
| /** | ||
| * Descibes the options that can be provided while creating an AMQP sender. | ||
| * @interface SenderOptions | ||
| */ | ||
| export interface SenderOptions extends RheaSenderOptions { | ||
| export interface SenderOptions extends BaseSenderOptions { | ||
| /** | ||
@@ -33,22 +59,2 @@ * @property {OnAmqpEvent} [onAccepted] The handler that can be provided for receiving the | ||
| onModified?: OnAmqpEvent; | ||
| /** | ||
| * @property {OnAmqpEvent} [onError] The handler that can be provided for receiving any | ||
| * errors that occur on the "sender_error" event. | ||
| */ | ||
| onError?: OnAmqpEvent; | ||
| /** | ||
| * @property {OnAmqpEvent} [onClose] The handler that can be provided for receiving the | ||
| * "sender_close" event. | ||
| */ | ||
| onClose?: OnAmqpEvent; | ||
| /** | ||
| * @property {OnAmqpEvent} [onSessionError] The handler that can be provided for receiving | ||
| * the "session_error" event that occurs on the underlying session. | ||
| */ | ||
| onSessionError?: OnAmqpEvent; | ||
| /** | ||
| * @property {OnAmqpEvent} [onSessionClose] The handler that can be provided for receiving the | ||
| * "session_close" event that occurs on the underlying session. | ||
| */ | ||
| onSessionClose?: OnAmqpEvent; | ||
| } | ||
@@ -63,8 +69,7 @@ /** | ||
| /** | ||
| * Describes the sender that wraps the rhea sender. | ||
| * @class Sender | ||
| * Describes the base sender that wraps the rhea sender. | ||
| * @class BaseSender | ||
| */ | ||
| export declare class Sender extends Link { | ||
| senderOptions?: SenderOptions; | ||
| constructor(session: Session, sender: RheaSender, options?: SenderOptions); | ||
| export declare class BaseSender extends Link { | ||
| constructor(session: Session, sender: RheaSender, options?: BaseSenderOptions); | ||
| setDrained(drained: boolean): void; | ||
@@ -76,2 +81,9 @@ /** | ||
| sendable(): boolean; | ||
| } | ||
| /** | ||
| * Describes the AMQP Sender. | ||
| * @class Sender | ||
| */ | ||
| export declare class Sender extends BaseSender { | ||
| constructor(session: Session, sender: RheaSender, options?: SenderOptions); | ||
| /** | ||
@@ -78,0 +90,0 @@ * Sends the message |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"sender.d.ts","sourceRoot":"","sources":["../../lib/sender.ts"],"names":[],"mappings":";AAGA,OAAO,EACL,aAAa,IAAI,iBAAiB,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,IAAI,UAAU,EAC5E,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,M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E,UAAU,EAAE,OAAO,CAAC,EAAE,aAAa;IAIzE;;;;;;;;;;OAUG;IACH,IAAI,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ;CAG9E"} |
@@ -7,2 +7,3 @@ import { Connection } from "./connection"; | ||
| import { Entity } from "./entity"; | ||
| import { AwaitableSender, AwaitableSenderOptions } from "./awaitableSender"; | ||
| /** | ||
@@ -31,2 +32,8 @@ * Describes the event listeners that can be added to the Session. | ||
| /** | ||
| * Returns the unique identifier for the session in the format: | ||
| * "local_<number>-remote_<number>-<connection-id>" or an empty string if the local channel or | ||
| * remote channel are not yet defined. | ||
| */ | ||
| readonly id: string; | ||
| /** | ||
| * Determines whether the session and the underlying connection is open. | ||
@@ -67,5 +74,5 @@ * @returns {boolean} result `true` - is open; `false` otherwise. | ||
| * Creates an amqp receiver on this session. | ||
| * @param {Session} session The amqp session object on which the receiver link needs to be established. | ||
| * @param {ReceiverOptions} [options] Options that can be provided while creating an amqp receiver. | ||
| * @return {Promise<Receiver>} Promise<Receiver> | ||
| * @param session The amqp session object on which the receiver link needs to be established. | ||
| * @param options Options that can be provided while creating an amqp receiver. | ||
| * @return Promise<Receiver> | ||
| * - **Resolves** the promise with the Receiver object when rhea emits the "receiver_open" event. | ||
@@ -78,4 +85,4 @@ * - **Rejects** the promise with an AmqpError when rhea emits the "receiver_close" event while trying | ||
| * Creates an amqp sender on this session. | ||
| * @param {SenderOptions} [options] Options that can be provided while creating an amqp sender. | ||
| * @return {Promise<Sender>} Promise<Sender> | ||
| * @param options Options that can be provided while creating an amqp sender. | ||
| * @return Promise<Sender> | ||
| * - **Resolves** the promise with the Sender object when rhea emits the "sender_open" event. | ||
@@ -87,2 +94,25 @@ * - **Rejects** the promise with an AmqpError when rhea emits the "sender_close" event while trying | ||
| /** | ||
| * Creates an awaitable amqp sender on this session. | ||
| * @param options Options that can be provided while creating an async amqp sender. | ||
| * - If `onError` and `onSessionError` handlers are not provided then the `AwaitableSender` will | ||
| * clear the timer and reject the Promise for all the entries of inflight send operation in its | ||
| * `deliveryDispositionMap`. | ||
| * - If the user is handling the reconnection of sender link or the underlying connection in it's | ||
| * app, then the `onError` and `onSessionError` handlers must be provided by the user and (s)he | ||
| * shall be responsible of clearing the `deliveryDispotionMap` of inflight `send()` operation. | ||
| * | ||
| * @return Promise<AwaitableSender> | ||
| * - **Resolves** the promise with the Sender object when rhea emits the "sender_open" event. | ||
| * - **Rejects** the promise with an AmqpError when rhea emits the "sender_close" event while trying | ||
| * to create an amqp sender or the operation timeout occurs. | ||
| */ | ||
| createAwaitableSender(options?: AwaitableSenderOptions): Promise<AwaitableSender>; | ||
| /** | ||
| * Creates the Sender based on the provided type. | ||
| * @internal | ||
| * @param type The type of sender | ||
| * @param options Options to be provided while creating the sender. | ||
| */ | ||
| private _createSender; | ||
| /** | ||
| * Adds event listeners for the possible events that can occur on the session object and | ||
@@ -89,0 +119,0 @@ * re-emits the same event back with the received arguments from rhea's event emitter. |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../lib/session.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EACyB,aAAa,EAAE,SAAS,EAAE,OAAO,IAAI,WAAW,EAE/E,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC;;;GAGG;AACH,MAAM,CAAC,OAAO,WAAW,OAAO;IAC9B,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,G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C,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AAErC;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAW7C;AAED;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;GAGG;AACH,oBAAY,YAAY,CAAC,CAAC,IAAI;KAC3B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAEzD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,gBAAgB,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,4BAA4B,GAAG,YAAY,CAAC,CAAC,CAAC,CAY1H;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,gBAAgB,CAAC;IAC9B,OAAO,EAAE,IAAI,GAAG,OAAO,GAAG,UAAU,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,YAAY,CAAC;CAC/D;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAoBtD"} |
| "use strict"; | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the Apache License. See License in the project root for license information. | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| /** | ||
| * Defines the error that occurs when an operation timeout occurs. | ||
| */ | ||
| class OperationTimeoutError extends Error { | ||
| constructor(message) { | ||
| super(message); | ||
| /** | ||
| * Describes the name of the error. | ||
| */ | ||
| this.name = "OperationTimeoutError"; | ||
| } | ||
| } | ||
| exports.OperationTimeoutError = OperationTimeoutError; | ||
| //# sourceMappingURL=operationTimeoutError.js.map |
| {"version":3,"file":"operationTimeoutError.js","sourceRoot":"","sources":["../../lib/operationTimeoutError.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,8FAA8F;;AAE9F;;GAEG;AACH,MAAa,qBAAsB,SAAQ,KAAK;IAM9C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QANjB;;WAEG;QACM,SAAI,GAAW,uBAAuB,CAAC;IAIhD,CAAC;CACF;AATD,sDASC"} |
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the Apache License. See License in the project root for license information. | ||
| /** | ||
| * Defines the error that occurs when an operation timeout occurs. | ||
| */ | ||
| export class OperationTimeoutError extends Error { | ||
| /** | ||
| * Describes the name of the error. | ||
| */ | ||
| readonly name: string = "OperationTimeoutError"; | ||
| constructor(message: string) { | ||
| super(message); | ||
| } | ||
| } |
| /** | ||
| * Defines the error that occurs when an operation timeout occurs. | ||
| */ | ||
| export declare class OperationTimeoutError extends Error { | ||
| /** | ||
| * Describes the name of the error. | ||
| */ | ||
| readonly name: string; | ||
| constructor(message: string); | ||
| } | ||
| //# sourceMappingURL=operationTimeoutError.d.ts.map |
| {"version":3,"file":"operationTimeoutError.d.ts","sourceRoot":"","sources":["../../lib/operationTimeoutError.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAA2B;gBAEpC,OAAO,EAAE,MAAM;CAG5B"} |
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
340532
27.79%79
8.22%5581
22.44%0
-100%299
32.89%13
-7.14%Updated
Updated