cody-greene / node-rabbitmq-client

RabbitMQ (0-9-1) client library with auto-reconnect & zero dependencies
MIT License
130 stars 9 forks source link

Connection gets closed when using Bun instead of node #47

Closed Wafje closed 7 months ago

Wafje commented 7 months ago

Version: 4.5.2 RabbitMQ version: 3.13.0

RabbitMQ error:

2024-04-03 14:26:42.514858+00:00 [info] <0.785.0> accepting AMQP connection <0.785.0> (172.30.0.1:57434 -> 172.30.0.3:5672)
2024-04-03 14:26:45.524204+00:00 [error] <0.785.0> closing AMQP connection <0.785.0> (172.30.0.1:57434 -> 172.30.0.3:5672):
2024-04-03 14:26:45.524204+00:00 [error] <0.785.0> {handshake_error,starting,28255,
2024-04-03 14:26:45.524204+00:00 [error] <0.785.0>                  {amqp_error,frame_error,
2024-04-03 14:26:45.524204+00:00 [error] <0.785.0>                              "type 206, all octets = <<>>: {frame_too_large,1431529844,4088}",
2024-04-03 14:26:45.524204+00:00 [error] <0.785.0>                              none}}

Client side error: {"code":"CONN_CLOSE","name":"AMQPConnectionError"}

cody-greene commented 7 months ago

Sounds like Buffers behave a little differently with bun so data frames are not encoding properly. I've never used bun but it claims to be a drop-in replacement for node. Apparently not. I'll find some time to take a look.

cody-greene commented 7 months ago

Fixed with v4.5.3 13a2ce67e421a696c050e9644ffd7468fd2b25cd

Consider Bun support experimental for now (use at your own risk). The test suite mostly runs fine when I switch the "node:test" import to "bun:test". Node's built-in test module is different from Bun's however, so I'd need to do some more work to get the github action thingy running both.