control
I've also wondered about this.
Would a typical example be the pattern where you register on a website,
and
after you hit the Register button, it sends you an email sometime later on
with an autogenerated password to the email you indicated in your
registration? Is that one example of using a message queue?
Yes indeed, and it's the "sometime later" in your post which is important.
E.g. if you have an eCommerce system where people can purchase goods with a
credit card, you will typically want to authorise the purchase in real-time
and provide a response to the customer in as close to real-time as possible
i.e. your purchase has been authorised, your bank has declined the
transaction etc. That would not be a good candidate for MSMQ because you
don't actually want to queue this message up - you want to tell the person
there and then.
However, your warehouse might arrange the packaging and dispatch of goods
all through the day but only send out the dispatch notification emails as a
batch process through the night when the site is less busy, so that part of
the process would be a prime candidate for MSMQ because the clients don't
really need to know the precise minute that their goods were dispatched.