@Override
 public void messageReceived(SCAMPIMessage message, String service) {
   try {
     if (!ScampiCommunicator.getSelf()
         .getRestScampiMessageRepository()
         .exists(message.getAppTag())) {
       RestScampiMessage restScampiMessage = new RestScampiMessage(message, service);
       ScampiCommunicator.getSelf().saveInDatabase(restScampiMessage);
     }
   } finally {
     message.close();
   }
 }
 @Override
 public void onConnectFailed() {
   restartCounter++;
   if (restartCounter < 3) {
     ScampiCommunicator.getSelf().tryReconnect();
   }
   System.out.println("> onConnectFailed");
 }