This project demonstrates a simple cross-language Remote Procedure Call (RPC) interaction using CORBA (Common Object Request Broker Architecture), a standard defined by the Object Management Group (OMG) for enabling communication between objects written in different programming languages and running on different platforms.
CORBA enables distributed systems to invoke methods on remote objects as if they were local, using a platform-neutral Interface Definition Language (IDL) to define object interfaces. Under the hood, it handles all the complexities of marshalling, communication, and broker-based discovery.
In this project, two services interact:
- ServiceA (implemented in Java) sends a text string to another service.
- ServiceB (implemented in C++) receives the string, removes all vowels, and returns the modified string to ServiceA.
The services communicate through CORBA interfaces generated from a shared IDL file, and all object discovery and invocation are mediated by a CORBA Naming Service.
Although CORBA is considered a legacy solution today, it is still well-suited for demonstrating the core principles of remote procedure calls (RPC) across languages and platforms. It provides a standardized, low-level mechanism for interface-based communication without relying on HTTP, REST, or web technologies — making it ideal for understanding foundational distributed system design.
corba-rpc-simulation/
├── docker-compose.yml # Defines all containers and networking
├── shared/
│ └── CorbaSim.idl # IDL file defining service interfaces and data structures
├── service_a_java/
│ ├── Dockerfile # Builds the Java 8 service container
│ ├── run.sh # Entrypoint for Java service
│ ├── pom.xml # Maven configuration with OpenORB dependencies
│ └── src/
│ └── main/java/com/github/canetizen/corba/
│ ├── ServiceAMain.java # Main class for ORB init and service registration
│ └── ServiceAImpl.java # Implementation of ServiceA interface
├── service_b_cpp/
│ ├── Dockerfile # Builds the C++ service with omniORB
│ ├── run.sh # Entrypoint for C++ service
│ ├── CMakeLists.txt # CMake configuration for building ServiceB
│ └── service_b.cpp # Implementation of ServiceB interface
ServiceAstarts, registers itself with the CORBA Naming Service, and tries to findServiceB.ServiceBregisters itself and waits for calls to itsdoTaskBmethod.ServiceAsends a long text string toServiceB.ServiceBremoves all vowels from the string and returns the result.ServiceAprints the processed response.
The entire communication is defined by the CorbaSim.idl file and does not use HTTP, REST, or web servers.
From the root of the project:
docker compose up --buildThis command will:
- Start the CORBA Naming Service
- Build and start the Java-based ServiceA
- Build and start the C++-based ServiceB
- Trigger an example request from A to B and print the result in ServiceA's logs
To rebuild after code changes:
docker compose buildTo stop and clean up:
docker compose down- Docker and Docker Compose
- No local installation of Java or C++ compilers required
This project uses:
- OpenORB for the Java-based CORBA runtime (Java 8)
- omniORB for the C++ CORBA runtime
- A shared Docker network to allow seamless service discovery and invocation