@@ -36,6 +36,10 @@ def create_kafka_consumer(
3636 # Get configuration from environment
3737 config = get_kafka_config ()
3838
39+ environment = os .getenv ("LAUNCHPAD_ENV" )
40+ if not environment :
41+ raise ValueError ("LAUNCHPAD_ENV environment variable is required" )
42+
3943 # Create Arroyo consumer
4044 # TODO: When we're closer to production, we'll need a way to disable this logic as
4145 # topics, partitions and kafka clusters are configured through getsentry/ops.
@@ -47,12 +51,19 @@ def create_kafka_consumer(
4751 "arroyo.strict.offset.reset" : config ["arroyo_strict_offset_reset" ],
4852 "enable.auto.commit" : False ,
4953 "enable.auto.offset.store" : False ,
50- "security.protocol" : config ["security.protocol" ],
51- "sasl.mechanism" : config ["sasl.mechanism" ],
52- "sasl.username" : config ["sasl.username" ],
53- "sasl.password" : config ["sasl.password" ],
5454 }
5555
56+ # Only include security fields in non-development environments
57+ if environment != "development" :
58+ consumer_config .update (
59+ {
60+ "security.protocol" : config ["security.protocol" ],
61+ "sasl.mechanism" : config ["sasl.mechanism" ],
62+ "sasl.username" : config ["sasl.username" ],
63+ "sasl.password" : config ["sasl.password" ],
64+ }
65+ )
66+
5667 arroyo_consumer = ArroyoKafkaConsumer (consumer_config )
5768
5869 # Create strategy factory
0 commit comments