design - Publish event from service layer composed of web applications using service bus -



design - Publish event from service layer composed of web applications using service bus -

i have read why not publish nservicebus messages web application , another similar question not clear if applies service layer well. example, if service layer composed of web services or rest services built using wcf or web api or other way, should services publish events or send commands? if services hosted in load balanced web servers, problems outlined in articles apply layer well. how recommendation alter or not change?

if definition of event vs command, messages talking events e.g. "a user created" , event should published. matter of fact, service created user doesn't know else i.e. may application supposed create customized portal , yet application supposed send welcome kit user. event , not command. guess hung on definition of web application , application service when application service composed of 1 or many web applications.

the definition of web application

a web application application accessed users on network such net or intranet.

however, me, users can computers , web services web applications , reason question.

edit:

let's consider concrete example. asp.net website (mvc or web form - doesn't matter) displays form operator, gets post info user creation (name, username, password) , invokes wcf service create user. in between website , wcf service can set servicebus , send command create user (request/response) benefits described in first article. wcf service actual business processing layer i.e. create user. have question. after user created, should announce user has been created , other systems can react , whatever supposed do. fits pattern of publish message. however, wcf service web application , has of traits of web applications , confusion.

as mentioned in reply question linked to, publishing event has more actual processing takes places. side-note: not matter of send instead of publish since imply 2 interchangeable whereas have rather different intentions. when want publish, want publish.

the same questions should arise if find publishing web-exposed integration layer: should performing business processing in that code or rather sending off endpoint processing? typically should send off endpoint. may consider how perform relevant action should wish invoke it. instance, if publishing usercreatedevent message implies created user. how user created? forced utilize wcf / web-api layer or can send createusercommand message on bus processed application endpoint? if former may need rethink design. however, if latter should sending command wcf / web-api anyway , processing endpoint perform publish bit :)

update: take on is more cohesion / concerns. typically interact domain, within business, via service bus commands , events, , simple query layer reads. if need expose third-party (or via web) utilize wcf / ws / web-api. point should seek avoid business processing in integration endpoint (or in front-end website). business processing improve suited application servers. there usually exceptions rule if in position influence construction in improve space.

design nservicebus servicebus

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -