Consider a single producer and 10 consumers as threads. The consumers has to subscribe (Ad themselves) to the producer in-order to get any messages that produces sends.
The expected functionality is that, the producer should add a message to a data structure/collection (you choose of your choice) every 2 minutes and notify all consumers. When the consumers receives a notification, it consumes the message, write the details to a common file.
Message format in that file should be ,
[Consumer Name][<<date and Time it consumes the message>>][Message][Message length]
When you are sure that all the consumers consumed the new message, the message has to be removed from the data structure.
The program should redirect the log messages (util logging) to a log file (say prod-consumer.log) too other than the common file where you write details and log the following actions
When procedure sends a message and notify all consumers
Consumer consumed the message
Number of consumers consumed the new message
When message is removed from the data structure/collection
Please note that you will have to handle parallel updates (by consumers) to the same file and also provide good error handling part in-case of any issues. Ensure that you log errors to the log file