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

PubSub: Incorrect exception messages for attribute key and value checks #2312

Open
wleese opened this issue Jan 16, 2025 · 0 comments
Open
Assignees
Labels
api: pubsub Issues related to the googleapis/java-pubsub API.

Comments

@wleese
Copy link

wleese commented Jan 16, 2025

I guess this is a backend issue, but reporting here just in case.

The docs state:

Attribute key size: 256 bytes
Attribute value size: 1024 bytes

However attempting to publish a message with a larger key or value size, results in exception messages mentioning length instead.

io.grpc.StatusRuntimeException: INVALID_ARGUMENT: The attribute "�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������" in the request has a key that is too long. The length is 257 characters, but the maximum allowed is 256. Refer to https://cloud.google.com/pubsub/quotas for more information.

Steps to reproduce:

  • Craft a message with an attribute key or value with multibyte characters, with the max allowed length specified in the exception (key=256, value=1024).
  • Observe misleading exceptions
  • Do the same with no non-multibyte characters
  • Observe how the exception is not triggered
@product-auto-label product-auto-label bot added the api: pubsub Issues related to the googleapis/java-pubsub API. label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the googleapis/java-pubsub API.
Projects
None yet
Development

No branches or pull requests

2 participants