code: private void shutdownServices() {
          if (producerService != null) {
              producerService.shutdown();
              producerService = null; 
          }
          
          if (deserializerService != null) {
              deserializerService.shutdown();
              deserializerService = null;
          }
      }
docs: Shutdown services