You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/service-bus-messaging/service-bus-nodejs-how-to-use-queues-new-package.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ npm install @azure/service-bus
40
40
```
41
41
42
42
## Send messages to a queue
43
-
Interacting with a Service Bus queue starts with instantiating the [ServiceBusClient](https://docs.microsoft.com/en-us/javascript/api/@azure/service-bus/servicebusclient) class and using it to instantiate the [QueueClient](https://docs.microsoft.com/en-us/javascript/api/%40azure/service-bus/queueclient) class. Once you have the queue client, you can create a sender and use either [send](https://docs.microsoft.com/en-us/javascript/api/%40azure/service-bus/sender#send-sendablemessageinfo-) or [sendBatch](https://docs.microsoft.com/en-us/javascript/api/@azure/service-bus/sender#sendbatch-sendablemessageinfo---) method on it to send messages.
43
+
Interacting with a Service Bus queue starts with instantiating the [ServiceBusClient](https://docs.microsoft.com/javascript/api/@azure/service-bus/servicebusclient) class and using it to instantiate the [QueueClient](https://docs.microsoft.com/javascript/api/%40azure/service-bus/queueclient) class. Once you have the queue client, you can create a sender and use either [send](https://docs.microsoft.com/javascript/api/%40azure/service-bus/sender#send-sendablemessageinfo-) or [sendBatch](https://docs.microsoft.com/javascript/api/@azure/service-bus/sender#sendbatch-sendablemessageinfo---) method on it to send messages.
44
44
45
45
1. Open your favorite editor, such as [Visual Studio Code](https://code.visualstudio.com/)
46
46
2. Create a file called `send.js` and paste the below code into it. This code will send 10 messages to your queue.
@@ -90,7 +90,7 @@ Messages have some standard properties like `label` and `messageId` that you can
90
90
Service Bus queues support a maximum message size of256KBin the [Standard tier](service-bus-premium-messaging.md) and 1MBin the [Premium tier](service-bus-premium-messaging.md). There's no limit on the number of messages held in a queue but there's a cap on the total size of the messages held by a queue. This queue size is defined at creation time, with an upper limit of5GB. For more information about quotas, see [Service Bus quotas](service-bus-quotas.md).
91
91
92
92
## Receive messages from a queue
93
-
Interacting with a Service Bus queue starts with instantiating the [ServiceBusClient](https://docs.microsoft.com/en-us/javascript/api/@azure/service-bus/servicebusclient) class and using it to instantiate the [QueueClient](https://docs.microsoft.com/en-us/javascript/api/%40azure/service-bus/queueclient) class. Once you have the queue client, you can create a receiver and use either [receiveMessages](https://docs.microsoft.com/en-us/javascript/api/%40azure/service-bus/receiver#receivemessages-number--undefined---number-) or [registerMessageHandler](https://docs.microsoft.com/en-us/javascript/api/%40azure/service-bus/receiver#registermessagehandler-onmessage--onerror--messagehandleroptions-) method on it to receive messages.
93
+
Interacting with a Service Bus queue starts with instantiating the [ServiceBusClient](https://docs.microsoft.com/javascript/api/@azure/service-bus/servicebusclient) class and using it to instantiate the [QueueClient](https://docs.microsoft.com/javascript/api/%40azure/service-bus/queueclient) class. Once you have the queue client, you can create a receiver and use either [receiveMessages](https://docs.microsoft.com/javascript/api/%40azure/service-bus/receiver#receivemessages-number--undefined---number-) or [registerMessageHandler](https://docs.microsoft.com/javascript/api/%40azure/service-bus/receiver#registermessagehandler-onmessage--onerror--messagehandleroptions-) method on it to receive messages.
94
94
95
95
1. Open your favorite editor, such as [Visual Studio Code](https://code.visualstudio.com/)
96
96
2. Create a file called `recieve.js` and paste the below code into it. This code will attempt to receive 10 messages from your queue. The actual count you receive depends on the number of messages in the queue and network latency.
@@ -126,7 +126,7 @@ Interacting with a Service Bus queue starts with instantiating the [ServiceBusCl
126
126
127
127
Congratulations! You just received messages from a Service Bus queue.
128
128
129
-
The [createReceiver](https://docs.microsoft.com/en-us/javascript/api/%40azure/service-bus/queueclient#createreceiver-receivemode-) method takes in a `ReceiveMode` which is an enum with values [ReceiveAndDelete](message-transfers-locks-settlement.md#settling-receive-operations) and [PeekLock](message-transfers-locks-settlement.md#settling-receive-operations). Remember to [settle your messages](message-transfers-locks-settlement.md#settling-receive-operations) if you use the `PeekLock` mode by using any of `complete()`, `abandon()`, `defer()`, or `deadletter()` methods on the message.
129
+
The [createReceiver](https://docs.microsoft.com/javascript/api/%40azure/service-bus/queueclient#createreceiver-receivemode-) method takes in a `ReceiveMode` which is an enum with values [ReceiveAndDelete](message-transfers-locks-settlement.md#settling-receive-operations) and [PeekLock](message-transfers-locks-settlement.md#settling-receive-operations). Remember to [settle your messages](message-transfers-locks-settlement.md#settling-receive-operations) if you use the `PeekLock` mode by using any of `complete()`, `abandon()`, `defer()`, or `deadletter()` methods on the message.
0 commit comments