One of the nicest things about OKafka is how familiar it feels if you’ve used Kafka before. You configure connections with Properties objects, just like kafka-clients. The big difference? You’re talking directly to Oracle Database Transactional Event Queues instead of a separate broker.
Here’s how to set up authentication cleanly for development and production.
Two Main Authentication Paths
1. PLAINTEXT (Great for Local Dev)
Simple username/password setup using an ojdbc.properties file:
Properties props = new Properties();
props.put("security.protocol", "PLAINTEXT");
props.put("bootstrap.servers", "your-host:port");
props.put("oracle.service.name", "your_service_name");
props.put("oracle.net.tns_admin", "/path/to/config/dir");
Your ojdbc.properties file should contain:
user=testuser
password=YourStrongPassword123
2. SSL / mTLS (Production Ready)
Use Oracle Wallet for secure connections. Point to your wallet directory and specify the TNS alias:
props.put("security.protocol", "SSL");
props.put("oracle.net.tns_admin", "/path/to/wallet");
props.put("tns.alias", "your_tns_alias");
Full Working Example
Here’s a complete snippet to create an AdminClient and make a topic:
try (Admin admin = AdminClient.create(props)) {
NewTopic topic = new NewTopic("MY_EVENTS", 5, (short) 0);
admin.createTopics(Collections.singletonList(topic)).all().get();
System.out.println("Topic created successfully");
}
Pro Tips for Smooth Sailing
- Always use uppercase topic names with OKafka
- Store wallet files securely and never commit them to version control
- Test with Oracle Database Free + Testcontainers for quick iterations
- Move to mTLS early in your development cycle
Final Thoughts
OKafka makes connecting to Oracle feel just like connecting to any other Kafka cluster — but you get all the power, security, and transactional guarantees of the database built right in.
No extra infrastructure. No separate cluster to manage. Just reliable event streaming where your data already lives.