private void OnMessageReceive(IEnumerable <OutgoingMessage> messages)
        {
            if (subscription == null)
            {
                return;
            }

            foreach (var message in messages)
            {
                if (message.SpecificReceivingEndpointName != null)
                {
                    if (string.Equals(message.SpecificReceivingEndpointName, subscription.EndpointName, StringComparison.OrdinalIgnoreCase))
                    {
                        localQueue.Enqueue(QueuedMessage.FromOutgoing(message));
                    }

                    continue;
                }

                foreach (var subscribedToMappedTypeName in subscription.MessageTypeNames)
                {
                    if (string.Equals(message.MessageTypeNames.First(), subscribedToMappedTypeName, StringComparison.OrdinalIgnoreCase))
                    {
                        localQueue.Enqueue(QueuedMessage.FromOutgoing(message));
                    }
                }
            }
        }
예제 #2
0
 public void Add(DateTime becomesVisibleAtUtc, QueuedMessage message)
 {
     messages.Add(Tuple.Create(becomesVisibleAtUtc, message));
 }