Skip to content

StreamsExecutionEnvironment instances should be able to be registered as component #75

Description

@fhussonnois

Currenlty a StreamsExecutionEnvironment instance can be registed directly through the AzkarraContext#addExecutionEnvironment method and from the configuration.

The following example shows how to define an environment using configuration :

azkarra {
  // Create a environment for running the WordCountTopology
  environments = [
    {
      name: "dev"
      config = {}
      jobs = [
        {
          name = "word-count-demo"
          description = "Kafka Streams WordCount Demo"
          topology =  "WordCountTopology"
          config = {}
        }
      ]
    }
  ]
}

But, this is not possible to declare an environement as a component, i.e :

Example:

@Factory
public class EnvironmentFactory {

    @Component
    @Named("dev")
    public StreamsExecutionEnvironment devEnv() {
       return DefaultStreamsExecutionEnvironment.create();
    }
}

or

azkarraContext.registerSingleton("dev",  
   StreamsExecutionEnvironment.class, 
   () -> DefaultStreamsExecutionEnvironment.create()
); 

This issue is an improvement to update the DefaultAzkarraContext and more specifically the private method preStart to automatically register all components of type StreamsExecutionEnvironment on context startup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersin:runtimeThis issue should impact the azkarra-runtime moduletype:enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions