[Solved] How to connect Python consumer to AWS MSK [closed]

Using kafka-python: from kafka import KafkaConsumer if __name__ == ‘__main__’: topic_name=”example-topic” consumer = KafkaConsumer(topic_name, auto_offset_reset=”earliest”, bootstrap_servers=[‘kafka2:9092′], api_version=(0, 10), consumer_timeout_ms=1000) for msg in consumer: print(msg.value) if consumer is not None: consumer.close() from time import sleep from kafka import KafkaProducer # publish messages on topic def publish_message(producer_instance, topic_name, key, value): try: key_bytes = bytes(key, encoding=’utf-8’) value_bytes = … Read more

[Solved] How to use Apache Kafka to send data from one microservice to other microservice using SpringBoot?

Yes, you can use Apache Kafka to communicate between Microservices. With Spring boot you can Spring Kafka or plain kafka-client API. Well there are various ways to achieve this, and it is totally depends on your use case. You can start with Producer & Consumer API, producer will send records to a topic, and then … Read more