Kafka
This document explains how to subscribe to {blockchain} transactions using Kafka, ensuring a consistent data stream.
Subscription Overview
Both Kafka and WebSocket use the same topic structure to ensure consistency. The topic format follows:
Topic For example:
{blockchain}.broadcast.transactions
→solana.broadcast.transactions
Kafka Subscription Process
The complete steps for subscribing to {blockchain} transactions in Kafka are as follows:
Create Kafka Configuration
Set the
bootstrap.servers
addressConfigure security authentication (SASL/SSL)
Specify the
group.id
to ensure consumer group management
Subscribe to {blockchain} Transaction Topics
Topic format:
solana.broadcast.transactions
Start Consuming Data
Poll Kafka for the latest transaction data
Parse and process transaction information
Data Processing Logic
Record key information such as transaction hash, sender, receiver, and amount
Configuration
BOOTSTRAP_SERVERS_CONFIG
"kf01.saturnx.dev:9093"
Kafka broker address
GROUP_ID_CONFIG
"consumer-group-1"
Consumer group name
AUTO_OFFSET_RESET_CONFIG
"latest"
Starts consuming from the latest record
security.protocol
"SASL_SSL"
Enables secure authentication
sasl.mechanism
"PLAIN"
Authentication method
sasl.jaas.config
"username="" password="";"
User credentials for authentication
ssl.truststore.location
"kafka.truststore.jks"
Truststore file for SSL verification
ssl.truststore.password
"96286190"
Password for the truststore
Last updated