Skip to content

Instantly share code, notes, and snippets.

@jungleeforce
Created November 11, 2021 01:55
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 jungleeforce/e9e0308ccec810c86fa92fbc7da96c58 to your computer and use it in GitHub Desktop.
Save jungleeforce/e9e0308ccec810c86fa92fbc7da96c58 to your computer and use it in GitHub Desktop.
Get Topic & Get Schema Id
const topicName = '/event/Your_Custom_event__e';
let schemaId = '';
let schema;
client.GetTopic({ topicName: topicName }, (err, response) => {
if(err) {
//throw error
}else { //get the schema information
schemaId = response.schemaId
client.GetSchema({ schemaId: schemaId }, (error, res) => {
if(error) {
//handle error
}else {
schema = avro.parse(res.schemaJson)
}
})
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment