Azure Eventhub High Request Volume
Anthony Altieri
0
Reputation points
I have an Event hub that is receiving about 50 requests a minute and I am not sure what from. They aren't messages because the messages and throughput are all normal. I have sent some requests to logs and the Caller_s field is always Resource Provider. I am using the JavaScript SDK to connect to it but was careful to make sure I am reusing the same client and not spawning a bunch (see code below).
import config from "@/config";
import { EventHubProducerClient } from "@azure/event-hubs";
let eventHubConnection: EventHubProducerClient;
export async function getEventHubConnection(): Promise<EventHubProducerClient> {
if (eventHubConnection) {
console.log("Connection to EventHub already established");
return eventHubConnection;
}
try {
eventHubConnection = new EventHubProducerClient(
config.env.EVENTHUB_CONNECTION_STRING,
config.env.EVENTHUB_NAME,
{
userAgent: "inviza-api/0.1.0",
}
);
} catch (error) {
console.error("Error establishing producer client for cloud", error);
throw error;
}
console.log("Connection to EventHub established");
return eventHubConnection;
}
export async function closeEventHubConnection(): Promise<void> {
if (!eventHubConnection) {
console.log("No EventHub connection to close");
return;
}
try {
await eventHubConnection.close();
console.log("Eventhub connection closed");
return;
} catch (error) {
console.error("Error closing EventHub connection", error);
}
}
export default getEventHubConnection;
Any suggestions on where to look or what might be wrong would be a great help.
Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
711 questions
Sign in to answer