Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix][client] Fixes batch_size not checked in MessageId#fromByteArrayWithTopic #7

Closed
wants to merge 1 commit into from

Conversation

BewareMyPower
Copy link
Owner

Fixes apache#18395

Motivation

The old version Pulsar clients might not set the batch_size field in a batched message id, it will cause MessageId#fromByteArrayWithTopic, which only checks the batch_index field, fail with IllegalStateException.

Modifications

Check if the batch_size field exists in fromByteArrayWithTopic. If it doesn't exist, create the BatchMessageIdImpl instance with the default batch size (0) and the acker (disabled).

Move MessageIdSerializationTest to the pulsar-client module and add the testBatchSizeNotSet to verify the change works.

…WithTopic

Fixes apache#18395

### Motivation

The old version Pulsar clients might not set the `batch_size` field in a
batched message id, it will cause `MessageId#fromByteArrayWithTopic`,
which only checks the `batch_index` field, fail with
IllegalStateException.

### Modifications

Check if the `batch_size` field exists in `fromByteArrayWithTopic`. If
it doesn't exist, create the `BatchMessageIdImpl` instance with the
default batch size (0) and the acker (disabled).

Move `MessageIdSerializationTest` to the `pulsar-client` module and add
the `testBatchSizeNotSet` to verify the change works.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant