nservicebus

Managing RavenDb session in Windsor under NServiceBus

佐手、 提交于 2019-12-06 03:19:32
问题 I'm using NServiceBus (3.2.2), RavenDB (1.2.2017-Unstable) and Windsor (3.0.0.4001) in an MVC 4 project. I have a IHandleMessages class that handles 3 different messages, and that needs an IDocumentSession, and therefore defines a property such as: public IDocumentSession DocumentSession { get; set; } I've copied the RavenDbUnitOfWork implementation from NServiceBus' website I've registered IDocumentStore, IDocumentSession and IManageUnitsOfWork in my Windsor container as follow: container

Is there a global exception handler for NServiceBus?

我们两清 提交于 2019-12-06 02:47:28
问题 The current advice on handling exceptions in NServiceBus is to use the built in facilities. Errored out messages go to the error message queue, and a log is written to disk. But what if I want to send my errors to a service like AirBrake which has better functionality for grouping similar exceptions, metrics, and other good stuff? Is there a global exception handler I can tap into? 回答1: As mentioned in the original post the recommended solution is to use ServicePulse for monitoring errors.

Recursive Bus.Send() with-in a Handler (Transactions, Threading, Tasks)

痞子三分冷 提交于 2019-12-06 02:25:21
I have a handler similar to the following, which essentially responds to a command and sends a whole bunch of commands to a different queue. public void Handle(ISomeCommand message) { int i=0; while (i < 10000) { var command = Bus.CreateInstance<IAnotherCommand>(); command.Id = i; Bus.Send("target.queue@d1555", command); i++; } } The issue with this block is, until the loop is fully completed none of the messages appear in the target queue or in the outgoing queue. Can someone help me understand this behavior? Also if I use Tasks to send messages within the Handler as below, messages appear

NServiceBus Dependency Injection

99封情书 提交于 2019-12-05 23:00:43
I've been having a bit of trouble with this. Andreas Öhlund answered a question on it here , but I've been unable to get it to work using the advice he gave. Here's my setup: public abstract class CommandHandler<T> : IHandleMessages<T>, IDomainReadRepository where T : Command { public IDomainRepository DomainRepository { get; set; } protected abstract void OnProcess(T command); public TAggregate GetById<TAggregate>(Guid id) where TAggregate : IEventProvider, new() { return DomainRepository.GetById<TAggregate>(id); } public void Handle(T message) { OnProcess(message); // Domain repository will

nservicebus on-premise host using azure Queue

萝らか妹 提交于 2019-12-05 22:25:11
It appears that all the sample projects that ship with nServicebus are setup where the sender and host are web roles and worker roles (and hosted via role entry point). I have a need to do something like this: Web Role sends message --> On Premise Host handles message Is it possible to configure an on premise Host to use Azure Queue storage only (and not MSMQ)? I can't seem to find a single example of this documented anywhere. Yes this is possible, you simply have to specify the transport when initializing the Bus: var config = Configure.With() .SpringBuilder() .AzureConfigurationSource() <---

nservicebus concurrent access to saga data

懵懂的女人 提交于 2019-12-05 19:16:20
i use NServiceBus as enterprise Service Bus, in the solution i'm developing i have an orchestration service which receives up to 10k messages from all client applications. I would like to improve the architecture performance and consequently enhance the solution provided. I use a Saga Data class and i would like to share the access to it between all worker threads(up to now i set just to one thread but i want to set at least to 10), what happens when multiple threads try to access the same saga istance? Does NSB already provide such a concurrency feature? Do i have to implement it on my own?

Bridge NSB over WCF

混江龙づ霸主 提交于 2019-12-05 18:55:18
I am trying to publish a WCF service that sends to a NSB host. I have looked at the WebServiceBridge example in the NSB samples but cannot figure out how to use the NServiceBus.WcfService class in the WCF counterpart. I have found out that I can have my service interface inherit one or more IWcfService < TRequest, TResponse >, but since the service class cannot inherit multiple base classes (WcfService), is it possible to have one service implementation serve several message types? Frederik, The WCF Bridge for NServiceBus (like the Web Service Bridge) is designed to be one WCF service = one

How do I Unit Test NServiceBus.Configure.WithWeb()?

社会主义新天地 提交于 2019-12-05 17:47:22
I'm building a WCF service that receives requests on an external IP and translates them into messages that are sent via NServiceBus. One of my unit tests invokes Global.Application_Start() , which performs the configuration of the application, and then attempts to resolve the web service to validate that the container can build up all of the dependencies. This works fine when I'm using Configure.With() in my windows services, but the call to Configure.WithWeb() fails in this context (presumably because the "bin" directory does not exist?). Is it possible to unit test a method that calls

NServiceBus Bus.Send().Register(callback) Not Working on IIS/Windows Server 2008

一曲冷凌霜 提交于 2019-12-05 14:27:03
I have been struggling with this problem for a few days now and I just can't seem to figure it out. I have a simple WCF web service hosted on IIS and Windows Server 2008 R2. The implementation of the Web Service is as follows: var completionResult = new CompletionResult(); var updateTextMessage = new UpdateText { TextTemplateId = textTemplateId, Text = text }; var asyncResult = Global.Bus.Send(updateTextMessage).Register(x => completionResult = x.AsyncState as CompletionResult, null); asyncResult.AsyncWaitHandle.WaitOne(10000); if (completionResult.Messages != null && completionResult.Messages

Migration patch from NServiceBus 2.6 to NServiceBus 3.0

北战南征 提交于 2019-12-05 11:47:03
I have an existing NServiceBus 2.6 application that I want to start moving to 3.0. I'm looking for the minimum change upgrade in the first instance. Is this as simple as replace the 2.6 DLLs with the 3.0 Nuget packages or are there other considerations? For the most part the application migration is quite straight forward, but depending on your configuration and environment, you may need to make the following changes: The new convention over configuration for endpoints may mean you will need to rename your endpoints to match your queue names (@andreasohlund has a good post about this).