Listen to Service Bus, how? Thread?


What's best practices if i want to integrate with a system over service bus? I guess the service bus client should run isolated in it's own thread or something? And i don't want this thread to be able to crash the site in anyway.

Sep 29, 2016 10:53

Hmm not sure I understand the question? You want to add an ESB (Enterprise Service Bus) between your website and an external system?

Sep 29, 2016 11:13

I'm not sure i understand what to ask since this is new to me :) I want to integrate with MDM over Azure Service bus.

Should I just create an InitializationModule that creates a queue client and hooks up to the events? Or is this a bad practice? Maybe the Client should be isolated somehow?

Sep 29, 2016 11:19

We are integrating with NServiceBus using Handler/Message approach. Your handlers would typically run as windows services. 

You can configure different message queues using MessageEndpointMappings in web.config.

You could use an InitializationModule for starting the Bus, and then send a message to the queue like this:

 ISendOnlyBus bus = ServiceLocator.Current.GetInstance<ISendOnlyBus>();
 var myMessage = new MyMessage() {Name = "Bob"};
Sep 29, 2016 11:46

Hm, ok.

One scenario is adding an e-mail address to a market list in MDM (news letter subscription). I think i must store the message id and the e-mail address, because the request may fail if there is no contact with that e-mail address in MDM. I need to handle this response somewhere.

I was thinking about storing the message id and e-mail address in DDS (maybe together with some other meta data).

Should i create a window service that handles the responses from MDM and then reads data from DDS to create a contact to be able to add the e-mail address to the market list? 

Some kind of flow of a possible scenario what i want:

EPi -> AddEmailToListMessage { email = someemail } -> MDM

EPi <- AddEmailToListMessageResponse { succeeded = false } <- MDM

EPi -> AddContactMessage { email = someemail }  -> MDM

EPi <- AddContactMessageResponse { id = guid } <- MDM

EPi -> AddEmailToListMessage { email = someemail -> MDM

EPi <- AddEmailToListMessageResponse { succeeded = true } <- MDM

Sep 29, 2016 11:56
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.