NServiceBus翻译之持久化技术(一):Persistence In NServiceBus
2013-08-18 20:44
337 查看
Last Updated: Dec 03, 2012 08:24PM IST
NserviceBus中有很多特征都要求信息的持久化,主要是timeouts,Sagas,以及subscription的存储。
NserviceBus中有四种持久化技术:
1. RavenDB
2. NHibernate
3. In Memory
4. MSMQ
关于RavenDB的安装可以看 here and怎么样连接到RavenDB参见 here.
Using NHibernate for persistence
NserviceBus3.0开始支持NHibernate持久化技术,其位于单独的程序集中,更多信息参加 Readmore
What's available?
下表总结了哪些是可以获得的,以及如何配置他们:
假如self hosting,那么你可以根据你的需求任意配置持久化技术,举一个例子,假如你想要存储subscription在内存中,timeouts在RavenDB中,那么可以使用以下代码:
当使用NServiceBus.Host.exe,有现成的profile你可以利用,下表展示了每种预建profile的默认配置采用的是何种持久化技术。 此外,你可以覆盖这些默认的配置,如何覆盖参考
here and here.
下表总结了应用在内建的profile中的不同的持久化技术,不过在配置一个持久化技术之前首先检查一下是否有别的存储被使用,以避免覆盖了用户的配置。
Default Persisting Technology
AsA_Server将会激活Timeout manager,这个角色并不明确决定使用哪种持久化技术,默认的timeout manager的持久化技术是RavenDB。
类似于AsA_Server这个角色,不同的profile将会激活不同的NServiceBus特征,而不需要明确地配置持久化技术,更多的关于各种profile的资料参考 here.
NserviceBus中有很多特征都要求信息的持久化,主要是timeouts,Sagas,以及subscription的存储。
NserviceBus中有四种持久化技术:
1. RavenDB
2. NHibernate
3. In Memory
4. MSMQ
关于RavenDB的安装可以看 here and怎么样连接到RavenDB参见 here.
Using NHibernate for persistence
NserviceBus3.0开始支持NHibernate持久化技术,其位于单独的程序集中,更多信息参加 Readmore
What's available?
下表总结了哪些是可以获得的,以及如何配置他们:
| InMemory | RavenDB | NHibernate | MSMQ |
Timeout | √ | √ | √ | Not supported begining version 3.3,0 |
Subscription | √ | √ | √ | √ |
Saga | √ | √ | √ | |
Gateway | √ | √ | √ | |
Distributor | | | √ | √ |
Second Level Retry | | | | √ |
Fault Management | √ | | | √ |
Notifications | | | | √ |
static void Main() { Configure.With() .Log4Net() .DefaultBuilder() .XmlSerializer() .MsmqTransport() .IsTransactional(true) .PurgeOnStartup(false) .InMemorySubscriptionStorage() .UnicastBus() .ImpersonateSender(false) .LoadMessageHandlers() .UseRavenTimeoutPersister() .CreateBus() .Start(() => Configure.Instance. ForInstallationOn<NServiceBus. Installation.Environments.Windows>().Install()); }
当使用NServiceBus.Host.exe,有现成的profile你可以利用,下表展示了每种预建profile的默认配置采用的是何种持久化技术。 此外,你可以覆盖这些默认的配置,如何覆盖参考
here and here.
下表总结了应用在内建的profile中的不同的持久化技术,不过在配置一个持久化技术之前首先检查一下是否有别的存储被使用,以避免覆盖了用户的配置。
| InMemory | RavenDB | NHibernate | MSMQ |
Timeout | Lite | Integration/Production | | Keeps a queue for management |
Subscription | Lite | Integration/Production | | |
Saga | Lite | Integration/Production | | |
Gateway | Lite | MultiSite | | |
Distributor | | | | Distributor |
Second Level Retry | | | | Uses Timeout queue |
Fault Management | Lite | | | Integration/Production |
Notifications | | | | Lite/Integration/Production |
AsA_Server将会激活Timeout manager,这个角色并不明确决定使用哪种持久化技术,默认的timeout manager的持久化技术是RavenDB。
类似于AsA_Server这个角色,不同的profile将会激活不同的NServiceBus特征,而不需要明确地配置持久化技术,更多的关于各种profile的资料参考 here.
相关文章推荐
- NServiceBus翻译之持久化技术(二):Using RavenDB In NServiceBus – Installing
- NServiceBus翻译之持久化技术(三):Using RavenDB In NServiceBus – Connecting
- NServiceBus翻译之持久化技术(四):How To Debug RavenDB Through Fiddler Using NServiceBus
- NServiceBus VS MassTransit 从 stackoverflow.com 翻译而来,希望对这两个技术比较关心的同学有帮助
- WF的持久化数据库SqlPersistenceService中的InstanceState记录会自动删除.
- Azure Messaging-ServiceBus Messaging消息队列技术系列4-复杂对象消息是否需要支持序列化和消息持久化
- NserviceBus翻译之FAQ:MsmqTransportConfig配置项
- Azure Messaging-ServiceBus Messaging消息队列技术系列4-复杂对象消息是否需要支持序列化和消息持久化
- Azure Messaging-ServiceBus Messaging消息队列技术系列6-消息回执
- Azure Messaging-ServiceBus Messaging消息队列技术系列3-消息顺序保证
- $q in Angular [ngdoc service] 翻译
- Azure Messaging-ServiceBus Messaging消息队列技术系列4-复杂对象消息是否需要支持序列化和消息持久化
- Azure Messaging-ServiceBus Messaging消息队列技术系列4-复杂对象消息是否需要支持序列化和消息持久化
- Azure Messaging-ServiceBus Messaging消息队列技术系列1-基本概念和架构
- 《Service Oreiented Architecture in the Real World》推荐及翻译计划
- Azure Messaging-ServiceBus Messaging消息队列技术系列6-消息回执
- Azure Messaging-ServiceBus Messaging消息队列技术系列-索引篇
- [翻译]Redis官方主题 – Persistence持久化(转载)
- Azure Messaging-ServiceBus Messaging消息队列技术系列7-消息事务
- SqlPersistenceService持久化数据库