docs: @Override
      public synchronized void consumeMessages(final LockedMessageEnumeration lockedMessages) {
  
          final String methodName = "consumeMessages";
          if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
              SibTr.entry(this, TRACE, methodName, lockedMessages);
          }
  
          // PM74709.dev - don't acquire "insideConsumeMessagesLock" when startSession() is already starting the
          // session, this may create a deadlock.
          if (sessionStarting) {
              if (TRACE.isDebugEnabled()) {
                  SibTr.debug(this, TRACE, "Return this method, as startSession() is in progress.");
              }
              if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
                  SibTr.exit(this, TRACE, methodName);
              }
              return;
          }
  
          synchronized (insideConsumeMessagesLock)
          {
              insideConsumeMessages = true;
          }
  
          MessagePacingControl mpc = MessagePacingControlFactory.getInstance();
          if (mpc != null && mpc.isActive()) {
  
              // we are about to check if XD wants to suspend a context.  We need to give each context
              // its own callback as it is the context that is suspended and not the listener as a whole;
              // although we do map an XD suspend to a session stop.
              AsynchResumeCallbackImpl asyncResumeCallback = new AsynchResumeCallbackImpl();
              AsynchDispatchScheduler aysnDispatchScheduler = mpc.preAsynchDispatch(_connection
                              .getEndpointConfiguration().getBusName(),
                                                                                    _destinationAddress.getDestinationName(),
                                                                                    asyncResumeCallback);
  
              // we don't need to worry that XD will resume before we have cached the LME
              // because we hold SibRaListener lock (resume runnable takes SibRaListener
              // lock ensuring we have cached the LME, and it is visible
              if (aysnDispatchScheduler.suspendAsynchDispatcher()) {
                  mpcPacingSessionStarted = false;
                  asyncResumeCallback.createCachedEnumeration(lockedMessages, aysnDispatchScheduler);
              } else {
  
                  // We are not suspended so pass in the asynchdispatchScheduler we
                  // just obtained
                  internalConsumeMessages(lockedMessages, aysnDispatchScheduler);
              }
          }
          else {
              // MessagingPacing is not active so we don't have a asynchDispatchScheduler
              internalConsumeMessages(lockedMessages, null);
          }
  
          // No need to check if startSession() is in progress before acquiring "insideConsumeMessagesLock"
          // as there will not be an attempt to start the session when "insideConsumeMessages" is true.
  
          synchronized (insideConsumeMessagesLock)
          {
              insideConsumeMessages = false;
  
              // Check to see if we need to stop the session. This is needed here because any
              // pacing logic that kicked in whilst insideConsumeMessages was true, wouldn't
              // have actually stopped a session - just altered flags. So we'll do the stop here
              // if we need to.
              try {
                  stopIfRequired();
              } catch (final SIException exception) {
                  FFDCFilter.processException(exception, CLASS_NAME + "."
                                                         + methodName, "1:979:1.68", this);
                  if (TRACE.isEventEnabled()) {
                      SibTr.exception(this, TRACE, exception);
                  }
              } catch (final SIErrorException exception) {
                  FFDCFilter.processException(exception, CLASS_NAME + "."
                                                         + methodName, "1:986:1.68", this);
                  if (TRACE.isEventEnabled()) {
                      SibTr.exception(this, TRACE, exception);
                  }
              }
          }
  
          if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
              SibTr.exit(this, TRACE, methodName);
          }
  
      }