2

To consume messages from Kafka, I am using the below configuration in my local. It is working fine.

spring.kafka.bootstrap-servers: localhost:9092
spring.kafka.consumer.key-deserializer: org.apache.kafka.common.serialization.IntegerDeserializer
spring.kafka.consumer.value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
spring.kafka.consumer.group-id: order-events
spring.kafka.admin.properties.bootstrap.servers: localhost:9092

In DEV, SIT Kubernates cluster, we are using Amazon MSK. The below details are shared.

Host: z3.kafka-central-1.amazonaws.com:9096,z1.kafka-central-1.amazonaws.com:9096,z2.kafka-central-1.amazonaws.com:9096

Configuration: 3 Partitions, 3 Replicas, 3 Brokers, 3 Different AZs, SASL/SCRAM authentication, retention.ms=604800000, max.message.bytes=2097164

VPC Id: vpc-123sdfsdf234

AWS Account 123456789

CIDR 10.20.1.1/24

Username user-msk-kafka-user

Password XXXXXXXX

What are the properties, i should configure in spring application properties file.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
user1346346
  • 195
  • 2
  • 16

1 Answers1

0

Your MSK VPC CIDR 10.20.1.1/24 is private.

Make sure your Dev/SIT the environment you are using to connect to MSK is in same VPC vpc-123sdfsdf234. If it's inside same VPC, check MSK security group to make sure your CIDR range 10.20.1.1/24 is whitelisted with the required ports.

Otherwise create MSK with Public IP's.

Atul Sharma
  • 9,397
  • 10
  • 38
  • 65
  • How to identify MSK VPC CIDR is private or public. How to configure the configuration details in spring applicaiton.properties – user1346346 Dec 06 '21 at 13:16