private MapMessage newMapMessage(Map<String, Object> body) throws JMSException { MapMessage message = new MapMessageImpl(); for (String key : body.keySet()) { Object value = body.get(key); message.setObject(key, value); } return message; }