Open slawomirkania opened 10 months ago
As a Developer I want to be able to start Kafka and Schema Registry in the same network using public interfaces/constructors.
Now it is impossible for two reasons:
getNetwork
null
Example usage
final case class KafkaConfig(bootstrapServers: String, networkAlias: String) final case class SchemaRegistryConfig(schemaUrl: String) private def kafka(network: Network) = Resource .make(IO(KafkaContainer.Def(network).start()))(c => IO(c.stop())) .map { kafkaContainer => KafkaConfig(kafkaContainer.bootstrapServers, kafkaContainer.networkAliases.head) } private def schemaRegistry(network: Network, kafkaConfig: KafkaConfig) = Resource .make(IO(SchemaRegistryContainer.Def(network, kafkaConfig.networkAlias).start()))(c => IO(c.stop())) .map { schemaRegistryContainer => SchemaRegistryConfig(schemaRegistryContainer.schemaUrl) } def kafkaWithSchemaRegistry: Resource[IO, (KafkaConfig, SchemaRegistryConfig)] = for network <- Resource.fromAutoCloseable(IO(Network.newNetwork())) kafkaConfig <- kafka(network) schemaRegistryConfig <- schemaRegistry(network, kafkaConfig) yield (kafkaConfig, schemaRegistryConfig)
As a Developer I want to be able to start Kafka and Schema Registry in the same network using public interfaces/constructors.
Now it is impossible for two reasons:
getNetwork
method results in anull
responseExample usage