Skip to content

message trace throws exception #4507

@thezp

Description

@thezp

BUG REPORT

  1. Please describe the issue you observed:
  • What did you do (The steps to reproduce)?
    1.use DefaultMQPushConsumer as consumer with enableMsgTrace set to true
    image
    2.set consumeMessageBatchMaxSize to 100
    image
    3.pull 1000 msgs at one time
    image
  • What is expected to see?
    the message trace ability is ok
  • What did you see instead?
    following exxception is thrown
    image
  1. Please tell us about your environment:
    version:4.9.3
  2. Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc):
    in org.apache.rocketmq.client.trace.AsyncTraceDispatcher class the traceProducer's maxMessageSize is set to 118K as following:
    image
    and when the flushData method is invoked, sometimes when the buffer is bigger than traceProducer.getMaxMessageSize() it will invoke the producer's send method to send trace message to broker
    image
    and before the producer prepare to send the message it will check the message's size, then the exception will occure

steps to fix it:
1.change the maxMessageSize of traceProducer to 128K
image
2.change the lower bound to 118K and leave 10K for the trace message
image

attached file is the test case of this exception
DefaultMQConsumerWithTraceBugTest.zip

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