diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs index 3afdb4531..a9839ec31 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs @@ -1,4 +1,4 @@ -// Copyright (c) MASA Stack All rights reserved. +// Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. namespace Masa.Contrib.Dispatcher.IntegrationEvents.Dapr; @@ -19,18 +19,18 @@ public Publisher(IServiceProvider serviceProvider, string pubSubName, string app _serviceProvider = serviceProvider; _logger = serviceProvider.GetService>(); _pubSubName = pubSubName; + _appId = appId; + _daprAppId = daprAppId; + if (serviceProvider.EnableIsolation()) { - if (_daprAppId.IsNullOrWhiteSpace()) _logger?.LogError("Isolation is enabled but dapr AppId required for integration events is not configured"); + if (_daprAppId.IsNullOrWhiteSpace()) + _logger?.LogError("Isolation is enabled but dapr AppId required for integration events is not configured"); MasaArgumentException.ThrowIfNullOrWhiteSpace(daprAppId); } - - _appId = appId; - _daprAppId = daprAppId; } - public async Task PublishAsync( string topicName, T @event,