Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
source: {
address: this.address
},
credit_window: 0,
onMessage: options.onMessage || ((context: EventContext) => this._onAmqpMessage(context)),
onError: options.onError || ((context: EventContext) => this._onAmqpError(context)),
onClose: options.onClose || ((context: EventContext) => this._onAmqpClose(context)),
onSessionError:
options.onSessionError || ((context: EventContext) => this._onAmqpSessionError(context)),
onSessionClose:
options.onSessionClose || ((context: EventContext) => this._onAmqpSessionClose(context))
};
if (typeof this.ownerLevel === "number") {
rcvrOptions.properties = {
[Constants.attachEpoch]: types.wrap_long(this.ownerLevel)
};
}
if (this.options.trackLastEnqueuedEventProperties) {
rcvrOptions.desired_capabilities = Constants.enableReceiverRuntimeMetricName;
}
const eventPosition = options.eventPosition || this.eventPosition;
if (eventPosition) {
// Set filter on the receiver if event position is specified.
const filterClause = getEventPositionFilter(eventPosition);
if (filterClause) {
(rcvrOptions.source as any).filter = {
"apache.org:selector-filter:string": types.wrap_described(filterClause, 0x468c00000004)
};
}