in packages/azure-kusto-ingest/src/ingestClientBase.ts [85:106]
private async sendQueueMessage(maxRetries: number, blobInfo: IngestionBlobInfo) {
const queues = await this.resourceManager.getIngestionQueues();
if (queues == null) {
throw new Error("Failed to get queues");
}
const ingestionBlobInfoJson = JSON.stringify(blobInfo);
const encoded = Buffer.from(ingestionBlobInfoJson).toString("base64");
const retryCount = Math.min(maxRetries, queues.length);
for (let i = 0; i < retryCount; i++) {
const queueClient = new QueueClient(queues[i].uri);
try {
const queueResponse = await queueClient.sendMessage(encoded);
this.resourceManager.reportResourceUsageResult(queueClient.accountName, true);
return queueResponse;
} catch (_) {
this.resourceManager.reportResourceUsageResult(queueClient.accountName, false);
}
}
throw new Error("Failed to send message to queue.");
}