I would like to know if my understanding of Message Bus and Message Queue workings is correct.
First thing first, I need to clear the naming, a service bus is used interchangeably with message bus? It is a publisher-subscriber type of system where messages are added let's say to a message collection by any number of publishers and from where any number of subscribers can read, am i right so far ?
P1 --- /``````S1
\________ Service Bus Middleware ------+------ S2
/ MESSAGE-COLLECTION \______S3
P2 ---
What I don't understand is
how does a subscriber know what message it is interested in, I mean it subscribes to it obviously, but how does it know to which message(s) it should subscribe?, Where does it see the message list, how is this available to it? via an API with or how ?
How does the subscriber receives the message ?
when is a message removed from MESSAGE-COLLECTION? What I can imagine is that some counter is kept for each message, the counter represents the total number of subscribers which gets decremented as soon as one subscriber successfully processed the message.
A message queue also known as a message-broker is a push-pull type of system. There are any number of producers and any number of consumers. Each producer creates a queue per consumer to which it feeds messages.
--- Message Queue 1 ---- C1
/
P1 ------ +
\
--- Message Queue 2 ---- C2
P2 ------ + --- Message Queue 1 ---- C1
Since this is the case, the message gets removed as soon as the consumer successfully processes it. Are my message queue understanding of its workings correct ?
Another concept that I'm not sure of what exactly does is event hub.