nservicebus

How to handle message order in nservicebus?

左心房为你撑大大i 提交于 2019-12-08 02:53:54
问题 I'm trying to find a way to process messages in the order they were sent from the sender since NServiceBus does not guarantee that messages will be processed in a particular order. The sender is an order system which publishes createOrder and reviseOrder commands. The sender allows the user to submit multiple revisions to the same order so there can be revision 4 and revision 3 in the queue at the same time. Each revision has a revision number and reason code associated with it which drives

Safe to host NServiceBus publisher inside IIS?

ⅰ亾dé卋堺 提交于 2019-12-07 18:43:58
问题 I was wondering if it's safe to host an NServiceBus endpoint that serves as an event publisher inside IIS? To clarify, we use an application hosted in IIS as our CRM system (Microsoft Dynamics CRM), and I want to use NServiceBus to publish an event when a contact's information is updated. MS CRM allows the use of custom plugins to react on a contact update, and I intend to create a plugin that publishes a 'ContactUpdated' event through NServiceBus for that situation. Hence, this will

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

一世执手 提交于 2019-12-07 16:18:10
问题 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

nservicebus on-premise host using azure Queue

谁都会走 提交于 2019-12-07 13:32:22
问题 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. 回答1: Yes this is possible, you simply have to specify the

Why NServiceBus OutgoingHeaders is static and not ThreadStatic?

。_饼干妹妹 提交于 2019-12-07 13:24:04
问题 How is NServiceBus maintaining consistency when the outgoing headers is static? Does it mean if I were to set the outgoing headers for a particular message, it will affect all other outgoing messages since it's a singleton? namespace NServiceBus.MessageHeaders { [ComVisible(false)] public class MessageHeaderManager : IMutateOutgoingTransportMessages { private static IDictionary<string, string> staticOutgoingHeaders = (IDictionary<string, string>) new Dictionary<string, string>(); private

Can I have a NserviceBus saga be started by AND handle the same message?

让人想犯罪 __ 提交于 2019-12-07 12:13:07
问题 Quick question: I have a saga that can have a scenario where it needs to handle a message that could come in under two situations. One where the saga is still open and one where the saga has been marked as complete. If the saga is open, great, continue as normal. If the saga is not open it needs to to start a new saga. What is the best practice to handle this situation? IHandleMessages<> works great, obviously, if the saga is open. But won't IAmStartedByMessages<> cause two sagas to be open?

Migration patch from NServiceBus 2.6 to NServiceBus 3.0

╄→尐↘猪︶ㄣ 提交于 2019-12-07 12:12:51
问题 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? 回答1: 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

NServiceBus Dependency Injection

此生再无相见时 提交于 2019-12-07 12:12:48
问题 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

“Could not load file or assembly”/ “or one of its dependencies. The module was expected to contain an assembly manifest.”

风格不统一 提交于 2019-12-07 11:15:50
问题 I have a c# application which uses SharpSVN dll and NServicebus dll,it compile fine but when it is executing(in the time of initialize the bus) it throw the following error Could not load file or assembly 'file:///C:\Repositories\Repo\hooks\SharpSvn-DB44-20-Win32.dll' or one of its dependencies. The module was expected to contain an assembly manifest. How can I solve the above problem. Thank in advance Susanta 回答1: Exclude the sharpsvn dlls from the NServiceBus assemblyscanning by configuring

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

巧了我就是萌 提交于 2019-12-07 10:47:05
问题 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);