{"id":16201187,"url":"https://github.com/mjunaidca/ai-mart-platform-session-code","last_synced_at":"2025-03-19T05:31:05.640Z","repository":{"id":242322046,"uuid":"809238999","full_name":"mjunaidca/ai-mart-platform-session-code","owner":"mjunaidca","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-09T15:44:42.000Z","size":114,"stargazers_count":6,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T16:11:01.322Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mjunaidca.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-02T05:41:50.000Z","updated_at":"2024-09-16T20:18:37.000Z","dependencies_parsed_at":"2024-10-27T20:19:13.503Z","dependency_job_id":"f08aa107-7046-4df6-8989-d68dd6146d0e","html_url":"https://github.com/mjunaidca/ai-mart-platform-session-code","commit_stats":null,"previous_names":["mjunaidca/ai-mart-platform","mjunaidca/ai-mart-platform-session-code"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjunaidca%2Fai-mart-platform-session-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjunaidca%2Fai-mart-platform-session-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjunaidca%2Fai-mart-platform-session-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjunaidca%2Fai-mart-platform-session-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjunaidca","download_url":"https://codeload.github.com/mjunaidca/ai-mart-platform-session-code/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243971180,"owners_count":20376784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T09:36:10.299Z","updated_at":"2025-03-19T05:31:05.176Z","avatar_url":"https://github.com/mjunaidca.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 02_kafka_messaging\n\n### AIOKafkaProducer\n\nAIOKafkaProducer is a high-level, asynchronous message producer.\n\nExample of AIOKafkaProducer usage:\n\n```\nfrom aiokafka import AIOKafkaProducer\n\n# Kafka Producer as a dependency\nasync def get_kafka_producer():\n    producer = AIOKafkaProducer(bootstrap_servers='broker:19092')\n    await producer.start()\n    try:\n        # Produce message\n        await producer.send_and_wait(\"my_topic\", b\"Super message\")\n    finally:\n        await producer.stop()\n```\n\n### AIOKafkaConsumer\nAIOKafkaConsumer is a high-level, asynchronous message consumer. It interacts with the assigned Kafka Group Coordinator node to allow multiple consumers to load balance consumption of topics (requires kafka \u003e= 0.9.0.0).\n\nExample of AIOKafkaConsumer usage:\n\n```\nfrom aiokafka import AIOKafkaConsumer\nimport asyncio\n\nasync def consume_messages():\n    consumer = AIOKafkaConsumer(\n        'my_topic', 'my_other_topic',\n        bootstrap_servers='localhost:9092',\n        group_id=\"my-group\")\n    # Get cluster layout and join group `my-group`\n    await consumer.start()\n    try:\n        # Consume messages\n        async for msg in consumer:\n            print(\"consumed: \", msg.topic, msg.partition, msg.offset,\n                  msg.key, msg.value, msg.timestamp)\n    finally:\n        # Will leave consumer group; perform autocommit if enabled.\n        await consumer.stop()\n\nasyncio.create_task(consume_messages())\n```\n\nhttps://github.com/aio-libs/aiokafka","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjunaidca%2Fai-mart-platform-session-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjunaidca%2Fai-mart-platform-session-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjunaidca%2Fai-mart-platform-session-code/lists"}