Skip to content

Instantly share code, notes, and snippets.

@cdbartholomew
Created November 9, 2019 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdbartholomew/cc48a5a29491e7e711455cccd5b2bb01 to your computer and use it in GitHub Desktop.
Save cdbartholomew/cc48a5a29491e7e711455cccd5b2bb01 to your computer and use it in GitHub Desktop.
import pulsar
service_url = 'pulsar+ssl://uscentral1.azure.kafkaesque.io:6651'
trust_certs='/etc/ssl/certs/ca-bundle.crt'
token='***************************************************************************'
client = pulsar.Client(service_url,
authentication=pulsar.AuthenticationToken(token),
tls_trust_certs_file_path=trust_certs)
producer = client.create_producer('persistent://azure-kafkaesque-io/local-uscentral1-azure/subscription-demo')
for i in range(6):
producer.send(('Hello World! %d' % i).encode('utf-8'))
client.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment