Skip to content

Virtual transport of RocketMQ#2306

Open
imzs wants to merge 20 commits intocelery:mainfrom
imzs:resolve-conflict
Open

Virtual transport of RocketMQ#2306
imzs wants to merge 20 commits intocelery:mainfrom
imzs:resolve-conflict

Conversation

@imzs
Copy link

@imzs imzs commented May 30, 2025

#2305
Add virtual transport for RocketMQ

Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please also fix the failing test

=================================== FAILURES ===================================
____________________________ test_Channel.test_get _____________________________

self = <t.unit.transport.test_rocketmq.test_Channel object at 0x7f75eb63bbf0>

def test_get(self):
    queue = 'new-queue'
    self.channel.basic_consume(queue, True, None, 'cg1')

    self.consumer.receive.return_value = []
    with pytest.raises(Empty):
        self.channel._get(queue)

    rocketmq_message = _message_to_rocketmq_ack_message(_mock_message(topic=queue, queue=queue))
  rocketmq_message.body = str_to_bytes(dumps(self.channel.prepare_message({})))

t/unit/transport/test_rocketmq.py:150:


self = <rocketmq.v5.model.message.Message object at 0x7f75d9132c00>
body = b'{"body": {}, "content-encoding": null, "content-type": null, "headers": {}, "properties": {"delivery_info": {}, "priority": 0}}'
Restoring 2 unacknowledged message(s)

@body.setter
def body(self, body):
  if body is None or body.strip() == "":

E BytesWarning: Comparison between bytes and string

.tox/3.12-unit/lib/python3.12/site-packages/rocketmq/v5/model/message.py:175: BytesWarning

@Nusnus Nusnus marked this pull request as draft May 31, 2025 15:59
@imzs
Copy link
Author

imzs commented Jun 1, 2025

can you please also fix the failing test

=================================== FAILURES =================================== ____________________________ test_Channel.test_get _____________________________

self = <t.unit.transport.test_rocketmq.test_Channel object at 0x7f75eb63bbf0>

def test_get(self):
    queue = 'new-queue'
    self.channel.basic_consume(queue, True, None, 'cg1')

    self.consumer.receive.return_value = []
    with pytest.raises(Empty):
        self.channel._get(queue)

    rocketmq_message = _message_to_rocketmq_ack_message(_mock_message(topic=queue, queue=queue))
  rocketmq_message.body = str_to_bytes(dumps(self.channel.prepare_message({})))

t/unit/transport/test_rocketmq.py:150:

self = <rocketmq.v5.model.message.Message object at 0x7f75d9132c00> body = b'{"body": {}, "content-encoding": null, "content-type": null, "headers": {}, "properties": {"delivery_info": {}, "priority": 0}}' Restoring 2 unacknowledged message(s)

@body.setter
def body(self, body):
  if body is None or body.strip() == "":

E BytesWarning: Comparison between bytes and string

.tox/3.12-unit/lib/python3.12/site-packages/rocketmq/v5/model/message.py:175: BytesWarning

hi, I've suppressed the BytesWarning for those test cases, and I'll submit an issue to the SDK community to get it fixed.

@auvipy
Copy link
Member

auvipy commented Jun 2, 2025

Ok, thanks

@imzs
Copy link
Author

imzs commented Jun 25, 2025

@auvipy hi, I've fixed the issue which causes test failure in py313, could you help me trigger the workflow?

@auvipy
Copy link
Member

auvipy commented Jun 25, 2025

Sure

@imzs imzs marked this pull request as ready for review June 25, 2025 09:04
@imzs imzs requested a review from auvipy June 25, 2025 09:05
@imzs
Copy link
Author

imzs commented Nov 6, 2025

@auvipy hi, the conflict was fixed and I notice that python-version has changed, so could you help me trigger the workflow?

@codecov
Copy link

codecov bot commented Nov 9, 2025

Codecov Report

❌ Patch coverage is 80.66465% with 64 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.19%. Comparing base (e320780) to head (487c035).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
kombu/transport/rocketmq.py 80.66% 48 Missing and 16 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2306      +/-   ##
==========================================
- Coverage   82.24%   82.19%   -0.06%     
==========================================
  Files          79       80       +1     
  Lines       10086    10417     +331     
  Branches     1153     1191      +38     
==========================================
+ Hits         8295     8562     +267     
- Misses       1589     1637      +48     
- Partials      202      218      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@auvipy auvipy requested a review from Copilot November 9, 2025 16:41
@auvipy auvipy added this to the 5.7.0 milestone Nov 9, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds RocketMQ transport support to Kombu, enabling message queuing through Apache RocketMQ as a backend. The implementation follows the virtual transport pattern and provides a comprehensive mapping between AMQP semantics and RocketMQ concepts.

  • Implements RocketMQ transport module with Channel, QoS, and Transport classes
  • Adds comprehensive test coverage for the new RocketMQ transport
  • Includes documentation and dependency configuration for the RocketMQ integration

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
kombu/transport/rocketmq.py Main implementation of RocketMQ transport with Channel, QoS, and Transport classes, including message handling, producer/consumer management, and AMQP-to-RocketMQ mapping
t/unit/transport/test_rocketmq.py Comprehensive unit tests for RocketMQ transport covering QoS operations, channel operations, producer/consumer management, and message handling
requirements/extras/rocketmq.txt Defines RocketMQ-specific dependencies (rocketmq-python-client and grpcio-tools)
requirements/test-ci.txt Adds RocketMQ requirements to CI test dependencies
requirements/extras/gcpubsub.txt Updates protobuf version specification
kombu/transport/init.py Registers the RocketMQ transport in the transport registry
docs/reference/kombu.transport.rocketmq.rst Adds Sphinx documentation for the RocketMQ transport module
docs/reference/index.rst Adds RocketMQ transport to the documentation index

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Change-Id: Ib0fcf35f367c3292ab415bcf46cfd4105c57248a
@imzs
Copy link
Author

imzs commented Nov 11, 2025

@auvipy I've fixed the typo, indentation, deprecated method in resolve-conflict branch based on Copilot's suggestions.

@imzs
Copy link
Author

imzs commented Nov 24, 2025

@auvipy Hi, is there anything else I should improve or clarify? I’m happy to make any further adjustments needed.

@imzs
Copy link
Author

imzs commented Jan 12, 2026

hi @auvipy
Could you please trigger the test again? The test case failed due to a timeout issue, but it should pass upon retry.

ERROR: HTTP error 504 while getting https://github.com/celery/py-amqp/zipball/main
ERROR: Could not install requirement https://github.com/celery/py-amqp/zipball/main 
(from -r /home/runner/_work/kombu/kombu/requirements/dev.txt (line 1)) 
because of HTTP error 504 Server Error: Gateway Time-out for url: https://github.com/celery/py-amqp/zipball/main for URL https://github.com/celery/py-amqp/zipball/main

Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix the merge conflicts

@imzs
Copy link
Author

imzs commented Mar 2, 2026

please fix the merge conflicts

The gcpubsub requirement conflict has been resolved.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

auvipy and others added 5 commits March 2, 2026 22:10
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

auvipy and others added 3 commits March 7, 2026 19:46
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants