0

I'm trying to understand what needs to be done to use sql server for with NServicebus in .Net Core

Let s say I have MicroserviceA sending a command to MicroserviceB

  1. Do I need to have a common project between both solutions that would share the MyCommand?
  2. How should I structure my db schema for nservicebus? Should I it be, for example, _endpoint.Send("receiver.microserviceB", myCommand) from the publisher and microserviceB will subscribe to receive.microserviceB?
  3. Not too sure where the data is stored if I publish an event instead of a command.
  4. How can I have different settings for different environment? Eg:SQL transport for local, sqs in prod

Thanks

tri
  • 191
  • 1
  • 3
  • 9
  • Questions should contain one question. (4) isn't an NServiceBus question. (1) is very much an "it depends" situation and really up to you. (2) is also really about you making choices and I'm not sure what (3) is actually trying to ask. – Damien_The_Unbeliever Feb 28 '19 at 07:38
  • Have you checked out the samples? https://docs.particular.net/samples/sqltransport/simple/ – Hadi Eskandari Feb 28 '19 at 22:36
  • I did. I might have checked the wrong one but as a matter but the sample used publish instead of command. That's why I was wondering what should be the configuration part for both sender and receiver when using sql – tri Mar 02 '19 at 02:13

1 Answers1

0
  1. Yes
  2. endpoint.Send(myCommand);, don't specify a receiver there
  3. Does it matter?
  4. Theoretically, you can, but I'd advise against that.

For more information on my answers, be sure to check out the step-by-step tutorial and for example, more information on transactions in both SQL and SQS transports.

Dennis van der Stelt
  • 2,203
  • 16
  • 22
  • Thanks. 1. Ok I was wondering if it would be better/possible to "duplicate" the POCO instead in the different projects instead. 2. Sorry, forgot to add the destination like. Should it be something like receiver.MicroserviceB if it s send from microserviceA? 3. Not really but it will help me understand how to set up using SQL transport. 4. Why advice against that? I thought it might be the most cost efficient way to use it locally and have similar behavior as using a real event bus like mass transit as SQL server is already installed locally. – tri Mar 02 '19 at 02:21
  • Probably best to contact us directly via support@particular.net 1. Best not to do that and reuse the message(s) assembly. 2. This should be defined in routing, before initializing the endpoint. So you don't have to worry about this anywhere. Makes migrating/splitting endpoints easier as well. 3. But NServiceBus takes care of that!? :-) Subscriptions are stored in a table. 4. Because transports differ in transactional guarantees and other behavior. Best to work with the transport you're going to use. Otherwise, just use Learning Transport? – Dennis van der Stelt Mar 06 '19 at 10:44