Closed StormRyders closed 1 year ago
Describe the bug I am trying to create Pulsar Producer in Python and getting below exception: Exception: Pulsar error: IncompatibleSchema
To Reproduce import pulsar from pulsar import Client, AuthenticationTLS from pulsar.schema import * import jsonschema import json from enum import Enum
class Example(Record): a = String()
auth = AuthenticationTLS("//home/Pulsar-clickstream//canvas.cert.pem", "//home/Pulsar-clickstream//canvas.key-pk8.pem")
client = Client("pulsar+ssl://Pulsar-URL tls_trust_certs_file_path="//home//ca.cert.pem", tls_allow_insecure_connection=False, authentication=auth)
producer = client.create_producer( topic='persistent://my-topic', schema=JsonSchema(Example) )
for i in range(10): producer.send(Example(a=i["user"]["vzid"])).encode('utf-8')
producer.close() client.close()
Expected behavior Message should be sent to the topic and consumer should be able to access it.
Desktop (please complete the following information): -CentOS 7
@StormRyders
pulsar-admin schemas
@StormRyders Any updates?
Closed as no response. No news is good news :)
Describe the bug I am trying to create Pulsar Producer in Python and getting below exception: Exception: Pulsar error: IncompatibleSchema
To Reproduce import pulsar from pulsar import Client, AuthenticationTLS from pulsar.schema import * import jsonschema import json from enum import Enum
class Example(Record): a = String()
set the application specific cert and key file path
auth = AuthenticationTLS("//home/Pulsar-clickstream//canvas.cert.pem", "//home/Pulsar-clickstream//canvas.key-pk8.pem")
Each environment(Rocklin, Branchburg, AWS Non Prod/PLE/STG/PROD has its own service url
The path to tls trust cert file - ca.cert.pem
client = Client("pulsar+ssl://Pulsar-URL tls_trust_certs_file_path="//home//ca.cert.pem", tls_allow_insecure_connection=False, authentication=auth)
producer = client.create_producer( topic='persistent://my-topic', schema=JsonSchema(Example) )
Publish messages to the topic. NOTE: Change the loop as per your requirement
for i in range(10): producer.send(Example(a=i["user"]["vzid"])).encode('utf-8')
print(i["user"]["vzid"])
producer.close() client.close()
Expected behavior Message should be sent to the topic and consumer should be able to access it.
Desktop (please complete the following information): -CentOS 7