Exemplo n.º 1
0
        public void Consume(SubscriptionRemoved message)
        {
            _log.Debug(() => string.Format("Subscription Removed: {0} [{1}]", message.Subscription, message.Subscription.CorrelationId));

            var remove = new RemoveSubscription(message.Subscription);

            SendToClients(remove);
        }
        public void Consume(SubscriptionRemoved message)
        {
            _log.InfoFormat("Proxy New to OLd Removing Subscription: {0}", message.Subscription);

            var remove = new RemoveSubscription(message.Subscription.MessageName, message.Subscription.EndpointUri);

            SendToClients(remove);
        }
        /// <summary>
        /// Removes a remote subscription from the route path or a local data or control bus 
        /// </summary>
        /// <param name="message"></param>
        public void OnSubscriptionRemoved(SubscriptionRemoved message)
        {
            _connectionCache.WithValue(message.SubscriptionId, unsubscribe =>
                {
                    unsubscribe();
                    _connectionCache.Remove(message.SubscriptionId);

                    _log.Debug(() => string.Format("Removed: {0} => {1}, {2}", message.MessageName, message.EndpointUri,
                        message.SubscriptionId));
                });
        }
Exemplo n.º 4
0
        /// <summary>
        /// Removes a remote subscription from the route path or a local data or control bus
        /// </summary>
        /// <param name="message"></param>
        public void OnSubscriptionRemoved(SubscriptionRemoved message)
        {
            _connectionCache.WithValue(message.SubscriptionId, unsubscribe =>
            {
                unsubscribe();
                _connectionCache.Remove(message.SubscriptionId);

                _log.Debug(() => string.Format("Removed: {0} => {1}, {2}", message.MessageName, message.EndpointUri,
                                               message.SubscriptionId));
            });
        }
Exemplo n.º 5
0
        public void Consume(SubscriptionRemoved message)
        {
            if (_log.IsInfoEnabled)
            {
                _log.InfoFormat("Subscription Removed: {0} [{1}]", message.Subscription, message.Subscription.CorrelationId);
            }

            var remove = new RemoveSubscription(message.Subscription);

            SendToClients(remove);
        }
        /// <summary>
        /// Removes a remote subscription from the route path or a local data or control bus 
        /// </summary>
        /// <param name="message"></param>
        public void OnSubscriptionRemoved(SubscriptionRemoved message)
        {
            _connectionCache.WithValue(message.SubscriptionId, unsubscribe =>
                {
                    unsubscribe();
                    _connectionCache.Remove(message.SubscriptionId);

                    if (_log.IsInfoEnabled)
                        _log.InfoFormat("Removed: {0} => {1}, {2}", message.MessageName, message.EndpointUri,
                            message.SubscriptionId);
                });
        }
Exemplo n.º 7
0
        private void SubscriptionDisposing(Subscription subscription, string key)
        {
            subscription.Disposing -= SubscriptionDisposing;
            if (Subscriptions.ContainsKey(subscription))
            {
                var observer = Subscriptions[subscription];
                var count    = Subscriptions.Count(x => x.Key.SubscriptionKey == key);

                Subscriptions.Remove(subscription);
                SubscriptionRemoved?.Invoke(this, observer, key);
            }
        }
        public void OnSubscriptionRemoved(SubscriptionRemoved message)
        {
            _log.Debug(string.Format("subscription removed: '{0}'", message));

            TopicDescription topicDescription;
            if (_bindings.TryGetValue(message.SubscriptionId, out topicDescription))
            {
                _inboundTransport.RemoveTopicSubscriber(topicDescription);

                _bindings.Remove(message.SubscriptionId);
            }
        }
        public void OnSubscriptionRemoved(SubscriptionRemoved message)
        {
            Guard.AgainstNull(_inputAddress, "InputAddress", "The input address was not set");

            MessageName messageName;
            if (_bindings.TryGetValue(message.SubscriptionId, out messageName))
            {
                _inboundTransport.UnbindSubscriberExchange(messageName.ToString());

                _bindings.Remove(message.SubscriptionId);
            }
        }
Exemplo n.º 10
0
        public void OnSubscriptionRemoved(SubscriptionRemoved message)
        {
            _log.Debug(string.Format("subscription removed: '{0}'", message));

            TopicDescription topicDescription;

            if (_bindings.TryGetValue(message.SubscriptionId, out topicDescription))
            {
                _inboundTransport.RemoveTopicSubscriber(topicDescription);

                _bindings.Remove(message.SubscriptionId);
            }
        }
Exemplo n.º 11
0
        public void OnSubscriptionRemoved(SubscriptionRemoved message)
        {
            Guard.AgainstNull(_inputAddress, "InputAddress", "The input address was not set");

            MessageName messageName;

            if (_bindings.TryGetValue(message.SubscriptionId, out messageName))
            {
                _inboundTransport.UnbindSubscriberExchange(messageName.ToString());

                _bindings.Remove(message.SubscriptionId);
            }
        }
        public void OnSubscriptionRemoved(SubscriptionRemoved message)
        {
            UnsubscribeAction unsubscribe;
            if (_connectionCache.TryGetValue(message.SubscriptionId, out unsubscribe))
            {
                unsubscribe();
                _connectionCache.Remove(message.SubscriptionId);

                if (_log.IsInfoEnabled)
                    _log.InfoFormat("Removed: {0} => {1}, {2}", message.MessageName, message.EndpointUri,
                        message.SubscriptionId);
            }
        }
        public void OnSubscriptionRemoved(SubscriptionRemoved message)
        {
            _connectionCache.WithValue(message.SubscriptionId, unsubscribe =>
            {
                unsubscribe();
                _connectionCache.Remove(message.SubscriptionId);

                if (_log.IsInfoEnabled)
                {
                    _log.InfoFormat("Removed: {0} => {1}, {2}", message.MessageName, message.EndpointUri,
                                    message.SubscriptionId);
                }
            });
        }
Exemplo n.º 14
0
 private void SubscriptionRemovedInternal <T>(KeySubscriptionContainer <T> container, T observer, string key) where T : class
 {
     if (SubscriptionRemoved != null)
     {
         var count = container.Count(key);
         if (container.Count() == 0)
         {
             container.SubscriptionRemoved -= SubscriptionRemovedInternal;
             Containers.Remove(container);
         }
         var arg = new SubscriptionArg(key, count, observer);
         SubscriptionRemoved?.Invoke(arg);
     }
 }
Exemplo n.º 15
0
		public void OnSubscriptionRemoved(SubscriptionRemoved message)
		{
			if (_ignoredMessageTypes.Contains(message.MessageName))
				return;

			WithTarget(x => x.Send(new RemovePeerSubscriptionMessage
				{
					PeerId = _peerId,
					MessageNumber = ++_messageNumber,
					EndpointUri = message.EndpointUri,
					MessageName = message.MessageName,
					SubscriptionId = message.SubscriptionId,
				}));
		}
        public void OnSubscriptionRemoved(SubscriptionRemoved message)
        {
            _logger.Debug(string.Format("subscription removed: '{0}'", message));

            MessageName messageName = GetMessageName(message);

            if (_bindings.ContainsKey(message.SubscriptionId))
            {
                _logger.Debug(string.Format("cannot remove topic {0} because we don't know who consumes off of it",
                                            messageName));

                _bindings.Remove(message.SubscriptionId);
                _bindings.Each(kv => _inboundTransport.SignalUnboundSubscription(kv.Key));
            }
        }
        public void OnSubscriptionRemoved(SubscriptionRemoved message)
        {
            Guard.AgainstNull(_inputAddress, "InputAddress", "The input address was not set");

            MessageName messageName;
            if (_bindings.TryGetValue(message.SubscriptionId, out messageName))
            {
                using (var management = new RabbitMqEndpointManagement(_inputAddress))
                {
                    management.UnbindExchange(_inputAddress.Name, messageName.ToString(), "");
                }

                _bindings.Remove(message.SubscriptionId);
            }
        }
		public void OnSubscriptionRemoved(SubscriptionRemoved message)
		{
			_logger.Debug(string.Format("subscription removed: '{0}'", message));

			var messageName = GetMessageName(message);

			if (_bindings.ContainsKey(message.SubscriptionId))
			{
				_logger.Debug(string.Format("cannot remove topic {0} because we don't know who consumes off of it",
				                            messageName));

				_bindings.Remove(message.SubscriptionId);
				_bindings.Each(kv => _inboundTransport.SignalUnboundSubscription(kv.Key /* subId */, kv.Value /* topic desc */));
			}
		}
Exemplo n.º 19
0
        public void OnSubscriptionRemoved(SubscriptionRemoved message)
        {
            Guard.AgainstNull(_inputAddress, "InputAddress", "The input address was not set");

            MessageName messageName;

            if (_bindings.TryGetValue(message.SubscriptionId, out messageName))
            {
                using (var management = new RabbitMqEndpointManagement(_inputAddress))
                {
                    management.UnbindExchange(_inputAddress.Name, messageName.ToString(), "");
                }

                _bindings.Remove(message.SubscriptionId);
            }
        }
Exemplo n.º 20
0
        public void OnSubscriptionRemoved(SubscriptionRemoved message)
        {
            if (_ignoredMessageTypes.Contains(message.MessageName))
            {
                return;
            }

            WithTarget(x => x.Send(new RemovePeerSubscriptionMessage
            {
                PeerId         = _peerId,
                MessageNumber  = ++_messageNumber,
                EndpointUri    = message.EndpointUri,
                MessageName    = message.MessageName,
                SubscriptionId = message.SubscriptionId,
                CorrelationId  = message.CorrelationId,
            }));
        }
Exemplo n.º 21
0
        public void OnSubscriptionRemoved(SubscriptionRemoved message)
        {
            long messageNumber = Interlocked.Increment(ref _lastMessageNumber);

            var subscription = new SubscriptionInformation(_peerId, messageNumber, message.MessageName, message.CorrelationId,
                                                           message.EndpointUri);

            subscription.SubscriptionId = message.SubscriptionId;

            var remove = new RemoveSubscription(subscription);

            if (_log.IsDebugEnabled)
            {
                _log.DebugFormat("RemoveSubscription: {0}, {1}", subscription.MessageName, subscription.SubscriptionId);
            }

            _endpoint.Send(remove, SetSendContext);
        }
        public void OnSubscriptionRemoved(SubscriptionRemoved message)
        {
            long messageNumber = Interlocked.Increment(ref _lastMessageNumber);

            var remove = new RemovePeerSubscriptionMessage
            {
                PeerId         = _peerId,
                MessageNumber  = messageNumber,
                SubscriptionId = message.SubscriptionId,
                EndpointUri    = message.EndpointUri,
                MessageName    = message.MessageName,
                CorrelationId  = message.CorrelationId,
            };

            if (_log.IsDebugEnabled)
            {
                _log.DebugFormat("RemoveSubscription: {0}, {1}", remove.MessageName, remove.SubscriptionId);
            }

            _endpoint.Send(remove, SetSendContext);
        }
Exemplo n.º 23
0
		public void OnSubscriptionRemoved(SubscriptionRemoved message)
		{
			_producer.OnSubscriptionRemoved(message);
		}
 public void Handle(MessageContext c, SubscriptionRemoved e)
 {
     // Update the end date
 }
Exemplo n.º 25
0
 public void OnSubscriptionRemoved(SubscriptionRemoved message)
 {
     _producer.OnSubscriptionRemoved(message);
 }
Exemplo n.º 26
0
 /// <summary>
 /// Event invocator for the <see cref="SubscriptionRemoved"/> event
 /// </summary>
 /// <param name="subscription">The removed subscription</param>
 private void OnSubscriptionRemoved(Subscription subscription)
 {
     SubscriptionRemoved?.Invoke(this, subscription);
 }
Exemplo n.º 27
0
 protected virtual void RaiseSubscriptionRemoved(WampSubscriptionRemoveEventArgs e)
 {
     SubscriptionRemoved?.Invoke(this, e);
 }
Exemplo n.º 28
0
 /// <summary>
 /// Raises the <see cref="E:SubscriptionRemoved" /> event.
 /// </summary>
 /// <param name="e">The <see cref="SubscriptionEventArgs"/> instance containing the event data.</param>
 protected internal virtual void OnSubscriptionRemoved(SubscriptionEventArgs e)
 {
     SubscriptionRemoved?.Invoke(this, e);
 }
		public void OnSubscriptionRemoved(SubscriptionRemoved message)
		{
			lock (_observers)
				_observers.Each(x => x.OnSubscriptionRemoved(message));
		}
Exemplo n.º 30
0
 public void Unsubscribe(Subscription subscription)
 {
     _subscriptions.TryRemove(subscription.Topic, out Subscription _);
     SubscriptionRemoved?.Invoke(this, new SubscriptionEventArgs(subscription));
 }
Exemplo n.º 31
0
 public void OnSubscriptionRemoved(SubscriptionRemoved message)
 {
     lock (_observers)
         _observers.Each(x => x.OnSubscriptionRemoved(message));
 }
Exemplo n.º 32
0
        public void Unsubscribe <TEvent>() where TEvent : Event
        {
            _subscriptions.Remove(typeof(TEvent));

            SubscriptionRemoved?.Invoke(typeof(TEvent));
        }