Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After updating the library, the application on NestJs stopped starting #882

Open
AntonBozhenko opened this issue Nov 14, 2024 · 6 comments

Comments

@AntonBozhenko
Copy link

AntonBozhenko commented Nov 14, 2024

Previously, in some of our projects, both in the dev environment and locally, we did not connect to real data but used random strings (in RMQ_USERNAME, RMQ_PASSWORD, RMQ_HOST). The application would start and display errors in the console. However, after the latest update (5.6.1), the application fails to start entirely. The configuration settings are provided below.

export const RmqConfig: RabbitMQConfig = {
  uri: `amqp://${process.env.RMQ_USERNAME}:${process.env.RMQ_PASSWORD}@${process.env.RMQ_HOST}`,
  connectionInitOptions: { wait: false },
  exchanges,
  queues,
  channels: {
    'main-channel': {
      prefetchCount: 1,
      default: true,
    },
  },
  enableControllerDiscovery: true,
};
@Module({
  imports: [RabbitMQModule.forRoot(RabbitMQModule, RmqConfig)],
  exports: [RabbitMQModule],
})
export class RmqModule {}
@underfisk
Copy link
Contributor

@AntonBozhenko Are you able to include the error messages that you see, the reproduction above looks correct but I don't know what errors were talking about here

@AntonBozhenko
Copy link
Author

AntonBozhenko commented Nov 15, 2024

@underfisk
The screen shows the start of the application on library version 5.3.0
Снимок экрана 2024-11-15 в 10 03 09

With library version 5.6.1 the error is the same, but the application does not start.
The error occurs because my local RabbitMq server is not running.
It looks like connectionInitOptions: { wait: false } is not working.

@underfisk
Copy link
Contributor

@AntonBozhenko Are you able to identify if in the previous version 5.6.0 this still happens? I'd like to understand when this started happening

@AntonBozhenko
Copy link
Author

@underfisk on version 5.4.0 everything is fine, but on all newer versions the application does not start

@miccies
Copy link

miccies commented Nov 18, 2024

I belive that there is an issue in

/^amqps?:\/\/(([^:]+):([^@]+)@)?([^:/]+)(:[0-9]+)?(\/.*)?$/;

The / is not escaped, I belive it should be changed to

/^amqps?:\/\/(([^:]+):([^@]+)@)?([^:\/]+)(:[0-9]+)?(\/.*)?$/;

@underfisk
Copy link
Contributor

I belive that there is an issue in

/^amqps?:\/\/(([^:]+):([^@]+)@)?([^:/]+)(:[0-9]+)?(\/.*)?$/;

The / is not escaped, I belive it should be changed to

/^amqps?:\/\/(([^:]+):([^@]+)@)?([^:\/]+)(:[0-9]+)?(\/.*)?$/;

@PavelPashov Are you able to assist?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants