Skip to content

A cross-language RPC demo using CORBA to communicate between Java and C++ services.

License

Notifications You must be signed in to change notification settings

canetizen/corba-rpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

corba-rpc-simulation

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.


Repository Structure

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

How It Works

  1. ServiceA starts, registers itself with the CORBA Naming Service, and tries to find ServiceB.
  2. ServiceB registers itself and waits for calls to its doTaskB method.
  3. ServiceA sends a long text string to ServiceB.
  4. ServiceB removes all vowels from the string and returns the result.
  5. ServiceA prints the processed response.

The entire communication is defined by the CorbaSim.idl file and does not use HTTP, REST, or web servers.


How to Build and Run

From the root of the project:

docker compose up --build

This 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 build

To stop and clean up:

docker compose down

System Requirements

  • Docker and Docker Compose
  • No local installation of Java or C++ compilers required

Notes

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

About

A cross-language RPC demo using CORBA to communicate between Java and C++ services.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published