docs: public ConsumerKey createSubscriptionConsumerDispatcherAndAttachCP(LocalConsumerPoint consumerPoint,
                                                                         ConsumerDispatcherState subState)
                      throws
                      SIDiscriminatorSyntaxException,
                      SISelectorSyntaxException,
                      SIResourceException,
                      SINonDurableSubscriptionMismatchException,
                      SINotPossibleInCurrentConfigurationException,
                      SIDestinationLockedException,
                      SISessionDroppedException
      {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.entry(tc, "createSubscriptionConsumerDispatcherAndAttachCP", new Object[] { consumerPoint, subState });
  
          ConsumerKey consumerKey = null;
  
          ConsumerDispatcher cd = null;
  
          if (subState.getSubscriberID() == null) {
              //this is non-durable non shared scenario. i.e subscriber id is null. Then go ahead and create
              //consumer dispatcher and subscription item stream.
              cd = createSubscriptionItemStreamAndConsumerDispatcher(subState, false);
  
              // attach consumer to CD (with no selector as the CD is handling that)
              consumerKey = cd.attachConsumerPoint(consumerPoint,
                                                   null,
                                                   consumerPoint.getConsumerSession().getConnectionUuid(),
                                                   consumerPoint.getConsumerSession().getReadAhead(),
                                                   consumerPoint.getConsumerSession().getForwardScanning(),
                                                   null);
          } else {
              //this is non-durable shared scenario.
              //Check whether already subscriber present or not in hashamp
              //The lock has to be even for get .. as 
              //'retrieval/creation of CD and attaching consumer to CD' should be atomic. 
              synchronized (_destinationManager.getNondurableSharedSubscriptions()) { // this lock is too high level.. has to be further granularized.
                  cd = (ConsumerDispatcher) _destinationManager.getNondurableSharedSubscriptions().get(subState.getSubscriberID());
                  if (cd == null) {
                      //consumer dispatcher is null.. means this is first consumer trying to create subscriber. 
                      //Go ahead and create consumer dispatcher and Subscription item stream.
                      //we do not need to check for any flags like cloned because the call is from JMS2.0 explicitly
                      //asking for subscriber to be shared.
  
                      //_consumerDispatchersNonDurable is needed as the subscription creation has to be atomic
                      cd = createSubscriptionItemStreamAndConsumerDispatcher(subState, true);
                  } else {
                      //already a prior consumer has created CD. Going to reuse it.
                      //Before check whether it is same topic and having topic selectors. 
                      //it not throw an exception.
                      //check whether it is same topic and having topic selectors.
                      if (!cd.getConsumerDispatcherState().equals(subState)) {
                          // Found consumer dispatcher but only the IDs match, therefore cannot connect
                          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                              SibTr.exit(tc, "createSubscriptionConsumerDispatcher", subState);
  
                          throw new SINonDurableSubscriptionMismatchException(
                                          nls.getFormattedMessage(
                                                                  "SUBSCRIPTION_ALREADY_EXISTS_ERROR_CWSIP0143",
                                                                  new Object[] {
                                                                                subState.getSubscriberID(),
                                                                                _messageProcessor.getMessagingEngineName() },
                                                                  null));
                      }
  
                  }
  
                  // CD has been either created freshly or obtained from prior consumer. 
                  // Attach consumer point to CD in this atomic unit it self as other
                  // close calls would not delete this CD in between. All non durable consumer close
                  // also has to use the same lock i.e "_destinationManager.getNondurableSharedSubscriptions()"
                  // for atomic unit of code 'which checks if CD has zero consumer points and then deletes the CD'
  
                  // attach consumer to CD (with no selector as the CD is handling that)
                  consumerKey = cd.attachConsumerPoint(consumerPoint,
                                                       null,
                                                       consumerPoint.getConsumerSession().getConnectionUuid(),
                                                       consumerPoint.getConsumerSession().getReadAhead(),
                                                       consumerPoint.getConsumerSession().getForwardScanning(),
                                                       null);
              } //lock _destinationManager.getNondurableSharedSubscriptions()
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.exit(tc, "createSubscriptionConsumerDispatcherAndAttachCP", consumerKey);
  
          return consumerKey;
      }