rtpstalk
CONTENT
Overview
rtpstalk is a pure Java RTPS (Real-time Publish-Subscribe) protocol implementation.
It is compliant with RTPS Specification 2.3:
- implements all its general requirements (section 8.4.2.1)
- RTPS Reader and Writer behavior with following QoS policies:
- PID_DURABILITY (VOLATILE_DURABILITY_QOS, TRANSIENT_LOCAL_DURABILITY_QOS)
- PID_RELIABILITY (RELIABLE)
- UDP as underlying transport protocol
Because RTPS protocol is about Publish-Subscribe interactions rtpstalk implements Java Flow API and allows users to interact with RTPS protocol through it. Java Flow API was introduced in Java 9 and it is recommended to get familiar with it to get better understanding of rtpstalk.
rtpstalk integrated with OpenTelemetry and emits different predefined metrics which help to monitor its health and performance.
DDS
rtpstalk does not implement DDS (Data-Distribution Service) itself instead it provides RTPS wire-protocol that closely match DDS requirements and can be used by DDS.
Java implementation
Some RTPS Java libraries claim to be "pure" Java libraries but when you look inside of them you find that they are merely wrappers around some native library like Fast RTPS, OpenDDS etc.
On one hand it is good since those native libraries implement all features of RTPS and so making Java wrapper around them brings all those features to Java.
On the other hand such Java wrappers have following problems:
- They are constraint by native libraries they use and cannot utilize Java features. For example if native library uses blocking IO and requires one thread per connection you would not be able to change that. Even though Java provides Async IO and virtual threads which can be effectively used for handling connections. But you will not be able to apply those since all connections are handled in native side.
- If native library crashes (due to segmentation fault or coredump) most likely it will crash JVM (and your application as well) and not just throw an exception which you can catch
- Most of Java wrappers still use JNI in one way or another. One major issue with JNI is that it is slow
- Native libraries are not crossplatform. If you are planning to run your code in ARM architecture, for example, you would have to make sure that there are binaries of native library for it. Same applies for any OS.
- Debugging becomes very difficult. Not just because now your would have to use two debuggers (one for Java and another for native code) but also because you would need to make sure that native library was compiled with debug support and it has debug symbols present.
rtpstalk is fully implemented in Java and does not require additional native libraries for it to work.
Requirements
Tested environments
rtpstalk was tested under following environments:
OS:
- Ubuntu 20.04.3 LTS
- Windows 10
- Android 14 (no need to root the phone or make split apks per each architecture)
RTPS implementations:
It is possible that rtpstalk works on other environments too except they were not tested yet.
Documentation
Links