Skip to main content
Circulars over Kafka event name backfill. See news and announcements

Sample Code

GCN utilizes Apache Kafka, an open-source distributed event streaming platform, to stream Notices and Circulars in real time.

GCN Notices provide real-time machine readable alerts and are distributed in different formats:

  • New GCN Notices are provided in JSON format and are streamed via Kafka, with the exception of SVOM notices which are only available via VOEvent over Kafka and email.
  • GCN Classic Notices are provided in text, binary, and VOEvent XML formats, and are distributed both via Kafka and email.

This sample code demonstrates how to handle GCN Notices in both JSON and VOEvent XML formats, and some samples from the FAQs section of the gcn-kafka-python repository.

Working with different GCN Notice Formats

  • Kafka Messages demonstrates how to consume and manage GCN messages using Kafka clients.
  • Plain Text Notices demonstrates how to parse plain text format GCN messages.
  • VOEvent XML Notices provides guidance for interpreting and extracting data from VOEvent XML formatted GCN Notices.
  • JSON Notices presents sample code for processing GCN Notices encoded in JSON format, and instructions for Producers on how to encode FITS files in JSON format Notices.
  • HEALPix Sky Maps explains how to interpret and utilize HEALPix format sky maps included in GCN Notices.

To contribute your own sample code, make a GitHub pull request to add it to the Markdown source for this document, or contact us.

Looking for U.S. government information and services? Visit USA.gov