Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- await context.Redeliver(TimeSpan.FromSeconds(5), (consumeCtx, sendCtx) => {
- if (consumeCtx.Headers.TryGetHeader("SenderApp", out object sender))
- {
- sendCtx.Headers.Set("SenderApp", sender);
- }
- }).ConfigureAwait(false);
- protected Task ScheduleSend(Uri rabbitUri, double delay)
- {
- return GetBus().ScheduleSend<IProcessOrganisationUpdate>(
- rabbitUri,
- TimeSpan.FromSeconds(delay),
- _Data,
- new HeaderPipe(_SenderApp, 0));
- }
- public class HeaderPipe : IPipe<SendContext>
- {
- private readonly byte _Priority;
- private readonly string _SenderApp;
- public HeaderPipe (byte priority)
- {
- _Priority = priority;
- _SenderApp = Assembly.GetEntryAssembly()?.GetName()?.Name ?? "Default";
- }
- public HeaderPipe (string senderApp, byte priority)
- {
- _Priority = priority;
- _SenderApp = senderApp;
- }
- public void Probe (ProbeContext context)
- { }
- public Task Send (SendContext context)
- {
- context.Headers.Set("SenderApp", _SenderApp);
- context.SetPriority(_Priority);
- return Task.CompletedTask;
- }
- }
- Initial trigger checking returns true for FinQuest.Robots.OrganisationLinkedinFeed (id: 001ae487-ad3d-4619-8d34-367881ec91ba, sender: FinQuest.Robot.DBProcess, modif: LinkedIn)
- Initial trigger checking returns true for FinQuest.Robots.OrganisationLinkedinFeed (id: 001ae487-ad3d-4619-8d34-367881ec91ba, sender: , modif: LinkedIn)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement