Skip to content

Commit

Permalink
- logging no subscriber warning once
Browse files Browse the repository at this point in the history
  • Loading branch information
eben-roux committed Jul 30, 2019
1 parent 810f257 commit 543abde
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2018, Eben Roux
Copyright (c) 2019, Eben Roux
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
4 changes: 2 additions & 2 deletions Shuttle.Esb/Properties/AssemblyInfo.cs
Expand Up @@ -13,10 +13,10 @@
[assembly: AssemblyTitle(".NET Standard 2.0")]
#endif

[assembly: AssemblyVersion("11.0.0.0")]
[assembly: AssemblyVersion("11.0.1.0")]
[assembly: AssemblyCopyright("Copyright © Eben Roux 2019")]
[assembly: AssemblyProduct("Shuttle.Esb")]
[assembly: AssemblyCompany("Shuttle")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyInformationalVersion("11.0.0")]
[assembly: AssemblyInformationalVersion("11.0.1")]
[assembly: ComVisible(false)]
10 changes: 8 additions & 2 deletions Shuttle.Esb/ServiceBus/MessageSender.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using Shuttle.Core.Contract;
using Shuttle.Core.Logging;
Expand All @@ -11,6 +10,8 @@ namespace Shuttle.Esb
public class MessageSender : IMessageSender
{
private readonly ILog _log;
private readonly HashSet<string> _messageTypesPublishedWarning = new HashSet<string>();

private readonly IPipelineFactory _pipelineFactory;
private readonly ISubscriptionManager _subscriptionManager;

Expand Down Expand Up @@ -100,7 +101,12 @@ public IEnumerable<TransportMessage> Publish(object message, Action<TransportMes
return result;
}

_log.Warning(string.Format(Resources.WarningPublishWithoutSubscribers, message.GetType().FullName));
if (!_messageTypesPublishedWarning.Contains(message.GetType().FullName))
{
_log.Warning(string.Format(Resources.WarningPublishWithoutSubscribers, message.GetType().FullName));

_messageTypesPublishedWarning.Add(message.GetType().FullName);
}

return Array.Empty<TransportMessage>();
}
Expand Down

0 comments on commit 543abde

Please sign in to comment.