Skip to content

Commit

Permalink
by-pinja#39: Allow adding Arrival to be configured
Browse files Browse the repository at this point in the history
  • Loading branch information
toka-p committed Dec 15, 2022
1 parent 0c461d4 commit 0d1ca7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Protacon.RxMq.AzureServiceBus.Topic
public class AzureBusTopicSettings : AzureMqSettingsBase
{
public string TopicSubscriberId { get; set; } = Environment.MachineName;
public bool AddArrival { get; set; }

public Func<Type, string> TopicNameBuilder { get; set; } = type =>
{
Expand Down
8 changes: 7 additions & 1 deletion Protacon.RxMq.AzureServiceBus/Topic/AzureTopicSubscriber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ internal Binding(AzureBusTopicSettings settings, ILogger<AzureTopicSubscriber> l
{
try
{
var arrival = DateTimeOffset.UtcNow;
DateTimeOffset arrival;

if (settings.AddArrival)
{
arrival = DateTimeOffset.UtcNow;
}

var body = Encoding.UTF8.GetString(message.Body);

if (!_excludeTopicsFromLogging.Contains(topicName))
Expand Down

0 comments on commit 0d1ca7b

Please sign in to comment.