pulsar-client-php icon indicating copy to clipboard operation
pulsar-client-php copied to clipboard

consumer ack: Negative integers are only supported with GMP or BC (64bit) intextensions.

Open djdance opened this issue 1 year ago • 5 comments

failed to do

$consumer->ack($message);

with error Negative integers are only supported with GMP or BC (64bit) intextensions.

What should I do, what's wrong in the message (or consumer) ? thanks

djdance avatar Mar 16 '23 11:03 djdance

@djdance Hi,

Thanks for your feedback on the Pulsar Client for PHP library. To better understand and address the issue you're experiencing, could you please provide us with the following information:

  • Sample code that reproduces the issue you're encountering.
  • The version of Pulsar that you're using.
  • Details about your runtime environment, including the operating system and PHP version.

ikilobyte avatar Mar 18 '23 05:03 ikilobyte

@djdance Based on the error message you provided, it appears to be an error thrown from protobuf-php/protobuf. The error file can be found at: https://github.com/protobuf-php/protobuf/blob/master/src/Binary/Platform/InvalidNegativeEncoder.php.

You may try installing the GMP extension to see if the issue persists. Alternatively, please provide us with your sample code and environment information. Your feedback will help us improve the library.

Thank you for your cooperation!

ikilobyte avatar Mar 18 '23 06:03 ikilobyte

Thank you, @ikilobyte , but most of all I am interesting in, what's wrong in the message received? In other words, imagine that I can not install GMP/BC. How could I change something on my side or in Pulsar to fix this crash? Change any negative ID in data of a message? Why do I need this Negative integers for ack? may I turn it off without extra libraries and php reinstalling ?

thanks again

djdance avatar Mar 18 '23 08:03 djdance

@djdance Sorry, based on my initial assessment, it appears to be an issue with the protobuf library. In order for me to reproduce the issue, I would need you to provide sample code and Pulsar message IDs. Without this information, I am unable to determine the root cause based solely on the error message.

ikilobyte avatar Mar 18 '23 08:03 ikilobyte

I understand, no problem. Let the message contains the following negative values partition: -1 batch_index: "-1" Could it be the reason?

How can I get rid of any field from the message before ack? I didn't find any function to operate message content..

djdance avatar Mar 18 '23 08:03 djdance