Post Office FAQ
PostOfficeMatrix, Post Office Router, PO Matrixes, Well Known Mailboxes and non-well known mailboxes. How does this all work conceptually?
Q: I have been digging around in the PostOfficeMatrix and PORouter code. I think I have a pretty good understanding of the behavior. My understanding is the PORouter maintains the authoritative list of all Post Offices and all “Well Known” Mailboxes. When a well known mail box is destroyed, the owning post office notifies the PORouter of the destruction. The PORouter then broadcasts this to all other PO’s. The same thing occurs when a PO is destroyed. Let me know if this is correct. My question is: Since the PORouter only deals with well known mail boxes – how are non-well known mail boxes used? Are they used primarily for “local” mail? (i.e. a process sending mail to itself?). Can remote processes send mail to a non-well known mail box? What are some specific uses of non-well known mailboxes?
A: The behavior of the Post Office Router with respect to distributing knowledge of POMatrixes and well known mailboxes is correct. While the PORouter is only distributing the information about all post office matrixes, and the well known boxes, interprocess communication to non well-known mailboxes works just fine. This is because if you've addressed a Message to a mailbox at a non-local post office, the LocalPostOffice will forward the mail on to the PostOfficeMatrix. At this point, it will send the message to the PostOfficeMatrix specified in the destination address.
The general pattern of communication many of the processes use is to send a message that starts a conversation to a well-known mailbox. For example, when an Area Server starts up, it sends a registration message to the well-known mailbox of the World Server. The World Server records the return address of this message and sends a registration response message to the Area Server. When the Area Server processes the registration response, it records the return address of the message. After this, all communication Messages are addressed with these MailboxAddresses. Because the POMatrix only cares about the PostOffice name part of the Message address, it can forward a message on to a non-well-known mailbox.
Put another way, each Message has two parts to the address, the Mailbox name, and the PostOfficeMatrix name. The PostOfficeMatrix routes messages that are not addressed to it to the other PostOfficeMatrixes. If the PostOfficeMatrix handles a message that is addressed to it, it passes it to the LocalPostOffice for dispatch to the correct Mailbox. The "Well Known" Mailbox list is just a convenient way of getting a fully qualified address with which to start a conversation.