import { ServiceBusClient } from '@azure/service-bus';
// Replace `<Connection String>` with your connectionstring
const connectionString ='<Connection String>';
const sbClient = new ServiceBusClient(connectionString);
// createSender() can also be used to create a sender for a topic.
const sender = sbClient.createSender('test');
try {
await sender.sendMessages({ body: 'Hello, world!' });
console.log(`Message sent`);
await sender.close();
} finally {
await sbClient.close();
}
Node (works)
PS C:\Projects\test-project> node .\index.js
Message sent
Bun (doesn't work)
PS C:\Projects\test-project> bun --bun .\index.js
148 | };
149 | const actionAfterTimeout = () => {
150 | removeListeners();
151 | const msg = `Unable to open the amqp connection "${this.id}" due to operation timeout.`;
152 | log.error("[%s] %s", this.id, msg);
153 | return reject(new Error(msg));
^
error: Unable to open the amqp connection "connection-1" due to operation timeout.
at actionAfterTimeout (C:\Projects\test-project\node_modules\rhea-promise\dist\lib\connection.js:153:35)
What is the expected behavior?
The messages are sent to the Service Bus
What do you see instead?
The requests timeout after a few seconds
Additional information
Might be caused by the AMQP protocol used by Azure Service Bus
What version of Bun is running?
1.1.7
What platform is your computer?
Microsoft Windows NT 10.0.22621.0 x64
What steps can reproduce the bug?
Prerequisites
bun install @azure/service-bus
Code
Node (works)
Bun (doesn't work)
What is the expected behavior?
The messages are sent to the Service Bus
What do you see instead?
The requests timeout after a few seconds
Additional information
Might be caused by the AMQP protocol used by Azure Service Bus