Skip to content

Commit

Permalink
Update index.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cressie176 authored Aug 12, 2022
1 parent c09e401 commit 14d922e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ channel.on('error', (err) => {
To recover from a channel error your code must listen for the channel error event, create a new channel and restablish any consumers. To recover from a connection error your code must listen for the connection error event, reconnect, create the necessary channels and restablish any consumers. You may also wish to handle to the connection 'close' event which will be emitted if the server shutsdown gracefully AND following a connection error.

### Why do I get a "Frame size exceeds frame max" error?
This is typically because you've connected to a server that doesn't use the amqp 0.9.1 protocol. Sometimes people are trying to connect to an amqp 1.0 broker, other times they have accidentally connected to an HTTP server by specifying the wrong port, or that they were not aware was running. A related problem can occur when receiving a message with an oversized header, in which case you can try increasing the maximum frame size via the `frameMax` connection parameter.
This is typically because you've connected to a server that doesn't use the amqp 0.9.1 protocol. Sometimes people are trying to connect to an amqp 1.0 broker, other times they have accidentally connected to an HTTP server by specifying the wrong port, or that they were not aware was running. It can also be because you've used `amqp://` rather than `amqps://` when connecting over SSL. A related problem can occur when receiving a message with an oversized header, in which case you can try increasing the maximum frame size via the `frameMax` connection parameter.

### How do I flush messages? / Why are messages not sent?
When you publish a message using channel.publish or channel.sendToQueue it is written to an internal buffer associated with the channel. Under the hood, amqplib loops through each of the channel buffers, sending the messages to the server. Messages will be written as fast as possible and the buffers do not need to be flushed, however if you close the connection or your application exits while there are still messages in the buffer, they will be lost. Be sure to explicity close the channel and wait for the returned promise to resolve, or supplied callback to be invoked before closing the connection or terminating your application.
Expand Down

0 comments on commit 14d922e

Please sign in to comment.