This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using IdentityModel.Client; | |
namespace IfInsurance.Waypoint.Cached.Identity.TokenClient | |
{ | |
public interface ICachedTokenClient | |
{ | |
string GetToken(bool forceFreshToken = false); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Configuration; | |
using System.Threading.Tasks; | |
using Microsoft.ApplicationInsights; | |
using Microsoft.ApplicationInsights.Extensibility; | |
using Microsoft.Azure.WebJobs; | |
using Microsoft.Azure.WebJobs.Host; | |
using Microsoft.ServiceBus; | |
namespace FunctionApp | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static async Task ResendDeadLetters(string servicebusConnectionString, string queueName) | |
{ | |
var messageFactory = MessagingFactory.CreateFromConnectionString(servicebusConnectionString); | |
var deadletterReceiver = await messageFactory.CreateMessageReceiverAsync(QueueClient.FormatDeadLetterPath(queueName), | |
ReceiveMode.PeekLock); | |
var sender = await messageFactory.CreateMessageSenderAsync(queueName); | |
const int max = 100; | |
var current = 0; | |
//Run until the Dead Letter Queue is empty or take the max number of messages |