class IOMessageListener implements MessageListener {

	@Override
	public void onMessage(javax.jms.Message msg) {
		LoggingService.logDebug(MODULE_NAME, "Start acknowledging message onMessage");
		try {
			TextMessage textMessage = (TextMessage) msg;
			textMessage.acknowledge();
			JsonReader jsonReader = Json.createReader(new StringReader(textMessage.getText()));
			JsonObject json = jsonReader.readObject();
			jsonReader.close();

			Message message = new Message(json);
			callback.sendRealtimeMessage(message);
		} catch (Exception exp) {
			LoggingService.logError(MODULE_NAME, "Error acknowledging message",
					new AgentSystemException("Error acknowledging message", exp));
		}

		LoggingService.logDebug(MODULE_NAME, "Finish acknowledging message onMessage");
	}

	public  IOMessageListener(MessageCallback callback);

}