/// <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); }
/// <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); }
public void Awake() { MessageListController.Instance = this; }