The consumeMessages method that drives the update of the Neighbour state with
a new Proxy

@param message  The message containing the updated subscription state.
339222
public void consumeMessages(LockedMessageEnumeration messages) throws Exception
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "consumeMessages", new Object[] { messages });

    SIBusMessage jsMessage = null;
    
    while (messages.hasNext())
    {    
      try
      {
        jsMessage = messages.nextLocked();
      }
      catch (SIException e)
      {
        FFDCFilter.processException(
          e,
          "com.ibm.ws.sib.processor.proxyhandler.NeighbourProxyListener.consumeMessages",
          "1:157:1.73",
          this);
          
        SibTr.exception(tc, e);
      }
  
      if (jsMessage!=null && 
          ((JsMessage) jsMessage).getJsMessageType() != MessageType.SUBSCRIPTION)
      {
        if (tc.isDebugEnabled())
          SibTr.debug(
            tc,
            "Message On incorrect Destination, expecting message "
              + "of Type "
              + MessageType.SUBSCRIPTION
              + " received "
              + ((JsMessage) jsMessage).getJsMessageType());
              
        if (tc.isEntryEnabled()) SibTr.exit(tc, "consumeMessages");
        return;
      }
  
      // Only continue if the message returned is not null
      if (jsMessage!=null)
      {    
        SubscriptionMessage subMessage = null;     
        
        try
        {
          subMessage = ((JsMessage) jsMessage).makeInboundSubscriptionMessage();
        }
        catch (IncorrectMessageTypeException e)
        {
          FFDCFilter.processException(
            e,
            "com.ibm.ws.sib.processor.proxyhandler.NeighbourProxyListener.consumeMessages",
            "1:193:1.73",
            this);
            
          SibTr.exception(tc, e);
        }
        
        // Invoke the limited ME comms trace again now that we have fluffed up the message
        if (TraceComponent.isAnyTracingEnabled()) {
          MECommsTrc.traceMessage(tc, 
              iProxyHandler.getMessageProcessor(), 
              subMessage.getGuaranteedSourceMessagingEngineUUID(),
              MECommsTrc.OP_SUBMSG_CONSUME, 
              null, 
              subMessage);
        }
        
        LocalTransaction transaction = null;
        
        // Switch on the Type of the Message to understand what we need to 
        // process
        try
        {
          
          // Get a transaction to operate under
          transaction = iProxyHandler.getTransactionManager().createLocalTransaction(true);
    
          switch (subMessage.getSubscriptionMessageType().toInt())
          {
            case SubscriptionMessageType.CREATE_INT :
    
              // Create a new Proxy subscription
              handleCreateProxySubscription(subMessage, (Transaction) transaction);
    
              break;
    
            case SubscriptionMessageType.DELETE_INT :
    
              // Delete a proxy subscription
              handleDeleteProxySubscription(subMessage, (Transaction) transaction);
    
              break;
    
            case SubscriptionMessageType.RESET_INT :
    
              // Reset the subscription state.
              handleResetState(subMessage, (Transaction) transaction, false);
    
              break;
    
            case SubscriptionMessageType.REQUEST_INT :
    
              // Reset the subscription state.
              handleResetState(subMessage, (Transaction) transaction, true);
    
              break;
  
            case SubscriptionMessageType.REPLY_INT :
    
              // Reset the subscription state.
              handleResetState(subMessage, (Transaction) transaction, false);
    
              break;
            default :
              // Log Message
              break;
          }
    
          // Delete the current message from the destination as we 
          // have now read it.
          messages.deleteCurrent(transaction);
        
          // Commit the transaction.
          transaction.commit();
        }      
        catch (SIException e)
        {        
          // If there are any exceptions, then this is bad, log a FFDC
          FFDCFilter.processException(
            e,
            "com.ibm.ws.sib.processor.proxyhandler.NeighbourProxyListener.consumeMessages",
            "1:273:1.73",
            this);
            
          SibTr.exception(tc, e);
          
          handleRollback(subMessage, transaction);                
        }
        catch (RuntimeException e)
        {        
          // If there are any exceptions, then this is bad, log a FFDC
          FFDCFilter.processException(
            e,
            "com.ibm.ws.sib.processor.proxyhandler.NeighbourProxyListener.consumeMessages",
            "1:286:1.73",
            this);
            
          SibTr.exception(tc, e);
          
          handleRollback(subMessage, transaction);        
          
          if (tc.isEntryEnabled()) SibTr.exit(tc, "consumeMessages", e);
          
          throw e;
        }
  
      }
    }

    if (tc.isEntryEnabled())
      SibTr.exit(tc, "consumeMessages");
  }
1193215
public void init(BaseMessage message, Object objRawMessage)
    {
        m_message = message;
        if (message != null)
            message.setExternalMessage(this);
        if (objRawMessage != null)
            this.setRawData(objRawMessage);
    }
138498
public void addPayloadProperties(Object msg, BaseMessage message)
    {
        MessageDataDesc messageDataDesc = message.getMessageDataDesc(null);   // Top level only
        if (messageDataDesc != null)
        {
            Map<String,Class<?>> mapPropertyNames = messageDataDesc.getPayloadPropertyNames(null);
        
            if (mapPropertyNames != null)
            {
                Map<String,Object> properties = this.getPayloadProperties(msg, mapPropertyNames);
                for (String key : properties.keySet())
                {
                    message.put(key, properties.get(key));
                }
            }
        }
    }
260923
private void doPushMessage(AbstractMessage message) {
        if (log.isTraceEnabled()) {
            String msgType = message.getMessageType();
            log.trace("doPushMessage: {}", msgType);
        }
        IMessageOutput out = msgOutReference.get();
        if (out != null) {
            try {
                out.pushMessage(message);
                if (message instanceof RTMPMessage) {
                    IRTMPEvent body = ((RTMPMessage) message).getBody();
                    // update the last message sent's timestamp
                    lastMessageTs = body.getTimestamp();
                    IoBuffer streamData = null;
                    if (body instanceof IStreamData && (streamData = ((IStreamData<?>) body).getData()) != null) {
                        bytesSent.addAndGet(streamData.limit());
                    }
                }
            } catch (IOException err) {
                log.warn("Error while pushing message", err);
            }
        } else {
            log.warn("Push message failed due to null output pipe");
        }
    }
530353
@Override
    public Message newMessage(final Object message) {
        final ReusableObjectMessage result = getObject();
        result.set(message);
        return result;
    }
779980
public void sendTextMessage(String message) {
		MessageEnvelope envelope = new MessageEnvelope();
		ReceivedMessage body = new ReceivedMessage();

		body.setText(message);
		envelope.setMessage(body);
		envelope.setSender(new User(facebookMockId));

		System.out.println("Sending message: [" + message + "] as user : ["
				+ facebookMockId + "].");
		forward(envelope);
		System.out.println("Sent!");
	}
1282368
@com.fasterxml.jackson.annotation.JsonProperty("OriginalMessage")
    public void setOriginalMessage(String originalMessage) {
        this.originalMessage = originalMessage;
    }
602250
public void receive(WSMessage message) {
        log.trace("receive message");
        if (isConnected()) {
            WebSocketPlugin plugin = (WebSocketPlugin) PluginRegistry.getPlugin("WebSocketPlugin");
            Optional<WebSocketScopeManager> optional = Optional.ofNullable((WebSocketScopeManager) session.getAttribute(Constants.MANAGER));
            WebSocketScopeManager manager = optional.isPresent() ? optional.get() : plugin.getManager(path);
            WebSocketScope scope = manager.getScope(path);
            scope.onMessage(message);
        } else {
            log.warn("Not connected");
        }
    }
1000652
protected void handleInboundMessageProperties(final MessageContext messageContext,
                                                  final SoapMessage message) {
        if (messageContext == null) { return; }
        
        final String[] propertyNames = messageContext.getPropertyNames();
        if (propertyNames != null) {
            for (final String propertyName : propertyNames) {
                message.setHeader(propertyName, messageContext.getProperty(propertyName));
            }
        }
    }
656291
private void copyCookies(final Message message) {
        if (message instanceof HttpMessage) {
            this.cookies.putAll(((HttpMessage) message).getCookiesMap());
        }
    }
841738
@Override
    public Message newMessage(final String message) {
        final ReusableSimpleMessage result = getSimple();
        result.set(message);
        return result;
    }
168675
@Override
    public Message newMessage(final String message, final Object... params) {
        return getParameterized().set(message, params);
    }
624829
public void sendMessage(Message message)
    {
        try   {
            if (((RemoteMessageQueue)this.getMessageQueue()).isSendRemoteMessage((BaseMessage)message) == false)
                return;
            if (((BaseMessage)message).isProcessedByServer())
                return;     // Don't send back down (the server already processed it).
            if (((BaseMessage)message).isConsumed())
                return;     // Don't send if already handled.
            if (MessageConstants.LOCAL_QUEUE.equalsIgnoreCase(((BaseMessage)message).getMessageHeader().getQueueType()))
                return;     // Local queue only
            synchronized (m_sendQueue)
            {   // In case this is called from another task
                m_sendQueue.sendMessage(message);
            }
        } catch (RemoteException ex)    {
            ex.printStackTrace();
        }
    }
560461
public final void trace(Object message) {

        if (isLevelEnabled(SimpleLog.LOG_LEVEL_TRACE)) {
            log(SimpleLog.LOG_LEVEL_TRACE, message, null);
        }
    }
777997
@Override
    public void onReceive(Object message) {
        if (message instanceof NewMessage) {
            NewMessage newMessage = (NewMessage) message;
            onNewMessage(newMessage.getPeer(), newMessage.getSender(), newMessage.getSortDate(),
                    newMessage.getContentDescription(), newMessage.getHasCurrentUserMention(),
                    newMessage.getUnreadMessagesCount(), newMessage.getUnreadDialogsCount());
        } else if (message instanceof MessagesRead) {
            MessagesRead read = (MessagesRead) message;
            onMessagesRead(read.getPeer(), read.getFromDate());
        } else if (message instanceof PauseNotifications) {
            onNotificationsPaused();
        } else if (message instanceof ResumeNotifications) {
            onNotificationsResumed();
        } else {
            super.onReceive(message);
        }
    }
349686
public String getMessage(String message, Object[] args)
    {
        for (int i=0;i<args.length;i++)
        {
            if (args[i] instanceof List<?>)
            {
                @SuppressWarnings("unchecked")
				List<ProxyField> list = (List<ProxyField>)args[i];
                StringBuilder sb = new StringBuilder();
                for (ProxyField pf: list)
                {
                    sb.append(String.valueOf(pf.getValue()));
                    sb.append(",");
                }
                if (sb.length()>0)
                {
                    args[i] = sb.substring(0, sb.length()-1);
                }
                else
                {
                    args[i] = "";
                }
            }
        }
        return m_messageSourceAccessor.getMessage(message, args);
    }
817855
public void onMessage(final byte[] message, final Session session) {
        final SynchronizeFXWebsocketChannel channel = getChannelOrFail(session);

        channel.newMessage(message, session);
    }