[service-bus] Removing the 'export' keyword that should have never been there. (#12234)
I owe @HarshaNalluru an apology - these 'export main' should never have been in the JS samples :|
This commit is contained in:
Родитель
dea54eb934
Коммит
a8e3145ae3
|
@ -20,7 +20,7 @@ require("dotenv").config();
|
|||
const connectionString = process.env.SERVICE_BUS_CONNECTION_STRING || "<connection string>";
|
||||
const queueName = process.env.QUEUE_NAME || "<queue name>";
|
||||
|
||||
export async function main() {
|
||||
async function main() {
|
||||
// You can also use AAD credentials from `@azure/identity` along with the host url
|
||||
// instead of the connection string for authentication.
|
||||
const serviceBusAdministrationClient = new ServiceBusAdministrationClient(connectionString);
|
||||
|
|
|
@ -24,7 +24,7 @@ require("dotenv").config();
|
|||
const connectionString = process.env.SERVICE_BUS_CONNECTION_STRING || "<connection string>";
|
||||
const queueName = process.env.QUEUE_NAME || "<queue name>";
|
||||
|
||||
export async function main() {
|
||||
async function main() {
|
||||
await sendMessages();
|
||||
await receiveMessage();
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ require("dotenv").config();
|
|||
// Define connection string and related Service Bus entity names here
|
||||
const connectionString = process.env.SERVICE_BUS_CONNECTION_STRING || "<connection string>";
|
||||
|
||||
export async function main() {
|
||||
async function main() {
|
||||
const serviceBusAdministrationClient = new ServiceBusAdministrationClient(connectionString);
|
||||
const baseQueueName = "random-queue";
|
||||
const numberOfQueues = 7;
|
||||
|
|
|
@ -23,7 +23,7 @@ const connectionString = process.env.SERVICE_BUS_CONNECTION_STRING || "<connecti
|
|||
const queueName = process.env.QUEUE_NAME || "<queue name>";
|
||||
const sbClient = new ServiceBusClient(connectionString);
|
||||
|
||||
export async function main() {
|
||||
async function main() {
|
||||
try {
|
||||
// Sending a message to ensure that there is atleast one message in the main queue
|
||||
await sendMessage();
|
||||
|
|
|
@ -24,7 +24,7 @@ const queueName = process.env.QUEUE_NAME || "<queue name>";
|
|||
|
||||
const sbClient = new ServiceBusClient(connectionString);
|
||||
|
||||
export async function main() {
|
||||
async function main() {
|
||||
try {
|
||||
await processDeadletterMessageQueue();
|
||||
} finally {
|
||||
|
|
|
@ -31,7 +31,7 @@ const connectionString = process.env.SERVICE_BUS_CONNECTION_STRING || "<connecti
|
|||
const userEventsQueueName = process.env.QUEUE_NAME_WITH_SESSIONS || "<queue name>";
|
||||
const sbClient = new ServiceBusClient(connectionString);
|
||||
|
||||
export async function main() {
|
||||
async function main() {
|
||||
try {
|
||||
await runScenario();
|
||||
} finally {
|
||||
|
@ -135,7 +135,9 @@ async function processMessageFromSession(sessionId) {
|
|||
}
|
||||
|
||||
console.log(
|
||||
`Received message: Customer '${sessionReceiver.sessionId}': '${messages[0].body.event_name} ${messages[0].body.event_details}'`
|
||||
`Received message: Customer '${sessionReceiver.sessionId}': '${messages[0].body.event_name} ${
|
||||
messages[0].body.event_details
|
||||
}'`
|
||||
);
|
||||
await sessionReceiver.completeMessage(messages[0]);
|
||||
} else {
|
||||
|
|
|
@ -23,7 +23,7 @@ require("dotenv").config();
|
|||
const connectionString = process.env.SERVICE_BUS_CONNECTION_STRING || "<connection string>";
|
||||
const queueName = process.env.QUEUE_NAME || "<queue name>";
|
||||
|
||||
export async function main() {
|
||||
async function main() {
|
||||
const sbClient = new ServiceBusClient(connectionString);
|
||||
|
||||
// If receiving from a subscription you can use the createReceiver(topicName, subscriptionName) overload
|
||||
|
|
|
@ -18,7 +18,7 @@ require("dotenv").config();
|
|||
const connectionString = process.env.SERVICE_BUS_CONNECTION_STRING || "<connection string>";
|
||||
const queueName = process.env.QUEUE_NAME || "<queue name>";
|
||||
|
||||
export async function main() {
|
||||
async function main() {
|
||||
const sbClient = new ServiceBusClient(connectionString);
|
||||
|
||||
// If receiving from a subscription you can use the createReceiver(topicName, subscriptionName) overload
|
||||
|
|
|
@ -20,7 +20,7 @@ require("dotenv").config();
|
|||
const connectionString = process.env.SERVICE_BUS_CONNECTION_STRING || "<connection string>";
|
||||
const queueName = process.env.QUEUE_NAME || "<queue name>";
|
||||
|
||||
export async function main() {
|
||||
async function main() {
|
||||
const sbClient = new ServiceBusClient(connectionString);
|
||||
|
||||
// - If receiving from a subscription you can use the createReceiver(topicName, subscriptionName) overload
|
||||
|
|
|
@ -35,7 +35,7 @@ const listOfScientists = [
|
|||
{ lastName: "Kopernikus", firstName: "Nikolaus" }
|
||||
];
|
||||
|
||||
export async function main() {
|
||||
async function main() {
|
||||
const sbClient = new ServiceBusClient(connectionString);
|
||||
try {
|
||||
await sendScheduledMessages(sbClient);
|
||||
|
|
|
@ -36,7 +36,7 @@ const messages = [
|
|||
{ body: "Nikolaus Kopernikus" }
|
||||
];
|
||||
|
||||
export async function main() {
|
||||
async function main() {
|
||||
const sbClient = new ServiceBusClient(connectionString);
|
||||
|
||||
// createSender() can also be used to create a sender for a topic.
|
||||
|
|
|
@ -38,7 +38,7 @@ const listOfScientists = [
|
|||
{ lastName: "Kopernikus", firstName: "Nikolaus" }
|
||||
];
|
||||
|
||||
export async function main() {
|
||||
async function main() {
|
||||
const sbClient = new ServiceBusClient(connectionString);
|
||||
|
||||
try {
|
||||
|
|
|
@ -21,7 +21,7 @@ require("dotenv").config();
|
|||
const connectionString = process.env.SERVICE_BUS_CONNECTION_STRING || "<connection string>";
|
||||
const queueName = process.env.QUEUE_NAME || "<queue name>";
|
||||
|
||||
export async function main() {
|
||||
async function main() {
|
||||
const proxyInfo = process.env.HTTP_PROXY || process.env.HTTPS_PROXY;
|
||||
|
||||
if (!proxyInfo) {
|
||||
|
|
|
@ -38,7 +38,7 @@ const tenantId = process.env.AZURE_TENANT_ID || "<azure tenant id>";
|
|||
const clientSecret = process.env.AZURE_CLIENT_SECRET || "<azure client secret>";
|
||||
const clientId = process.env.AZURE_CLIENT_ID || "<azure client id>";
|
||||
|
||||
export async function main() {
|
||||
async function main() {
|
||||
if (
|
||||
tenantId === "<azure tenant id>" ||
|
||||
clientSecret === "<azure client secret>" ||
|
||||
|
|
Загрузка…
Ссылка в новой задаче