Skip to content

Instantly share code, notes, and snippets.

@srnagar
Created August 14, 2020 23:07
Show Gist options
  • Save srnagar/34f2ef1fdf90acba28b2b658586ef57e to your computer and use it in GitHub Desktop.
Save srnagar/34f2ef1fdf90acba28b2b658586ef57e to your computer and use it in GitHub Desktop.

EH

employee.avro -> App user will write the json model specification and generate the class Employee class is generated by Avro --> User will do

Send side -- Org Foo (Avro)

Employee bob EHClient -> configured with a serializer and if this serializer

serializer.serialize(bob) --> bytes[]

avroschemaregistryserializer -> bob -> parses the schema out of it -> schema string --> SR Avro SDK

srclient.getSchemaId() from schema registry service using the schema string, schema group, serialization type -> schemaId -- SR client SDK

schemaId.getBytes()[x] + bob.getBytes() -> encoded data that will be sent to the service (EH, Storage) -> dataBody -> SR Avro SDK

new EventData(bytes[])

Org bazz (JSON) Employee bob EHClient -> configured with a serializer and if this serializer

serializer.serialize(bob) --> bytes[]

avroschemaregistryserializer -> bob -> parses the schema out of it -> schema string --> SR Avro SDK

srclient.getSchemaId() from schema registry service using the schema string, schema group, serialization type -> schemaId -- SR client SDK

schemaId.getBytes()[x] + bob.getBytes() -> encoded data that will be sent to the service (EH, Storage) -> dataBody -> SR Avro SDK

new EventData(bytes[])

Org Bar Receive side dataBody -> EH SDK -> user

bob.bytes -> serializer.deserializerAsync(bob.bytes, Employee.class) -> Employee instance -> bob
						--- decode dataBody -> decode() locally schemaId.byte + bob.bytes 

							schemaId -> srclient.getSchema() from sschema registry service to get the full info about this schema which includes
								schema string, schema name, group, type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment