Exemple #1
0
        internal async Task CreateInternalTopicsAsync(
            ITopicManager topicManager,
            InternalTopologyBuilder builder)
        {
            var clusterMetadata = topicManager.AdminClient.GetMetadata(timeout);

            brokerConfigResource.Name = clusterMetadata.Brokers[0].BrokerId.ToString();
            var resultsConf = await topicManager.AdminClient.DescribeConfigsAsync(new List <ConfigResource> {
                brokerConfigResource
            });

            var internalTopicsGroups = builder.MakeInternalTopicGroups();

            foreach (var entry in internalTopicsGroups)
            {
                ComputeRepartitionTopicConfig(entry.Value, internalTopicsGroups, clusterMetadata);
                ComputeChangelogTopicConfig(entry.Value, clusterMetadata, resultsConf);

                var internalTopics = entry.Value.ChangelogTopics.Union(entry.Value.RepartitionTopics).ToDictionary();

                await topicManager.ApplyAsync(entry.Key, internalTopics);

                // refresh metadata
                clusterMetadata = topicManager.AdminClient.GetMetadata(timeout);
            }
        }
 public ProtocolInterpreterService(IClientManager clientManager, ITopicManager topicManager)
 {
     _clientManager = clientManager;
     _topicManager  = topicManager;
     _handler       = new Dictionary <MessageType, Func <Socket, string, bool> >
     {
         { MessageType.Subscribe, Subscribe },
         { MessageType.Unsubscribe, Unsubscribe }
     };
 }
Exemple #3
0
        private void InitializeInternalTopicManager()
        {
            // Create internal topics (changelogs & repartition) if need
            var adminClientInternalTopicManager = supplier.GetAdmin(configuration.ToAdminConfig(
                                                                        StreamThread.GetSharedAdminClientId(
                                                                            $"{configuration.ApplicationId.ToLower()}-admin-internal-topic-manager")));

            internalTopicManager = new DefaultTopicManager(configuration, adminClientInternalTopicManager);

            InternalTopicManagerUtils
            .New()
            .CreateSourceTopics(builder, supplier)
            .CreateInternalTopicsAsync(internalTopicManager, builder)
            .GetAwaiter()
            .GetResult();
        }
 public TelemetryService(ITopicSubscriber topicSubscriber, ITopicManager topicManager)
 {
     _topicSubscriber = topicSubscriber;
     _topicManager    = topicManager;
 }
 public TopicAppService(ITopicManager topicManager)
 {
     _topicManager = topicManager;
 }
Exemple #6
0
 public NotificationService(ITopicPublisher topicPublisher, ITopicSubscriber topicSubscriber, ITopicManager topicManager)
 {
     _topicPublisher  = topicPublisher;
     _topicSubscriber = topicSubscriber;
     _topicManager    = topicManager;
 }
 public CommandService(ITopicPublisher topicPublisher, ITopicSubscriber topicSubscriber, ITopicManager topicManager)
 {
     _topicPublisher = topicPublisher;
     _topicManager   = topicManager;
 }
 public TopicsController(ITopicManager topicManager, ILogger <TopicsController> logger)
     : base(logger)
 {
     this._topicManager = topicManager;
 }