You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
frompulsarimportClient, AuthenticationToken# create an authentication token object with the token stringauth=AuthenticationToken('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjpbXSwiaWF0IjoxNjg3NjMwMjY5LCJleHAiOjE4NDU0NzUxOTksImF1ZCI6IiIsImlzcyI6IiIsInN1YiI6IiJ9.bVKykCNNg4eh3FiiUf69ZkGkyMSN_OrAOJUHS9bP5fg')
# create a pulsar client with the authentication token objectclient=Client('pulsar://127.0.0.1:6650', authentication=auth)
producer=client.create_producer(
topic='persistent://public/default/test',
)
producer.send('demo-msg'.encode('utf-8'))
client.close()
The text was updated successfully, but these errors were encountered:
I see you set up a Pulsar proxy, KoP might not work well with the proxy.
Could you also upload the logs from broker? It seems that we cannot get much useful info from the logs. Maybe you can try connecting to KoP directly first.
I did overlook this point, did not carefully compare the guide and the "sub" field in the token I generated myself, and I think I can use the token in the native pulsar client because I configured anonymousUserRole=admin in the standalone.conf file.
I think I should raise an issue about the "sub" field in the token to pulsar, because they don't seem to describe what rules need to be followed when generating token by self
Problem
When authentication with the PLAIN mechanism, got the error msg: Role cannot be empty
To Reproduce
The producer code:
Screenshots

Configurations
I'm using a standalone broker. (
streamnative/sn-pulsar:2.10.2.4
)There are all the configurations under the
conf
folder:standalone.conf
client.conf
proxy.conf
broker.conf(if needed)
PS
The code I can produce messages:
The text was updated successfully, but these errors were encountered: