anchor.diff:  %% gen_server callback - Module:terminate(Reason, State)
   %% </p>
   terminate(_Reason, #state{id = Id,
  +                          count = Count,
  +                          state_filepath = StateFilePath,
                             mq_properties = MQProps}) ->
       error_logger:info_msg("~p,~p,~p,~p~n",
                             [{module, ?MODULE_STRING}, {function, "terminate/1"},
                              {line, ?LINE}, {body, Id}]),
  +    %% Close the backend_db
       MQDBMessageId = MQProps#mq_properties.mqdb_id,
  -    ok = close_db(MQDBMessageId),
  +    ok = close_db(MQDBMessageId, Count, StateFilePath),
       ok.
   
   
  
positive.code: init([Id, #mq_properties{db_name   = DBName,
                           db_procs  = DBProcs,
                           mqdb_id   = MQDBMessageId,
                           mqdb_path = MQDBMessagePath} = MQProps]) ->
      case application:get_env(leo_mq, backend_db_sup_ref) of
          {ok, Pid} ->
              ok = leo_backend_db_sup:start_child(
                     Pid, MQDBMessageId,
                     DBProcs, DBName, MQDBMessagePath),
              %% @TODO: Retrieve total num of message from the local mq's file
              Count = 0,
              {ok, #state{id = Id,
                          mq_properties = MQProps,
                          count = Count}, ?DEF_TIMEOUT};
          _Error ->
              {stop, 'not_initialized'}
      end.
  
negative.code:                   {?MQ_CNS_PROP_INTERVAL, Interval}
                   ]}, State, ?DEF_TIMEOUT};
  
  handle_call(close, _From, #state{count = Count,
                                   state_filepath = StateFilePath,
                                   mq_properties = MQProps} = State) ->
      MQDBMessageId = MQProps#mq_properties.mqdb_id,
      ok = close_db(MQDBMessageId, Count, StateFilePath),
      {reply, ok, State, ?DEF_TIMEOUT};
  
  handle_call(stop, _From, State) ->
  