fixes based on Pierre's code review comments.
This commit is contained in:
Родитель
1aedbace49
Коммит
78b60d9da8
|
@ -68,7 +68,7 @@ class EventHubReceiver extends events_1.EventEmitter {
|
|||
this.options = options;
|
||||
this.receiverRuntimeMetricEnabled = options.enableReceiverRuntimeMetric || false;
|
||||
this.runtimeInfo = {
|
||||
paritionId: `${partitionId}`
|
||||
partitionId: `${partitionId}`
|
||||
};
|
||||
const onMessage = (context) => {
|
||||
const evData = _1.EventData.fromAmqpMessage(context.message);
|
||||
|
@ -120,7 +120,7 @@ class EventHubReceiver extends events_1.EventEmitter {
|
|||
yield utils_1.defaultLock.acquire(this._context.cbsSession.cbsLock, () => { return this._context.cbsSession.init(this._context.connection); });
|
||||
const tokenObject = yield this._context.tokenProvider.getToken(this.audience);
|
||||
debug(`[${this._context.connectionId}] EH Receiver: calling negotiateClaim for audience "${this.audience}"`);
|
||||
// Negotitate the CBS claim.
|
||||
// Negotiate the CBS claim.
|
||||
yield this._context.cbsSession.negotiateClaim(this.audience, this._context.connection, tokenObject);
|
||||
if (!this._session && !this._receiver) {
|
||||
let receiverError;
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -80,7 +80,7 @@ class EventHubSender extends events_1.EventEmitter {
|
|||
yield utils_1.defaultLock.acquire(this._context.cbsSession.cbsLock, () => { return this._context.cbsSession.init(this._context.connection); });
|
||||
const tokenObject = yield this._context.tokenProvider.getToken(this.audience);
|
||||
debug(`[${this._context.connectionId}] EH Sender: calling negotiateClaim for audience "${this.audience}".`);
|
||||
// Negotitate the CBS claim.
|
||||
// Negotiate the CBS claim.
|
||||
yield this._context.cbsSession.negotiateClaim(this.audience, this._context.connection, tokenObject);
|
||||
if (!this._session && !this._sender) {
|
||||
let senderError;
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -6,7 +6,7 @@ const rhea = require("rhea");
|
|||
const debugModule = require("debug");
|
||||
const debug = debugModule("rhea-promise");
|
||||
/**
|
||||
* Eastablishes an amqp connection.
|
||||
* Establishes an amqp connection.
|
||||
* @param {ConnectionOptions} [options] Options to be provided for establishing an amqp connection.
|
||||
* @return {Promise<Connection>} Promise<Connection>
|
||||
* - **Resolves** the promise with the Connection object when rhea emits the "connection_open" event.
|
||||
|
|
|
@ -22,7 +22,7 @@ export interface ReceiverRuntimeInfo {
|
|||
/**
|
||||
* @property {string} partitionId The parition identifier.
|
||||
*/
|
||||
paritionId: string;
|
||||
partitionId: string;
|
||||
/**
|
||||
* @property {number} lastSequenceNumber The logical sequence number of the event.
|
||||
*/
|
||||
|
@ -155,7 +155,7 @@ export class EventHubReceiver extends EventEmitter {
|
|||
this.options = options;
|
||||
this.receiverRuntimeMetricEnabled = options.enableReceiverRuntimeMetric || false;
|
||||
this.runtimeInfo = {
|
||||
paritionId: `${partitionId}`
|
||||
partitionId: `${partitionId}`
|
||||
};
|
||||
|
||||
const onMessage = (context: rheaPromise.Context) => {
|
||||
|
@ -212,7 +212,7 @@ export class EventHubReceiver extends EventEmitter {
|
|||
await defaultLock.acquire(this._context.cbsSession.cbsLock, () => { return this._context.cbsSession.init(this._context.connection); });
|
||||
const tokenObject = await this._context.tokenProvider.getToken(this.audience);
|
||||
debug(`[${this._context.connectionId}] EH Receiver: calling negotiateClaim for audience "${this.audience}"`);
|
||||
// Negotitate the CBS claim.
|
||||
// Negotiate the CBS claim.
|
||||
await this._context.cbsSession.negotiateClaim(this.audience, this._context.connection, tokenObject);
|
||||
if (!this._session && !this._receiver) {
|
||||
let receiverError: any;
|
||||
|
|
|
@ -120,7 +120,7 @@ export class EventHubSender extends EventEmitter {
|
|||
() => { return this._context.cbsSession.init(this._context.connection); });
|
||||
const tokenObject = await this._context.tokenProvider.getToken(this.audience);
|
||||
debug(`[${this._context.connectionId}] EH Sender: calling negotiateClaim for audience "${this.audience}".`);
|
||||
// Negotitate the CBS claim.
|
||||
// Negotiate the CBS claim.
|
||||
await this._context.cbsSession.negotiateClaim(this.audience, this._context.connection, tokenObject);
|
||||
if (!this._session && !this._sender) {
|
||||
let senderError: any;
|
||||
|
|
|
@ -7,7 +7,7 @@ import * as debugModule from "debug";
|
|||
const debug = debugModule("rhea-promise");
|
||||
|
||||
/**
|
||||
* Eastablishes an amqp connection.
|
||||
* Establishes an amqp connection.
|
||||
* @param {ConnectionOptions} [options] Options to be provided for establishing an amqp connection.
|
||||
* @return {Promise<Connection>} Promise<Connection>
|
||||
* - **Resolves** the promise with the Connection object when rhea emits the "connection_open" event.
|
||||
|
|
|
@ -251,7 +251,7 @@ describe("EventHub Receiver", function () {
|
|||
receiver.runtimeInfo!.lastEnqueuedOffset!.should.equal(pInfo.lastEnqueuedOffset);
|
||||
receiver.runtimeInfo!.lastSequenceNumber!.should.equal(pInfo.lastSequenceNumber);
|
||||
receiver.runtimeInfo!.lastEnqueuedTimeUtc!.getTime().should.equal(pInfo.lastEnqueuedTimeUtc.getTime());
|
||||
receiver.runtimeInfo!.paritionId!.should.equal(pInfo.partitionId);
|
||||
receiver.runtimeInfo!.partitionId!.should.equal(pInfo.partitionId);
|
||||
receiver.runtimeInfo!.retrievalTime!.getTime().should.be.greaterThan(Date.now() - 60000);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -10,7 +10,7 @@ export interface ReceiverRuntimeInfo {
|
|||
/**
|
||||
* @property {string} partitionId The parition identifier.
|
||||
*/
|
||||
paritionId: string;
|
||||
partitionId: string;
|
||||
/**
|
||||
* @property {number} lastSequenceNumber The logical sequence number of the event.
|
||||
*/
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference types="node" />
|
||||
/**
|
||||
* Eastablishes an amqp connection.
|
||||
* Establishes an amqp connection.
|
||||
* @param {ConnectionOptions} [options] Options to be provided for establishing an amqp connection.
|
||||
* @return {Promise<Connection>} Promise<Connection>
|
||||
* - **Resolves** the promise with the Connection object when rhea emits the "connection_open" event.
|
||||
|
|
Загрузка…
Ссылка в новой задаче