This Thread will sleep for 30 seconds and then wake up and check the status of the producer by attempting to create/delete a TemporaryTopic. If the creation of the TemporaryTopic fails, it assumes there is something wrong with the producer's connection to the broker and it will therefore not be able to produce any messages. When that happens, it attempts to do a "clean" shutdown on the producer and then restarts the producer which will re-establish its connection to the broker and it will be able to produce messages again. This means, if we have to take down a broker for any reason (on purpose or not), we will NOT have to restart all our "long running" producers when the broker comes back up, rather, they will do that themselves.
The thread is started when the producer is started the first time and continues this process for the life of the producer.
@author Tod Jackson