State and event information
Publications can be categorized as either state publications, such as the current price of a stock, or event publications, such as a trade in that stock.
State publications
State publications contain information about the current state of something, such as the price of stock or the current score in a soccer match. When something happens (for example, the stock price changes or the soccer score changes), the previous state information is no longer required because it is superseded by the new information.
A subscriber will want to receive the current version of the state information when it starts, and be sent new information whenever the state changes.
If a publication contains state information, it is often published as a retained publication. A new subscriber typically wants the current state information immediately; the subscriber does not want to wait for an event that causes the information to be republished. Subscribers will automatically receive a topic's retained publication when it subscribes unless the subscriber uses the MQSO_PUBLICATIONS_ON_REQUEST or MQSO_NEW_PUBLICATIONS_ONLY options.
Event publications
Event publications contain information about individual events that occur, such as a trade in some stock or the scoring of a particular goal. Each event is independent of other events.
A subscriber will want to receive information about events as they happen.
Parent topic: Publishers and publications