docs: boolean storeMessage(
                           MessageItem msg,
                           TransactionCommon transaction,
                           InputHandlerStore inputHandlerStore,
                           boolean storedByIH)
                      throws SIResourceException
      {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.entry(
                          tc,
                          "storeMessage",
                          new Object[] {
                                        msg,
                                        transaction,
                                        inputHandlerStore,
                                        Boolean.valueOf(storedByIH) });
  
          //Store the msg to the item stream
          //When pubsub and we are attached to the output side of the destination (feature 176658.3.7)
          //we have to have stored this message under the InputHandler
          //item stream first, then reference it here
          if (_isPubSub)
          {
              try
              {
                  // If this subscription is not an internal subscription then
                  // create references on the relevant durable streams
                  if (dispatcherState.getTargetDestination() == null)
                  {
                      //If the message has not yet been stored in the IH
                      if (!storedByIH)
                      {
                          //store it in the IH
                          inputHandlerStore.storeMessage(msg, transaction);
                          storedByIH = true;
  
                      }
  
                      boolean downgradePersistence = false;
  
                      // If this is a non-durable subscription there is no need to persist a
                      // reference to a persistent message, it can be downgraded to a volatile
                      // reference.
                      if (dispatcherState.isDurable())
                      {
                          msg.addPersistentRef();
                      }
                      else
                      {
                          msg.addNonPersistentRef();
                          downgradePersistence = true;
                      }
  
                      //store a reference in the reference stream
                      final MessageItemReference msgRef =
                                      new MessageItemReference(msg, downgradePersistence);
  
                      subscriptionItemStream.getSubscriptionLockManager().lock();
  
                      try
                      {
                          if (!subscriptionItemStream.isToBeDeleted())
                          {
                              registerForEvents(msgRef);
                              Transaction msTran = _messageProcessor.resolveAndEnlistMsgStoreTransaction(transaction);
                              subscriptionItemStream.add(msgRef, msTran);
                              msTran.registerCallback(msgRef); //PM38052 registering this callback allows afterCompletion 
                                                               // to be called on the MessageItemReference
                          }
                      } finally
                      {
                          subscriptionItemStream.getSubscriptionLockManager().unlock();
                      }
  
                  }
                  else
                  {
                      // SM0010.mp.1 This is an internal subscription. We do not
                      // want to create references. Instead we want to bypass
                      // the reference stream and forward on to the target dest
  
                      // Lookup the target destination
                      DestinationHandler target;
                      try
                      {
                          target = _baseDestHandler.
                                          getDestinationManager().
                                          getDestination(dispatcherState.getTargetDestination(),
                                                         false);
  
                          if (target == null)
                          {
                              SIResourceException e = new SIResourceException(
                                              nls.getFormattedMessage(
                                                                      "INTERNAL_SUBSCRIPTION_TARGET_NOT_FOUND_CWSIP0115",
                                                                      new Object[] {
                                                                                    dispatcherState.getSubscriberID(),
                                                                                    dispatcherState.getDurableHome(),
                                                                                    dispatcherState.getTargetDestination() },
                                                                      null));
  
                              // Target destination for internal subscription does not exist
                              FFDCFilter.processException(
                                                          e,
                                                          "com.ibm.ws.sib.processor.impl.ConsumerDispatcher.storeMessage",
                                                          "1:583:1.280.5.25",
                                                          this);
  
                              SibTr.exception(tc, e);
  
                              if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                                  SibTr.exit(tc, "storeMessage", e);
  
                              throw e;
                          }
  
                          // Take a copy of the message
                          JsMessage msgCopy = null;
                          try
                          {
                              msgCopy = msg.getMessage().getReceived();
                          } catch (MessageCopyFailedException e)
                          {
                              // FFDC
                              FFDCFilter.processException(
                                                          e,
                                                          "com.ibm.ws.sib.processor.impl.ConsumerDispatcher.storeMessage",
                                                          "1:606:1.280.5.25",
                                                          this);
  
                              if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                                  SibTr.exit(tc, "storeMessage", "MessageCopyFailedException");
  
                              throw new SIResourceException(e);
                          }
  
                          // Get the inputhandler associated with it
                          InputHandler inputHandler =
                                          target.
                                                          getInputHandler(target.isPubSub() ? ProtocolType.PUBSUBINPUT : ProtocolType.UNICASTINPUT,
                                                                          _messageProcessor.getMessagingEngineUuid(),
                                                                          null);
  
                          inputHandler.handleMessage(new MessageItem(msgCopy),
                                                     transaction, _messageProcessor.getMessagingEngineUuid());
  
                      } catch (SITemporaryDestinationNotFoundException e)
                      {
                          // No FFDC code needed
                          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                              SibTr.exit(tc, "storeMessage", "SITemporaryDestinationNotFoundException");
                          throw new SIResourceException(e);
                      } catch (SINotPossibleInCurrentConfigurationException e)
                      {
                          // No FFDC code needed
                          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                              SibTr.exit(tc, "storeMessage", "SINotPossibleInCurrentConfigurationException");
                          throw new SIResourceException(e);
                      } catch (SIIncorrectCallException e)
                      {
                          // No FFDC code needed
                          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                              SibTr.exit(tc, "storeMessage", "SIIncorrectCallException");
                          throw new SIResourceException(e);
                      }
                  }
              } catch (RollbackException e)
              {
                  // No FFDC code needed
  
                  // We catch the RollbackException explicitly because we do not want to generate
                  // and FFDC and error in the log. Rollbacks are not internal errors.
                  // Any real errors will be caught by the MessageStoreException catch block below.
                  SibTr.exception(tc, e);
  
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                      SibTr.exit(tc, "storeMessage", e);
  
                  throw new SIResourceException(e);
              } catch (InvalidAddOperation e)
              {
                  // No FFDC code needed
                  if (state != SIMPState.DELETED)
                  {
                      // MessageStoreException shouldn't occur so FFDC.
                      FFDCFilter.processException(
                                                  e,
                                                  "com.ibm.ws.sib.processor.impl.ConsumerDispatcher.storeMessage",
                                                  "1:668:1.280.5.25",
                                                  this);
  
                      SibTr.exception(tc, e);
                      SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
                                  new Object[] {
                                                "com.ibm.ws.sib.processor.impl.ConsumerDispatcher",
                                                "1:675:1.280.5.25",
                                                e });
  
                      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                          SibTr.exit(tc, "storeMessage", e);
  
                      throw new SIResourceException(
                                      nls.getFormattedMessage(
                                                              "INTERNAL_MESSAGING_ERROR_CWSIP0002",
                                                              new Object[] {
                                                                            "com.ibm.ws.sib.processor.impl.ConsumerDispatcher",
                                                                            "1:686:1.280.5.25",
                                                                            e },
                                                              null),
                                      e);
                  }
  
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      SibTr.debug(tc, "ConsumerDeispatcher deleted " + this);
  
              } catch (MessageStoreException e)
              {
                  // MessageStoreException shouldn't occur so FFDC.
                  FFDCFilter.processException(
                                              e,
                                              "com.ibm.ws.sib.processor.impl.ConsumerDispatcher.storeMessage",
                                              "1:702:1.280.5.25",
                                              this);
  
                  SibTr.exception(tc, e);
                  SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
                              new Object[] {
                                            "com.ibm.ws.sib.processor.impl.ConsumerDispatcher",
                                            "1:709:1.280.5.25",
                                            e });
  
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                      SibTr.exit(tc, "storeMessage", e);
  
                  throw new SIResourceException(
                                  nls.getFormattedMessage(
                                                          "INTERNAL_MESSAGING_ERROR_CWSIP0002",
                                                          new Object[] {
                                                                        "com.ibm.ws.sib.processor.impl.ConsumerDispatcher",
                                                                        "1:720:1.280.5.25",
                                                                        e },
                                                          null),
                                  e);
              }
  
          }
          else //pt-pt
          {
              // Add the item to the itemstream.   183715.1
              // The itemstream should never be null.  If it is a null pointer exception
              // will be thrown.
  
              // The transaction should also never be null.  An auto-commit transaction
              // should be passed in if the message is not transacted.
  
              try
              {
                  // Register for the event on the listener.
                  _baseDestHandler.registerForEvents(msg);
  
                  // 516307: Register for events before we add the message. If we're using an auto commit tran
                  // then there's a possibility that a consumer can come in on another thread and see this message
                  // even before the addItem method returns. This means they can remove the message from the
                  // ItemStream and no events will be driven, so no post processing occurs, including PMI statistics
                  // counting and re-driving the message if the consumer chooses to unlock or roll back the consumption
                  // of the message.
                  // (this isn't a problem for pubsub as we never use an auto commit tran)
                  registerForEvents(msg);
  
                  Transaction msTran = _messageProcessor.resolveAndEnlistMsgStoreTransaction(transaction);
                  itemStream.addItem(msg, msTran);
              } catch (OutOfCacheSpace e)
              {
                  // No FFDC code needed
                  SibTr.exception(tc, e);
  
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                      SibTr.exit(tc, "storeMessage", e);
  
                  throw new SIResourceException(e);
              } catch (MessageStoreException e)
              {
                  // MessageStoreException shouldn't occur so FFDC.
                  FFDCFilter.processException(
                                              e,
                                              "com.ibm.ws.sib.processor.impl.ConsumerDispatcher.storeMessage",
                                              "1:769:1.280.5.25",
                                              this);
  
                  SibTr.exception(tc, e);
                  SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
                              new Object[] {
                                            "com.ibm.ws.sib.processor.impl.ConsumerDispatcher",
                                            "1:776:1.280.5.25",
                                            e });
  
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                      SibTr.exit(tc, "storeMessage", e);
  
                  throw new SIResourceException(
                                  nls.getFormattedMessage(
                                                          "INTERNAL_MESSAGING_ERROR_CWSIP0002",
                                                          new Object[] {
                                                                        "com.ibm.ws.sib.processor.impl.ConsumerDispatcher",
                                                                        "1:787:1.280.5.25",
                                                                        e },
                                                          null),
                                  e);
              }
  
              storedByIH = false;
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.exit(tc, "storeMessage", Boolean.valueOf(storedByIH));
  
          return storedByIH;
      }