fix: update RabbitMQ frame_max parameter for 4.1+ compatibility

Updates the minimum frame_max value from 4096 to 8192 to meet the requirements
of RabbitMQ 4.1+ servers. This resolves connection failures with newer RabbitMQ
versions while maintaining backwards compatibility with older versions.
This commit is contained in:
Thiago Souza
2025-05-25 02:42:51 -03:00
parent 427c994993
commit 3297364c10
3 changed files with 16 additions and 1 deletions

View File

@@ -21,9 +21,21 @@ export class RabbitmqController extends EventController implements EventControll
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,
username: url.username || 'guest',
password: url.password || 'guest',
vhost: url.pathname.slice(1) || '/',
frameMax: frameMax
};
amqp.connect(connectionOptions, (error, connection) => {
if (error) {
reject(error);