@autofleet/rabbit 3.2.22-beta.1 → 3.2.22-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -37,7 +37,7 @@ type newChannelOpts = {
37
37
  name?: string;
38
38
  onClose?: null | ((args: any | null) => void);
39
39
  options?: CreateChannelOpts | undefined;
40
- connectionPurpose: ConnectionPurpose;
40
+ connectionPurpose?: ConnectionPurpose;
41
41
  };
42
42
  type assertChannelOpts = {
43
43
  channelName?: string;
package/dist/index.js CHANGED
@@ -182,10 +182,6 @@ class RabbitMq {
182
182
  const newConnection = await (0, amqp_connection_manager_1.connect)(defaultUrls, {
183
183
  findServers,
184
184
  });
185
- if (!newConnection) {
186
- logger_1.default.error('rabbit: couldnt create a connection');
187
- return resolve(connection);
188
- }
189
185
  this.connectionsMap[connectionPurpose].connection = newConnection;
190
186
  newConnection.on('error', (err) => {
191
187
  logger_1.default.error('rabbit: connection error', { err });
@@ -463,7 +459,7 @@ class RabbitMq {
463
459
  RabbitMq.validateName('queue', queue);
464
460
  const { limit, deadMessageTtl } = optionsWithDefaults;
465
461
  await this.saveConsumer(queue, callback, options);
466
- const channel = await this.getNewChannel({ name: `consume - exchange - ${exchange} -queue - ${queue}`, connectionPurpose: types_1.ConnectionPurpose.Consume });
462
+ const channel = await this.getNewChannel({ name: `consume - exchange - ${exchange} -queue - ${queue}` });
467
463
  return channel.addSetup(async (c) => {
468
464
  const assertExchange = await (0, utils_1.assertExchangeFanout)(c, exchange);
469
465
  await c.assertQueue(queue);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/rabbit",
3
- "version": "3.2.22-beta.1",
3
+ "version": "3.2.22-beta.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -83,7 +83,7 @@ type newChannelOpts = {
83
83
  name?: string;
84
84
  onClose?: null | ((args: any | null) => void);
85
85
  options?: CreateChannelOpts | undefined;
86
- connectionPurpose: ConnectionPurpose,
86
+ connectionPurpose?: ConnectionPurpose,
87
87
  };
88
88
 
89
89
  type assertChannelOpts = {
@@ -321,11 +321,6 @@ class RabbitMq implements IAfRabbitMq {
321
321
  findServers,
322
322
  });
323
323
 
324
- if (!newConnection) {
325
- logger.error('rabbit: couldnt create a connection');
326
- return resolve(connection);
327
- }
328
-
329
324
  this.connectionsMap[connectionPurpose].connection = newConnection;
330
325
 
331
326
  newConnection.on('error', (err) => {
@@ -638,7 +633,7 @@ class RabbitMq implements IAfRabbitMq {
638
633
  RabbitMq.validateName('queue', queue);
639
634
  const { limit, deadMessageTtl } = optionsWithDefaults;
640
635
  await this.saveConsumer(queue, callback, options);
641
- const channel: ChannelWrapper = await this.getNewChannel({ name: `consume - exchange - ${exchange} -queue - ${queue}`, connectionPurpose: ConnectionPurpose.Consume });
636
+ const channel: ChannelWrapper = await this.getNewChannel({ name: `consume - exchange - ${exchange} -queue - ${queue}` });
642
637
 
643
638
  return channel.addSetup(async (c: ConfirmChannel) => {
644
639
  const assertExchange = await assertExchangeFanout(c, exchange);