-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Inclusão do parâmetro frame_max para compatibilidade com RabbitMQ 4.1+ #1498
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -21,9 +21,21 @@ | |||||
|
|
||||||
| await new Promise<void>((resolve, reject) => { | ||||||
| const uri = configService.get<Rabbitmq>('RABBITMQ').URI; | ||||||
| const frameMax = configService.get<Rabbitmq>('RABBITMQ').FRAME_MAX; | ||||||
| const rabbitmqExchangeName = configService.get<Rabbitmq>('RABBITMQ').EXCHANGE_NAME; | ||||||
|
|
||||||
| amqp.connect(uri, (error, connection) => { | ||||||
| const url = new URL(uri); | ||||||
| const connectionOptions = { | ||||||
| protocol: url.protocol.slice(0, -1), | ||||||
| hostname: url.hostname, | ||||||
| port: url.port || 5672, | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (bug_risk): Convert
Suggested change
|
||||||
| username: url.username || 'guest', | ||||||
| password: url.password || 'guest', | ||||||
| vhost: url.pathname.slice(1) || '/', | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (bug_risk): Decode percent-encoded vhost names Wrap
Suggested change
|
||||||
| frameMax: frameMax | ||||||
| }; | ||||||
|
|
||||||
| amqp.connect(connectionOptions, (error, connection) => { | ||||||
| if (error) { | ||||||
| reject(error); | ||||||
|
|
||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (bug_risk): Parsing the URI with
new URLmay throw on invalid URIsConsider adding a try/catch around
new URL(uri)or validating the URI beforehand to prevent unhandled exceptions from malformed input.