File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -360,8 +360,14 @@ def test_large_messages(self):
360
360
# Produce 10 messages that are large (bigger than default fetch size)
361
361
large_messages = self .send_messages (0 , [ random_string (5000 ) for x in range (10 ) ])
362
362
363
- # Consumer should still get all of them
364
- consumer = self .consumer ()
363
+ # Brokers prior to 0.11 will return the next message
364
+ # if it is smaller than max_bytes (called buffer_size in SimpleConsumer)
365
+ # Brokers 0.11 and later that store messages in v2 format
366
+ # internally will return the next message only if the
367
+ # full MessageSet is smaller than max_bytes.
368
+ # For that reason, we set the max buffer size to a little more
369
+ # than the size of all large messages combined
370
+ consumer = self .consumer (max_buffer_size = 60000 )
365
371
366
372
expected_messages = set (small_messages + large_messages )
367
373
actual_messages = set ([ x .message .value for x in consumer ])
You can’t perform that action at this time.
0 commit comments