nicolo-paganin commented on issue #5454: mysql JDBC Sink - consumer error
URL: https://github.com/apache/pulsar/issues/5454#issuecomment-586977506
 
 
   @sijie @tuteng following the results of some test, I found out a 
configuration that is working
   
   These are the tests I did modifying params in the consumer creations:
   
   1. If I enable the batching and the schema is set (the value that I am 
sending is an instance of the class `SensorSchema`): **does not work**
   2. If I remove the schema setting and I disable the batching (the value that 
I am sending is a bytestring encoded with fastavro): **does not work**
   3. if I set the schema and disable the batching (the value that I am sending 
is an instance of the class `SensorSchema`):  **it works.**
   
   This is the function that I modified in this file 
`apache-pulsar-2.5.0/instances/python-instance/python_instance.py`
   
   ```python
   def setup_producer(self, schema):
           if self.instance_config.function_details.sink.topic != None and \
                   len(self.instance_config.function_details.sink.topic) > 0:
               self.producer = self.pulsar_client.create_producer(
                   str(self.instance_config.function_details.sink.topic),
                   schema=schema,
                   block_if_queue_full=True,
                   # batching_enabled=True,
                   # batching_max_publish_delay_ms=10,
                   compression_type=pulsar.CompressionType.LZ4,
                   # set send timeout to be infinity to prevent potential 
deadlock with consumer
                   # that might happen when consumer is blocked due to unacked 
messages
                   send_timeout_millis=0,
                   
properties=util.get_properties(util.getFullyQualifiedFunctionName(
                       self.instance_config.function_details.tenant,
                       self.instance_config.function_details.namespace,
                       self.instance_config.function_details.name),
                       self.instance_config.instance_id)
               )
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to