Printing the screenshot above, we can see that the subscriber receives every message from the publisher. However, for Xiao Hong, she only wants to receive messages with red color and does not want to receive messages with black color. Therefore, we need to make the following modifications to the code. We can first add a key so that the subscriber can only subscribe to messages of interest to herself. The code is as follows:
? ? That is to say, the Spring framework reverses control over the creation of objects
< div id= "showcount" >