Reputation: 369
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.
Upvotes: 2
Views: 2998
Reputation: 10720
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.
Upvotes: 0