How to use the haredo.Haredo function in haredo

To help you get started, we’ve selected a few haredo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bamlab / nest-rabbit-tasks / src / nest-rabbit-tasks.rabbitClient.ts View on Github external
public static async buildQueueConnection(option: NestRabbitTasksQueueOptions, logger: Logger): Promise {
    console.log(option.amqpOptions);
    const connection = new Haredo({ connection: option.amqpOptions.connectionUrl });

    if (option.globalOptions.immutableInfrastructure) {
      const channel = await connection.connectionManager.getChannel();
      try {
        await channel.checkQueue(option.entity.queueName);
      } catch (err) {
        if (err.code === 404) {
          const msg = `You have activated "globalOptions.immutableInfrastructure".
          This prevents nest-rabbit-tasks to create non-existent queue.
          The queue ${option.entity.queueName} does not exist.
          Please create it in RabbitMQ interface.`;
          logger.error(msg);
          return null;
        }
        throw err;
      }

haredo

A type-safe client library for rabbitmq/amqp

MIT
Latest version published 12 months ago

Package Health Score

63 / 100
Full package analysis

Popular haredo functions