[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:
Richard Park 2020-11-02 17:54:28 -08:00 коммит произвёл GitHub
Родитель dea54eb934
Коммит a8e3145ae3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
14 изменённых файлов: 17 добавлений и 15 удалений

Просмотреть файл

@ -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>" ||