Initialize messageQueue before using it
Shutting down all components of the server after exiting the mainloop