Skip to content
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

Azure Service Bus package not working with Bun #10854

Closed
henrikstorck opened this issue May 5, 2024 · 0 comments · Fixed by #10970
Closed

Azure Service Bus package not working with Bun #10854

henrikstorck opened this issue May 5, 2024 · 0 comments · Fixed by #10970
Labels
bug Something isn't working

Comments

@henrikstorck
Copy link
Contributor

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant