Skip to content

Commit

Permalink
[Service Bus] Fix samples (Azure#12289)
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshaNalluru authored Nov 5, 2020
1 parent b90c2a7 commit 82ff76f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async function main() {

async function processDeadletterMessageQueue() {
// If connecting to a subscription's dead letter queue you can use the createReceiver(topicName, subscriptionName) overload
const receiver = sbClient.createReceiver(queueName, { subQueue: "deadLetter" });
const receiver = sbClient.createReceiver(queueName, { subQueueType: "deadLetter" });

const messages = await receiver.receiveMessages(1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async function receiveFromNextSession(serviceBusClient) {
} catch (err) {
if (
isServiceBusError(err) &&
(err.reason === "SessionCannotBeLocked" || err.reason === "OperationTimeout")
(err.reason === "SessionCannotBeLocked" || err.reason === "ServiceTimeout")
) {
console.log(`INFO: no available sessions, sleeping for ${delayOnErrorMs}`);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export async function main() {

async function processDeadletterMessageQueue() {
// If connecting to a subscription's dead letter queue you can use the createReceiver(topicName, subscriptionName) overload
const receiver = sbClient.createReceiver(queueName, { subQueue: "deadLetter" });
const receiver = sbClient.createReceiver(queueName, { subQueueType: "deadLetter" });

const messages = await receiver.receiveMessages(1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ async function receiveFromNextSession(serviceBusClient: ServiceBusClient): Promi
} catch (err) {
if (
isServiceBusError(err) &&
(err.reason === "SessionCannotBeLocked" || err.reason === "OperationTimeout")
(err.reason === "SessionCannotBeLocked" || err.reason === "ServiceTimeout")
) {
console.log(`INFO: no available sessions, sleeping for ${delayOnErrorMs}`);
} else {
Expand Down

0 comments on commit 82ff76f

Please sign in to comment.