Refactored the jms code into the JmsServer class