[ 
https://issues.apache.org/jira/browse/TUBEMQ-555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17276817#comment-17276817
 ] 

Guocheng Zhang commented on TUBEMQ-555:
---------------------------------------

It is indeed an easy to overlook problem scene: if the client starts sending 
data and releasing in a short time, it will indeed cause the sent data to be 
concentrated in certain partitions.

As you can see from the processing logic of the client, the startup of the 
client will download the network metadata, so it is recommended reusing 
producer objects.

Thanks [~leno]!!!

 

 

> short session data can only be written to a specific partition
> --------------------------------------------------------------
>
>                 Key: TUBEMQ-555
>                 URL: https://issues.apache.org/jira/browse/TUBEMQ-555
>             Project: Apache TubeMQ
>          Issue Type: Bug
>          Components: Client
>            Reporter: xianle cao
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> When a user uses a short session to write data, it starts from 0 each time, 
> so the data can only be written to a fixed partition, which causes an 
> imbalance problem.
> className:
> RoundRobinPartitionRouter.class
> code:
> ```
> AtomicInteger newCounter = new AtomicInteger(0);
> ```
> solution:
> ```
> AtomicInteger newCounter = new AtomicInteger(new Random().nextInt());
> ```



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to