示例#1
0
        /// <summary>
        /// A default message received handler useful for debugging.
        /// </summary>
        /// <param name="subscription">The subscription the message was received on.</param>
        /// <param name="message">The message that was received.</param>
        public void UnityEventDebugExhangeMessageHandler(AmqpExchangeSubscription subscription, IAmqpReceivedMessage message)
        {
            // Decode as text
            var payload = System.Text.Encoding.UTF8.GetString(message.Body);

            AmqpConsole.Color = new Color(1f, 0.5f, 0);
            AmqpClient.Log("Message received on {0}: {1}", subscription.ExchangeName + (!string.IsNullOrEmpty(message.RoutingKey) ? ":" + message.RoutingKey : ""), payload);
            AmqpConsole.Color = null;

            MessageListController.AddMessage(subscription, message);
        }
示例#2
0
        /// <summary>
        /// A default message received handler useful for debugging.
        /// </summary>
        /// <param name="subscription">The subscription the message was received on.</param>
        /// <param name="message">The message that was received.</param>
        public void UnityEventDebugQueueMessageHandler(AmqpQueueSubscription subscription, IAmqpReceivedMessage message)
        {
            // Decode as text
            queueMessages.Enqueue(message);
            var payload = System.Text.Encoding.UTF8.GetString(message.Body);

            AmqpConsole.Color = new Color(1f, 0.5f, 0);
            AmqpClient.Log("Message received on {0}: {1}", subscription.QueueName, payload);
            //AmqpClient.Log("ReplyTo: " + message.Properties.ReplyTo);
            AmqpConsole.Color = null;

            MessageListController.AddMessage(subscription, message);
        }
示例#3
0
 public void Awake()
 {
     MessageListController.Instance = this;
 }