class ServiceExecutor implements Runnable {

  private final MessageQueue msgQueue;

  public ServiceExecutor(MessageQueue msgQueue) {
    this.msgQueue = msgQueue;
  }

  /**
   * The ServiceExecutor thread will retrieve each message and process it.
   */
  public void run() {<FILL_FUNCTION_BODY>}
}

    try {
      while (!Thread.currentThread().isInterrupted()) {
        var msg = msgQueue.retrieveMsg();

        if (null != msg) {
          LOGGER.info(msg.toString() + " is served.");
        } else {
          LOGGER.info("Service Executor: Waiting for Messages to serve .. ");
        }

        Thread.sleep(1000);
      }
    } catch (Exception e) {
      LOGGER.error(e.getMessage());
    }
  
<no_super_class>