如何在 Azure 事件中心重新启动 Express 服务器?
我正在 Express 服务器中运行 Azure 事件中心,并且希望在事件中心发生故障时重新启动它。
我该怎么做?
import { Application } from "./Application";
import { clientControllers } from "./lib/clients";
import { CreateDeliveryEventHub } from "./lib/create-delivery-event-hub/create-delivery-event-hub";
import { config } from "dotenv";
import { Log } from "lib-nodejs-shared";
(async () => {
try {
//if running locally use the .env file
config();
// For each client configuration that includes "creating a delivery" through their own event hub
const azureEventHub = new CreateDeliveryEventHub.Processor(clientControllers);
const app = new Application(azureEventHub);
app.start();
} catch (e) {
Log.error("Azure Event Hub Initialization Failure", { error: e, config });
}
})();
I am running an Azure Event Hub in my Express server and want to restart it if the Event Hub fails.
How can I do this?
import { Application } from "./Application";
import { clientControllers } from "./lib/clients";
import { CreateDeliveryEventHub } from "./lib/create-delivery-event-hub/create-delivery-event-hub";
import { config } from "dotenv";
import { Log } from "lib-nodejs-shared";
(async () => {
try {
//if running locally use the .env file
config();
// For each client configuration that includes "creating a delivery" through their own event hub
const azureEventHub = new CreateDeliveryEventHub.Processor(clientControllers);
const app = new Application(azureEventHub);
app.start();
} catch (e) {
Log.error("Azure Event Hub Initialization Failure", { error: e, config });
}
})();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论