-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection problems with a RabbitMQ client #7851
Comments
Some updates: Passing the port directly as a number changes the error: const rabbit = new Connection({
hostname: "127.0.0.1",
port: 5672,
username: "guest",
password: "guest",
}); ❯ bun index.ts
4 | /** Low severity, e.g. nack'd message */
5 | class AMQPError extends Error {
6 | code;
7 | /** @internal */
8 | constructor(code, message) {
9 | super(message);
^
AMQPConnectionError: socket closed unexpectedly by server
code: "CONN_CLOSE"
at new AMQPError (/Users/p/repos/rabbitmq-example/node_modules/rabbitmq-client/lib/exception.js:9:9)
at new AMQPChannelError (:1:33)
at new AMQPConnectionError (:1:33)
at /Users/p/repos/rabbitmq-example/node_modules/rabbitmq-client/lib/Connection.js:298:54
at node:net:12:43
at processTicksAndRejections (:61:77)
at /Users/p/repos/rabbitmq-example/index.ts:22:3
at node:events:2:49
at /Users/p/repos/rabbitmq-example/node_modules/rabbitmq-client/lib/Connection.js:309:21
at node:net:12:43
at processTicksAndRejections (:61:77) And in the rabbit logs I see this error:
Moreover, I think this may also be related to a similar issue: #5627 |
Yep. Having this issue. All day, and it turns out to be another Bun issue. Why would Bun have anything to do with the socket library? Is Bun trying to optimize it or something? |
Bun uses µWebsocket under the hood. Maybe that is causing this issue. |
I doubt it, unless nuWebsocket is used by the bun project to implement the TCP layer. RabbitMQ uses it own protocol (AMQP) over TCP. |
@DoKoB0512 you were partly right, Bun uses a fork of uSockets |
Duplicate of #4791 |
The library
node-rabbitmq-client
What version of Bun is running?
1.0.20+09d51486e
What platform is your computer?
Darwin 23.2.0 x86_64 i386
What steps can reproduce the bug?
Have a running rabbitmq service with default user/password.
In mac, it can be installed with homebrew:
To reproduce, just start a connection with the default parameters:
Package.json:
What is the expected behavior?
When running with node:
What do you see instead?
Additional information
I'm not sure when the error is happening. It could be either on the
net.Socket
implementation, or the way the library creates the buffers to pass to the socket.I only know that the connection is made using
net.Socket
. Sorry that I can't give you more details.The text was updated successfully, but these errors were encountered: