File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { AMQPView } from "./amqp-view.js"
66import type { Logger } from "./types.js"
77
88export const VERSION = "3.4.1"
9+ export const MIN_FRAME_SIZE = 8192
910
1011/**
1112 * Base class for AMQPClients.
@@ -50,7 +51,7 @@ export abstract class AMQPBaseClient {
5051 password : string ,
5152 name ?: string ,
5253 platform ?: string ,
53- frameMax = 8192 ,
54+ frameMax = MIN_FRAME_SIZE ,
5455 heartbeat = 0 ,
5556 channelMax = 0 ,
5657 logger ?: Logger | null ,
@@ -69,7 +70,7 @@ export abstract class AMQPBaseClient {
6970 this . onerror = ( error : AMQPError ) => {
7071 this . logger ?. error ( "amqp-client connection closed" , error . message )
7172 }
72- if ( frameMax < 8192 ) throw new Error ( " frameMax must be 8192 or larger" )
73+ if ( frameMax < MIN_FRAME_SIZE ) throw new Error ( ` frameMax must be ${ MIN_FRAME_SIZE } or larger` )
7374 this . frameMax = frameMax
7475 if ( heartbeat < 0 ) throw new Error ( "heartbeat must be positive" )
7576 this . heartbeat = heartbeat
Original file line number Diff line number Diff line change 1- import { AMQPBaseClient } from "./amqp-base-client.js"
1+ import { AMQPBaseClient , MIN_FRAME_SIZE } from "./amqp-base-client.js"
22import { AMQPChannel } from "./amqp-channel.js"
33import { AMQPError } from "./amqp-error.js"
44import type { AMQPTlsOptions } from "./amqp-tls-options.js"
@@ -33,7 +33,7 @@ export class AMQPClient extends AMQPBaseClient {
3333 const username = decodeURIComponent ( u . username ) || "guest"
3434 const password = decodeURIComponent ( u . password ) || "guest"
3535 const name = u . searchParams . get ( "name" ) || ""
36- const frameMax = parseInt ( u . searchParams . get ( "frameMax" ) || "8192" )
36+ const frameMax = parseInt ( u . searchParams . get ( "frameMax" ) || MIN_FRAME_SIZE . toString ( ) )
3737 const heartbeat = parseInt ( u . searchParams . get ( "heartbeat" ) || "0" )
3838 const channelMax = parseInt ( u . searchParams . get ( "channelMax" ) || "0" )
3939 const platform = `${ process . release . name } ${ process . version } ${ process . platform } ${ process . arch } `
Original file line number Diff line number Diff line change 1- import { AMQPBaseClient , VERSION } from "./amqp-base-client.js"
1+ import { AMQPBaseClient , VERSION , MIN_FRAME_SIZE } from "./amqp-base-client.js"
22import { AMQPView } from "./amqp-view.js"
33import { AMQPError } from "./amqp-error.js"
44import { AMQPChannel } from "./amqp-channel.js"
@@ -49,7 +49,7 @@ export class AMQPWebSocketClient extends AMQPBaseClient {
4949 username = "guest" ,
5050 password = "guest" ,
5151 name ?: string ,
52- frameMax = 8192 ,
52+ frameMax = MIN_FRAME_SIZE ,
5353 heartbeat = 0 ,
5454 logger ?: Logger | null ,
5555 ) {
You can’t perform that action at this time.
0 commit comments