[Service Bus] Fix samples (#12289)
This commit is contained in:
Родитель
b90c2a7128
Коммит
82ff76f468
|
@ -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);
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Загрузка…
Ссылка в новой задаче