Skip to content

Instantly share code, notes, and snippets.

@jungleeforce
Created Nov 11, 2021
Embed
What would you like to do?
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