nservicebus

NServiceBus 6 callback client never gets a callback when the request handler fails

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-10 20:14:02
问题 Using NServiceBus 6's Callback feature I have found no way to alert the client that the request handler failed. The request handler will go through all the recoverability steps, and eventually put the message into the error queue. Meanwhile, the client just sits there waiting for its reply. // Client code (e.g. in an MVC Controller) var message = new FooRequest(); var response = await endpoint.Request<FooReponse>(message); // Handler code public class FooRequestHandler : IHandleMessages

NServiceBus unable to receive message

最后都变了- 提交于 2021-01-29 04:35:37
问题 I'm following the NServiceBus getting started guide (version 5) and I get the below error. When the client sends a command to the server, the server has issues to receive the message. The code is okay, because the exact same code on another machine is working. So something is missing on my machine. I did run this command as is mentioned in the tutorial: DISM.exe /Online /NoRestart /English /Enable-Feature /all /FeatureName:MSMQ-Server But it's still not working. 2016-11-01 19:50:47.316 ERROR

Scoped dependency use from NServiceBus Behavior

时光毁灭记忆、已成空白 提交于 2020-05-29 10:57:23
问题 I'm trying to use a Scoped dependency from a NServiceBus Behavior . From NServiceBus Behavior docs: Behaviors are only created once and the same instance is reused on every invocation of the pipeline. Consequently, every behavior dependency will also behave as a singleton, even if a different option was specified when registering it in dependency injection. Furthermore, the behavior, and all dependencies called during the invocation phase, need to be concurrency safe and possibly stateless.

Nservice Bus handler trigger issue

ぃ、小莉子 提交于 2020-04-17 17:53:08
问题 My project is upgrading to use nservice bus version 7. One of the handler is getting executed concurrently. After analysis found that there is a behavior code written and getting executed after handler election. Then next the handler will get executed.This will executed in loop and not getting ended. public class GatewayPublishBehavior : Behavior<IIncomingLogicalMessageContext> { public override async Task Invoke(IIncomingLogicalMessageContext context, Func<Task> next) { //// custom logic

NServiceBus: How to not create queues automatically

别说谁变了你拦得住时间么 提交于 2020-01-24 12:28:20
问题 I really want to be able to prevent NSB from creating my queues automatically. I don’t like how it creates them with totally unrestricted permissions. Is this possible? 回答1: You can provide your custom initialization code by implementing IWantCustomInitialization and specifying it in your code: void IWantCustomInitialization.Init() { NServiceBus.Configure.With() .DefaultBuilder() .MsmqTransport() .DoNotCreateQueues() .XmlSerializer(); } 来源: https://stackoverflow.com/questions/4810164

Can multiple NServiceBus publishers share the same DBSubscriptionStorage?

我是研究僧i 提交于 2020-01-17 02:55:10
问题 Looking at the Publish-Subscribe API and Configuration page, it would seem that the database schema used by NServiceBus to track subscriptions only tracks the Subscriber Endpoint and Message Type. I had hoped that maybe I could change the name of the table in order to use the same database for multiple publishers, but this thread seems to indicate that you can't. The point is - I fully understand and agree with the notion of having a single publisher endpoint per event type - but that

How to impersonate Nservicebus

末鹿安然 提交于 2020-01-16 00:47:08
问题 Hi How to impersonate Nservicebus. I am using Nservicebus 5.2 version. I see some code for old version but that is not available in new version. Do we have some sample which demonstrate the impersonate in 5.2 version. Configure.With() .StructureMapBuilder() .Sagas() .RunTimeoutManager() .UnicastBus() .ImpersonateSender(false) In New version there is no way to set ImpersonateSender Does anyone know how to pass the exact currentprincipal object up to END points? I tried to start my endpoint by

Host Web Api in self hosted NServiceBus

人盡茶涼 提交于 2020-01-15 16:50:34
问题 I'm looking for how to use a self hosted NServiceBus, which starts and hosts Web Api. I can't seem to find any resources on it. Anyone care to point me to a direction or provide some examples? Thanks 回答1: Here is a sample app that walks though the various things you should know when self hosting NServiceBus https://github.com/SimonCropp/NServiceBus.SelfHost The main code is as follows class SelfHostService : ServiceBase { IStartableBus bus; static void Main() { using (var service = new

NServiceBus Could not find a concrete type mapped to XXX error

孤街浪徒 提交于 2020-01-15 11:47:06
问题 I am trying to publish an event which is defined as an interface: Bus.Publish<IAccountCreated>(m => { m.Key = Guid.NewGuid(); }); When using the JSON serializer, it gives me the error: Could not find a concrete type mapped to Contracts.IAccountCreated It works fine with the XML serializer. My endpoint configuration: Configure.With() .DefaultBuilder() .JsonSerializer() <-- when this is here I get the error. .DefiningCommandsAs(t => t.Namespace != null && t.Namespace.StartsWith("Website"))

RaventBootstrapper configuration in NServicebus

不想你离开。 提交于 2020-01-06 13:55:24
问题 I'm trying to make the following NServiceBus Pluralsight training code sample by Andreas Öhlund to work. public class RavenBootstrapper : INeedInitialization { public void Init() { Configure.Instance.Configurer.ConfigureComponent<IDocumentStore>( () => { var store = new DocumentStore { Url = "http://localhost:8080" }; store.Initialize(); store.JsonRequestFactory.DisableRequestCompression = true; return store; } , DependencyLifecycle.SingleInstance); Configure.Instance.Configurer