A lightweight, easy-to-use Go binding for RTI Connext DDS that enables rapid development of distributed applications.
- Overview
- Key Features
- Quick Start
- Installation
- Usage Examples
- Platform Support
- Development
- Documentation
- Contributing
- Support
RTI Connector for Connext DDS is a lightweight, easy-to-use API that provides access to the power and functionality of RTI Connext DDS. Built on XML-Based Application Creation and Dynamic Data, it enables rapid prototyping and development of distributed applications.
Originally created by the RTI Research Group for demos and proof-of-concepts, RTI Connector is perfect for developers who need to quickly integrate DDS communication into their Go applications without the complexity of the full RTI Connext DDS Professional SDK.
β¨ Simple API - Easy-to-use Go interface that hides DDS complexity
π Rapid Development - Get up and running with DDS in minutes
π Dynamic Data - No need to generate code from type definitions
π XML Configuration - Define data types and QoS policies declaratively in XML
π Cross-Platform - Supports Linux x64, macOS, and Windows x64
- Go 1.21 or later
- Supported platform (Linux x64, macOS, Windows x64)
- Create a new project directory and initialize a Go module:
mkdir my-rti-project
cd my-rti-project
go mod init my-rti-project
- Get the Go package:
go get github.com/rticommunity/rticonnextdds-connector-go
- Download RTI Connector libraries:
go run github.com/rticommunity/rticonnextdds-connector-go/cmd/download-libs@latest
- Set library path (for runtime):
# macOS (Apple Silicon/ARM64)
export DYLD_LIBRARY_PATH=$(pwd)/rticonnextdds-connector/lib/osx-arm64:$DYLD_LIBRARY_PATH
# macOS (Intel/x86_64)
export DYLD_LIBRARY_PATH=$(pwd)/rticonnextdds-connector/lib/osx-x64:$DYLD_LIBRARY_PATH
# Linux
export LD_LIBRARY_PATH=$(pwd)/rticonnextdds-connector/lib/linux-x64:$LD_LIBRARY_PATH
# Windows (PowerShell)
$env:PATH = "$(pwd)\rticonnextdds-connector\lib\win-x64;$env:PATH"
π‘ macOS Users: Use
osx-arm64
for Apple Silicon Macs (M1/M2/M3) andosx-x64
for Intel Macs. You can check your architecture withuname -m
(arm64 = Apple Silicon, x86_64 = Intel).
π‘ New to RTI Connector Go? Try the go-get-example first - it provides a complete walkthrough of this installation process with a simple working example.
- Create an XML configuration file (
ShapeExample.xml
):
<dds>
<qos_library name="QosLibrary">
<qos_profile name="DefaultProfile" base_name="BuiltinQosLibExp::Generic.StrictReliable" is_default_qos="true"/>
</qos_library>
<types>
<struct name="ShapeType">
<member name="color" type="string" key="true" stringMaxLength="128"/>
<member name="x" type="long"/>
<member name="y" type="long"/>
<member name="shapesize" type="long"/>
</struct>
</types>
<domain_library name="MyDomainLibrary">
<domain name="MyDomain" domain_id="0">
<register_type name="ShapeType" type_ref="ShapeType"/>
<topic name="Square" register_type_ref="ShapeType"/>
</domain>
</domain_library>
<domain_participant_library name="MyParticipantLibrary">
<domain_participant name="Zero" domain_ref="MyDomainLibrary::MyDomain">
<publisher name="MyPublisher">
<data_writer name="MySquareWriter" topic_ref="Square"/>
</publisher>
<subscriber name="MySubscriber">
<data_reader name="MySquareReader" topic_ref="Square"/>
</subscriber>
</domain_participant>
</domain_participant_library>
</dds>
- Create a publisher (
publisher.go
):
package main
import (
"log"
"time"
rti "github.com/rticommunity/rticonnextdds-connector-go"
)
func main() {
// Create connector
connector, err := rti.NewConnector("MyParticipantLibrary::Zero", "./ShapeExample.xml")
if err != nil {
log.Fatal(err)
}
defer connector.Delete()
// Get output (writer)
output, err := connector.GetOutput("MyPublisher::MySquareWriter")
if err != nil {
log.Fatal(err)
}
// Publish data
for i := 0; i < 10; i++ {
output.Instance.SetString("color", "BLUE")
output.Instance.SetInt("x", i*10)
output.Instance.SetInt("y", i*20)
output.Instance.SetInt("shapesize", 30)
output.Write()
log.Printf("Published sample %d", i)
time.Sleep(time.Second)
}
}
- Create a subscriber (
subscriber.go
):
package main
import (
"log"
rti "github.com/rticommunity/rticonnextdds-connector-go"
)
func main() {
// Create connector
connector, err := rti.NewConnector("MyParticipantLibrary::Zero", "./ShapeExample.xml")
if err != nil {
log.Fatal(err)
}
defer connector.Delete()
// Get input (reader)
input, err := connector.GetInput("MySubscriber::MySquareReader")
if err != nil {
log.Fatal(err)
}
// Read data
log.Println("Waiting for data...")
for {
connector.Wait(-1) // Wait indefinitely for data
input.Take()
numSamples, _ := input.Samples.GetLength()
for i := 0; i < numSamples; i++ {
if valid, _ := input.Infos.IsValid(i); valid {
color, _ := input.Samples.GetString(i, "color")
x, _ := input.Samples.GetInt(i, "x")
y, _ := input.Samples.GetInt(i, "y")
shapesize, _ := input.Samples.GetInt(i, "shapesize")
log.Printf("Received: color=%s, x=%d, y=%d, size=%d", color, x, y, shapesize)
}
}
}
}
- Run your application:
Make sure you've completed the installation steps above (including library download and path setup), then:
# Terminal 1 - Start subscriber
go run subscriber.go
# Terminal 2 - Start publisher
go run publisher.go
You should see the subscriber receiving data published by the publisher!
The installation above uses our automated library download tool. For advanced scenarios, see our comprehensive guides:
- Library Management Documentation - Complete guide to library installation options
- Go Get Users Guide - Specific help for
go get
workflow
# Download specific version
go run github.com/rticommunity/rticonnextdds-connector-go/cmd/download-libs@latest -version v1.3.1
# Check what's currently installed
go run github.com/rticommunity/rticonnextdds-connector-go/cmd/download-libs@latest -current
# List available versions
go run github.com/rticommunity/rticonnextdds-connector-go/cmd/download-libs@latest -list
Explore our comprehensive examples to learn different patterns and use cases:
Example | Description | Key Features |
---|---|---|
Simple | Basic publisher/subscriber | Getting started, basic data flow |
Go Get Example | For go get users |
Inline XML, library download workflow |
Shapes Demo | Array data handling | Complex data types, arrays |
JSON Integration | Go struct mapping | JSON serialization, struct binding |
Request-Reply | RPC pattern | Synchronous communication |
Security | Secure communication | Authentication, encryption |
Multiple Files | Modular configuration | XML organization, reusability |
RTI Connector supports the following platforms with automated CI testing:
Platform | Architecture | CI Status |
---|---|---|
Linux | x86_64 | β Tested on Ubuntu 22.04 (ubuntu-latest) |
Linux | ARM64 | β Supported (libraries included) |
macOS | Apple Silicon (ARM64) | β Supported |
macOS | Intel (x86_64) | β Tested on macOS 13 (macos-13) |
Windows | x86_64 | β Tested on Windows Server 2022 (windows-latest) |
π Note: Linux x64, macOS x64, and Windows x64 are continuously tested via GitHub Actions CI. If you need support for additional architectures, please contact your RTI account manager or [email protected].
To check the version of your installed RTI libraries:
go run github.com/rticommunity/rticonnextdds-connector-go/cmd/download-libs@latest -current
For contributors and developers working with the source code:
# Clone and setup
git clone https://github.com/rticommunity/rticonnextdds-connector-go.git
cd rticonnextdds-connector-go
make download-libs
# Run all tests with coverage
make test-local
# Run comprehensive test suite with quality checks
./test_improvements.sh
# Build all packages
go build ./...
# Run static analysis
go vet ./...
# Format code
go fmt ./...
β οΈ Important: The Connector Native API does not implement thread safety. You are responsible for protecting calls to Connector in multi-threaded applications.
The native code was originally designed for single-threaded environments (RTI Prototyper and Lua). While we've added support for Go, Python, and JavaScript, thread safety remains the developer's responsibility.
- οΏ½ API Reference - Complete Go API documentation
- π Examples - Comprehensive examples and tutorials
- π§ͺ Testing Guide - Development and testing guidelines
- π Library Management - Managing RTI Connector libraries
- π Go Get Users Guide - Complete guide for
go get
users - π€ Contributing - How to contribute to the project
We welcome contributions! Here's how to get started:
- π Sign the CLA - Required for all contributions
- π΄ Fork and clone the repository
- π§ Make your changes with tests
- β
Run quality checks:
make test-local
or./test_improvements.sh
- π€ Submit a pull request
All contributions are automatically tested for quality, including:
- Build verification across platforms
- Code linting and formatting
- Comprehensive test suite validation
- Coverage analysis
- π¬ RTI Community Forum - Technical questions and discussions
- π GitHub Issues - Bug reports and feature requests
- π§ Contact RTI - Commercial support and licensing
Ready to get started? Check out our Quick Start guide or explore the examples!