public ConsumerContext(Topic topic, String groupId, IMessageListener consumer, Type messageClazz,
                        ConsumerType consumerType, MessageListenerConfig messageListenerConfig)
 {
     Topic = topic;
     GroupId = groupId;
     Consumer = consumer;
     MessageClazz = messageClazz;
     ConsumerType = consumerType;
     SessionId = Guid.NewGuid().ToString();
     MessageListenerConfig = messageListenerConfig;
 }
        public IConsumerBootstrap FindConsumerBootStrap(Topic topic)
        {

            if (Storage.KAFKA.Equals(topic.StorageType))
            {
                return registry.FindConsumerBootstrap(Endpoint.KAFKA);
            }
            else if (Endpoint.BROKER.Equals(topic.EndpointType) || Endpoint.KAFKA.Equals(topic.EndpointType))
            {
                return registry.FindConsumerBootstrap(topic.EndpointType);
            }
            else
            {
                throw new Exception(string.Format("Unknown endpoint type: {0}", topic.EndpointType));
            }

        }
示例#3
0
 public bool Equals(Topic topic)
 {
     if (string.IsNullOrEmpty(this.Name))
         return false;
     return this.Name.Equals(topic.Name);
 }
示例#4
0
		public Meta addTopic (Topic topic)
		{
			Topics.Add (topic.Name, topic);
			return this;
		}