You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/08/21 15:47:56 UTC
[GitHub] [pulsar] StormRyders opened a new issue #5003: Python - Exception:
Pulsar error: IncompatibleSchema when trying to send message to Pulsar Topic
StormRyders opened a new issue #5003: Python - Exception: Pulsar error: IncompatibleSchema when trying to send message to Pulsar Topic
URL: https://github.com/apache/pulsar/issues/5003
**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
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services