Skip to content

[Enhancement] It seems that there might be an issue with setting semaphoreAsyncSendNum and semaphoreAsyncSendSize in the constructor of DefaultMQProducerImpl. #7175

@shirenchuang

Description

@shirenchuang

Before Creating the Enhancement Request

  • I have confirmed that this should be classified as an enhancement rather than a bug/feature.

Summary

image

在构造函数这样设置最小数 10 和 1M,是想让最低限流阈值不低于10和1M吗?

那是不是需要再Producer#setSemaphoreAsyncSendNum 和 Producer#setSemaphoreAsyncSendSize也限制一下?

不确定是不是我理解的意思

Are you setting the minimum values of 10 and 1M in the constructor to ensure that the minimum flow control threshold is not lower than 10 and 1M?
In that case, do you also need to limit the Producer's setSemaphoreAsyncSendNum and setSemaphoreAsyncSendSize?
I'm not sure if I understand correctly.

Motivation

    public void setSemaphoreAsyncSendNum(int num) {
        semaphoreAsyncSendNum = new Semaphore(num, true);
    }

    public void setSemaphoreAsyncSendSize(int size) {
        semaphoreAsyncSendSize = new Semaphore(size, true);
    }

==>> ?

    public void setSemaphoreAsyncSendNum(int num) {
        semaphoreAsyncSendNum = new Semaphore(Math.max(num,10), true);
    }

    public void setSemaphoreAsyncSendSize(int size) {
        semaphoreAsyncSendSize = new Semaphore(Math.max(size,1024 * 1024), true);
    }

Describe the Solution You'd Like

.

Describe Alternatives You've Considered

.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions