Skip to content

Commit

Permalink
fix(): temporarily revert #5790 (breaking changes)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Dec 9, 2020
1 parent 710b385 commit bb6b643
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ import {
} from '../external/kafka.interface';
import { MqttClientOptions } from '../external/mqtt-options.interface';
import { ClientOpts } from '../external/redis.interface';
import {
AmqpConnectionManagerSocketOptions,
AmqplibQueueOptions,
RmqUrl,
} from '../external/rmq-url.interface';
import { RmqUrl } from '../external/rmq-url.interface';
import { Server } from '../server/server';
import { CustomTransportStrategy } from './custom-transport-strategy.interface';
import { Deserializer } from './deserializer.interface';
Expand Down Expand Up @@ -133,8 +129,8 @@ export interface RmqOptions {
queue?: string;
prefetchCount?: number;
isGlobalPrefetchCount?: boolean;
queueOptions?: AmqplibQueueOptions;
socketOptions?: AmqpConnectionManagerSocketOptions;
queueOptions?: any; // AmqplibQueueOptions;
socketOptions?: any; // AmqpConnectionManagerSocketOptions;
noAck?: boolean;
serializer?: Serializer;
deserializer?: Deserializer;
Expand Down
11 changes: 3 additions & 8 deletions packages/microservices/server/server-rmq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from '../constants';
import { RmqContext } from '../ctx-host';
import { Transport } from '../enums';
import { AmqplibQueueOptions, RmqUrl } from '../external/rmq-url.interface';
import { RmqUrl } from '../external/rmq-url.interface';
import { CustomTransportStrategy, RmqOptions } from '../interfaces';
import {
IncomingRequest,
Expand All @@ -36,7 +36,7 @@ export class ServerRMQ extends Server implements CustomTransportStrategy {
protected readonly urls: string[] | RmqUrl[];
protected readonly queue: string;
protected readonly prefetchCount: number;
protected readonly queueOptions: AmqplibQueueOptions;
protected readonly queueOptions: any;
protected readonly isGlobalPrefetchCount: boolean;

constructor(protected readonly options: RmqOptions['options']) {
Expand Down Expand Up @@ -93,12 +93,7 @@ export class ServerRMQ extends Server implements CustomTransportStrategy {

public createClient<T = any>(): T {
const socketOptions = this.getOptionsProp(this.options, 'socketOptions');
const options: RmqOptions['options']['socketOptions'] = Object.assign(
{},
socketOptions,
);
options.connectionOptions = socketOptions;
return rqmPackage.connect(this.urls, options);
return rqmPackage.connect(this.urls, { connectionOptions: socketOptions });
}

public async setupChannel(channel: any, callback: Function) {
Expand Down

0 comments on commit bb6b643

Please sign in to comment.