Skip to content

feat/ffi/kotlin#95

Merged
qzhuyan merged 11 commits intomainfrom
feat/ffi/kotlin
Apr 12, 2026
Merged

feat/ffi/kotlin#95
qzhuyan merged 11 commits intomainfrom
feat/ffi/kotlin

Conversation

@qzhuyan
Copy link
Copy Markdown
Collaborator

@qzhuyan qzhuyan commented Apr 7, 2026

Description

Kotlin FFI support and example code also support dumping TLS keylogfile for troubleshooting in other FFIs
Fixes #(issue)

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 62.50000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.90%. Comparing base (722f1d9) to head (57d5f59).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
flowsdk_ffi/src/engine.rs 60.00% 4 Missing ⚠️
src/mqtt_client/engine.rs 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #95      +/-   ##
==========================================
+ Coverage   74.78%   76.90%   +2.11%     
==========================================
  Files          63       66       +3     
  Lines       15062    17065    +2003     
==========================================
+ Hits        11264    13123    +1859     
- Misses       3798     3942     +144     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread .github/workflows/ci.yml Fixed
…ith coroutines

- Created a new QUIC client example in
- Updated `simple_client` to utilize Kotlin coroutines for asynchronous event handling
qzhuyan added 4 commits April 7, 2026 21:38
- Add enable_key_log field to MqttTlsOptionsFFI for TLS key logging
- Wire enable_key_log through Kotlin/C FFI bindings (enableKeyLog)
- Enable rustls::KeyLogFile when enable_key_log is true
- Set QUIC max_idle_timeout to 120 seconds to prevent premature
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces Kotlin/UniFFI support for the FlowSDK FFI layer and adds TLS key logging support across bindings, along with a QUIC transport tweak to reduce premature idle timeouts.

Changes:

  • Add Kotlin Gradle multi-module project (package + TCP/QUIC examples) plus CI job and build script to generate/build Kotlin bindings.
  • Extend TLS options in the FFI (Rust + Python + C examples) to support optional TLS key logging (Wireshark via SSLKEYLOGFILE).
  • Set a QUIC max_idle_timeout in the Rust QUIC MQTT engine transport config.

Reviewed changes

Copilot reviewed 21 out of 24 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/mqtt_client/engine.rs Configures QUIC transport idle timeout to better align with MQTT keepalive behavior.
scripts/build_kotlin_bindings.sh Adds a helper script to build the FFI library (QUIC feature) and generate Kotlin bindings, then build Gradle modules.
python/package/flowsdk/async_client.py Plumbs enable_key_log through Python async client into FFI TLS options.
python/examples/asyncio_tls_client_example.py Enables TLS key logging in the example based on SSLKEYLOGFILE.
python/examples/asyncio_quic_client_example.py Documents and enables TLS key logging in the QUIC example based on SSLKEYLOGFILE.
kotlin/settings.gradle.kts Declares Kotlin multi-module build (package + examples).
kotlin/package/build.gradle.kts Defines Kotlin package module with JNA dependency and Java toolchain settings.
kotlin/gradlew.bat Adds Gradle wrapper for Windows.
kotlin/gradlew Adds Gradle wrapper for POSIX.
kotlin/gradle/wrapper/gradle-wrapper.properties Configures Gradle wrapper distribution (8.7).
kotlin/gradle/wrapper/gradle-wrapper.jar Adds Gradle wrapper JAR.
kotlin/examples/simple_client/src/main/kotlin/Main.kt Adds a TCP MQTT example using the Kotlin FFI bindings.
kotlin/examples/simple_client/build.gradle.kts Adds Gradle config for the TCP example module.
kotlin/examples/quic_client/src/main/kotlin/Main.kt Adds a QUIC MQTT example using Kotlin FFI bindings and TLS options.
kotlin/examples/quic_client/README.md Documents building/running the QUIC Kotlin example and TLS key logging.
kotlin/examples/quic_client/build.gradle.kts Adds Gradle config for the QUIC example module.
kotlin/build.gradle.kts Adds root Kotlin build config and Kotlin plugin version.
flowsdk_ffi/src/engine/ffi_types.rs Extends MqttTlsOptionsFFI with enable_key_log.
flowsdk_ffi/src/engine.rs Implements TLS key log enabling in Rustls configs for TLS and QUIC engines; wires through C options.
examples/c_ffi_example/tls_main.c Enables TLS key logging in the C TLS example when SSLKEYLOGFILE is set.
examples/c_ffi_example/quic_main.c Enables TLS key logging in the C QUIC example when SSLKEYLOGFILE is set.
.gitignore Adds ignores for Kotlin build artifacts and TLS keylog files.
.github/workflows/ci.yml Adds Kotlin bindings CI job and pins Rust toolchain action to a commit SHA in several jobs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/mqtt_client/engine.rs Outdated
Comment thread kotlin/examples/quic_client/src/main/kotlin/Main.kt Outdated
@qzhuyan qzhuyan marked this pull request as ready for review April 10, 2026 08:47
@qzhuyan qzhuyan merged commit 5b755ac into main Apr 12, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants