AnonHxy opened a new issue, #19189:
URL: https://github.com/apache/pulsar/issues/19189

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) 
and found nothing similar.
   
   
   ### Version
   
   lastest master
   
   ### Minimal reproduce step
   
   1. Start a pulsar standalone
   2. Create a partitioned topic
   3. Start a producer to send only one message:
      - batchingMaxPublishDelay = 1ms
      - batchingMaxBytes=1024bytes
      - batchingMaxMessages=1000
      - The msg size is 2048 bytes, which is great than `batchingMaxBytes`(1024 
bytes)
   ```
    public static void main(String[] args) throws Exception {
           String topic = "pulsar_master";
           PulsarClient client = PulsarClient.builder()
                   .serviceUrl("pulsar://127.0.0.1:6650")
                   .build();
           byte[] msg = new byte[2048];
           new Random().nextBytes(msg);
           Producer<byte[]> producer = client.newProducer()
                   .topic(topic)
                   .enableBatching(true)
                   .batchingMaxPublishDelay(1, TimeUnit.MILLISECONDS)
                   .batchingMaxBytes(1024)
                   .batchingMaxMessages(1000)
                   .sendTimeout(10, TimeUnit.SECONDS)
                   .create();
           producer.sendAsync(msg).thenAccept(msgId -> System.out.println("send 
msg " + msgId));
           Thread.sleep(100000);
       }
   ```
   
   ### What did you expect to see?
   
   Console should print `send msg  xxx`
   
   ### What did you see instead?
   
   Print nothing. The `producer.sendAsync` will never complete.  After 10s we 
could see the timeout log from the producer:
   ```
   ProducerImpl:1983 - [pulsar_master] [standalone-4-0] Message send timed out. 
Failing 1 messages
   ``` 
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [X] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to