Added JMS handling logic.