Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Coverage Go Report Card

RTI Connector for Connext DDS

RTI Connector for Connext DDS is a quick and easy way to access the power and functionality of RTI Connext DDS. It is based on XML-Based Application Creation and Dynamic Data.

Connector was created by the RTI Research Group to quickly and easily develop demos and proofs of concept. It can be useful for anybody that needs a quick way to develop an application communicating over the Connext DDS Databus. Thanks to the binding with multiple programming languages, you can integrate with many other available technologies.

The Connector library is provided in binary form for select architectures. Language bindings and examples are provided in source format.

Go Connector leverages cgo to call its C library; this detail is hidden in a Go wrapper.


Simple Reader

package main
import (
	rti ""

func main() {
	connector, err := rti.NewConnector("MyParticipantLibrary::Zero", "./ShapeExample.xml")
	if err != nil {
	defer connector.Delete()
	input, err := connector.GetInput("MySubscriber::MySquareReader")
	if err != nil {

	for {
		numOfSamples, _ := input.Samples.GetLength()
		for j := 0; j < numOfSamples; j++ {
			valid, _ := input.Infos.IsValid(j)
			if valid {
				json, err := input.Samples.GetJSON(j)
				if err != nil {
				} else {

Simple Writer

package main
import (

func main() {
	// Create a connector defined in the XML configuration
	connector, err := rti.NewConnector("MyParticipantLibrary::Zero", "./ShapeExample.xml")
	if err != nil {
	// Delete the connector when this main function returns
	defer connector.Delete()

	// Get an output from the connector
	output, err := connector.GetOutput("MyPublisher::MySquareWriter")
	if err != nil {

	// Set values to the instance and write the instance
	for i := 0; i < 10; i++ {
		output.Instance.SetInt("x", i)
		output.Instance.SetInt("y", i*2)
		output.Instance.SetInt("shapesize", 30)
		output.Instance.SetString("color", "BLUE")
		time.Sleep(time.Second * 1)

XML Configurations

  <!-- Qos Library -->
  <qos_library name="QosLibrary">
    <qos_profile name="DefaultProfile" base_name="BuiltinQosLibExp::Generic.StrictReliable" is_default_qos="true">
          <mask>UDPV4 | SHMEM</mask>
  <!-- types -->
    <struct name="ShapeType" extensibility="extensible">
      <member name="color" stringMaxLength="128" id="0" type="string" key="true"/>
      <member name="x" id="1" type="long"/>
      <member name="y" id="2" type="long"/>
      <member name="shapesize" id="3" type="long"/>
    <enum name="ShapeFillKind" extensibility="extensible">
      <enumerator name="SOLID_FILL" value="0"/>
      <enumerator name="TRANSPARENT_FILL" value="1"/>
      <enumerator name="HORIZONTAL_HATCH_FILL" value="2"/>
      <enumerator name="VERTICAL_HATCH_FILL" value="3"/>
    <struct name="ShapeTypeExtended" baseType="ShapeType" extensibility="extensible">
      <member name="fillKind" id="4" type="nonBasic" nonBasicTypeName="ShapeFillKind"/>
      <member name="angle" id="5" type="float"/>
  <!-- Domain Library -->
  <domain_library name="MyDomainLibrary">
    <domain name="MyDomain" domain_id="0">
      <register_type name="ShapeType" type_ref="ShapeType"/>
      <topic name="Square" register_type_ref="ShapeType"/>
  <!-- Participant library -->
  <domain_participant_library name="MyParticipantLibrary">
    <domain_participant name="Zero" domain_ref="MyDomainLibrary::MyDomain">
      <publisher name="MyPublisher">
        <data_writer name="MySquareWriter" topic_ref="Square"/>
      <subscriber name="MySubscriber">
        <data_reader name="MySquareReader" topic_ref="Square"/>

Please see examples for usage details.

Getting started

Using Go Modules

Be sure you have golang installed (we tested with golang v1.17).


import ""


$ go build reader.go

A dependency to the latest stable version of rticonnextdds-connector-go should be automatically added to your go.mod file.


To run your application, you need to add the Connector C library to your library path.

$ export LD_LIBRARY_PATH=$GOPATH//go/pkg/mod/\@{version}-{YYYYMMDDHHmm}-{commit_id}/rticonnextdds-connector/lib/linux-x64:$LD_LIBRARY_PATH
$ ./simple_reader

Platform support

Go Connector builds its library for few select architectures. If you need another architecture, please contact your RTI account manager or

If you want to check the version of the libraries you can run the following command:

strings ./rticonnextdds-connector/lib/linux-x64/ | grep BUILD

Threading model

The Connector Native API does not yet implement any mechanism for thread safety. Originally, the Connector native code was built to work with RTI Prototyper and Lua. That was a single-threaded loop. RTI then introduced support for JavaScript, Python, and Go. For now, you are responsible for protecting calls to Connector. Thread safety may be implemented in the future.


Connector is an experimental RTI product. If you have questions, please use the RTI Community Forum. If you would like to report a bug or have a feature request, please create an issue.


The best way to get started with Connector is to look at the examples; you will see that it is very easy to use.


Contributions to the code, examples, documentation are really appreciated. Please follow the steps below for contributions.

  1. Sign the CLA.
  2. Create a fork and make your changes.
  3. Run tests and linters (make test lint).
  4. Push your branch.
  5. Open a new pull request.


RTI Connector for Connext DDS is a lightweight technology that enables DDS data to be accessed with Go.








No packages published