forked from Particular/NServiceBus
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
THe lite profile is now setting the default to inmemory gateway persi…
…stence instead of forcing it
- Loading branch information
1 parent
54c3fdf
commit afec46f
Showing
3 changed files
with
31 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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
30 changes: 11 additions & 19 deletions
30
src/gateway/NServiceBus.Gateway/Config/GatewayDefaults.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,20 @@ | ||
|
||
namespace NServiceBus | ||
namespace NServiceBus.Gateway.Config | ||
{ | ||
using ObjectBuilder; | ||
using Config; | ||
using Gateway.Persistence; | ||
using Gateway.Persistence.Raven; | ||
using Gateway.Sending; | ||
using Raven.Client; | ||
using System; | ||
using NServiceBus.Config; | ||
using Persistence; | ||
using Sending; | ||
|
||
class GatewayDefaults : IWantToRunWhenConfigurationIsComplete | ||
public class GatewayDefaults : IWantToRunWhenConfigurationIsComplete | ||
{ | ||
public IConfigureComponents Configurer { get; set; } | ||
public static Action DefaultPersistence = () => Configure.Instance.UseRavenGatewayPersister(); | ||
|
||
public void Run() | ||
{ | ||
if (!Configurer.HasComponent<GatewaySender>()) | ||
if (!Configure.Instance.Configurer.HasComponent<GatewaySender>() || Configure.Instance.Configurer.HasComponent<IPersistMessages>()) | ||
return; | ||
|
||
if (!Configurer.HasComponent<IPersistMessages>()) | ||
{ | ||
if (!Configurer.HasComponent<IDocumentStore>()) | ||
Configure.Instance.RavenPersistence(); | ||
Configurer.ConfigureComponent<RavenDbPersistence>(DependencyLifecycle.InstancePerCall); | ||
} | ||
|
||
|
||
DefaultPersistence(); | ||
} | ||
} | ||
} |
This file contains 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