postwait / node-amqp

[UNMAINTAINED] node-amqp is an AMQP client for nodejs
MIT License
1.69k stars 357 forks source link

RabbitMQ occasionally sends a frame over 128KB #351

Closed fiddlerpianist closed 2 years ago

fiddlerpianist commented 10 years ago

We're using node-amqp 0.2.0 to listen on a RabbitMQ queue (v 3.3.1, Erlang R14B04). Occasionally, it appears that Rabbit will send node a frame size larger that 131072 bytes for particularly large messages (but not always). Yesterday we saw this error in our logs:

ERROR: Oversized frame 379460

We're pretty sure this is coming from these lines in parser.js:

if (frameSize > maxFrameBuffer) {
    self.throwError("Oversized frame " + frameSize);
}

The thing of it is that the Rabbit config we're using uses the default frame_max parameter of 131072. Is node-amqp not negotiating correctly with RabbitMQ when it establishes the connection?

crzidea commented 10 years ago

Modify this line to meet your need.OR hope @postwait exposing this number.

fiddlerpianist commented 10 years ago

Well, the problem with changing that is that i"m not really sure what the upper bound is that Rabbit will send us. Setting frame_max on RabbitMQ doesn't seem to help, so perhaps it needs to be part of the negotiation process of the client as well? Pika (for instance) appears to allow you to set that as a connection parameter: http://pika.readthedocs.org/en/latest/modules/parameters.html so I wonder if this is also possible from node-amqp?

crzidea commented 10 years ago

This line may also help but I haven't a try. If you tweaked maxFrameBuffer successfully, would you share your code here please? Whatever, that was not well documented.

And remember to set frame_max on RabbitMQ before tweaking.