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)); } }
public bool Equals(Topic topic) { if (string.IsNullOrEmpty(this.Name)) return false; return this.Name.Equals(topic.Name); }
public Meta addTopic (Topic topic) { Topics.Add (topic.Name, topic); return this; }