>
+@enduml
\ No newline at end of file
diff --git a/remote-procedure-invocation/pom.xml b/remote-procedure-invocation/pom.xml
new file mode 100644
index 000000000000..22191d197815
--- /dev/null
+++ b/remote-procedure-invocation/pom.xml
@@ -0,0 +1,71 @@
+
+
+
+ 4.0.0
+
+ com.iluwatar
+ java-design-patterns
+ 1.26.0-SNAPSHOT
+
+ remote-procedure-invocation
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
+ test
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+
+
+
+
+
+ com.iluwatar.rpi.App
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/remote-procedure-invocation/src/main/java/com/iluwatar/rpi/App.java b/remote-procedure-invocation/src/main/java/com/iluwatar/rpi/App.java
new file mode 100644
index 000000000000..2026ca4808f4
--- /dev/null
+++ b/remote-procedure-invocation/src/main/java/com/iluwatar/rpi/App.java
@@ -0,0 +1,60 @@
+/*
+ * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt).
+ *
+ * The MIT License
+ * Copyright © 2014-2022 Ilkka Seppälä
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+package com.iluwatar.rpi;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * Remote Procedure Invocation (RPI) is a communication pattern used in microservices architectures
+ * where a client sends a synchronous request to a service and waits for a response. Unlike
+ * message-based communication, RPI uses a direct request/reply protocol — typically REST over HTTP.
+ *
+ * In this example, the {@link RpiService} exposes a REST endpoint that returns a greeting
+ * message. The {@link RpiClient} uses Spring's {@link org.springframework.web.client.RestTemplate}
+ * to make a synchronous HTTP GET call to the service and retrieve the response.
+ *
+ *
Key characteristics of RPI:
+ *
+ *
+ * - Synchronous communication — the client blocks until the response arrives.
+ *
- Simple and familiar — leverages standard HTTP/REST protocols.
+ *
- No intermediate broker — direct client-to-service communication.
+ *
- Both client and service must be available at the time of the call (tight runtime coupling).
+ *
+ *
+ * @see RPI Pattern
+ */
+@SpringBootApplication
+public class App {
+
+ /** Program entry point. */
+ public static void main(String[] args) {
+ var context = SpringApplication.run(App.class, args);
+ if (args.length > 0 && "test".equals(args[0])) {
+ context.close();
+ }
+ }
+}
\ No newline at end of file
diff --git a/remote-procedure-invocation/src/main/java/com/iluwatar/rpi/RpiClient.java b/remote-procedure-invocation/src/main/java/com/iluwatar/rpi/RpiClient.java
new file mode 100644
index 000000000000..390c98fcddd9
--- /dev/null
+++ b/remote-procedure-invocation/src/main/java/com/iluwatar/rpi/RpiClient.java
@@ -0,0 +1,65 @@
+/*
+ * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt).
+ *
+ * The MIT License
+ * Copyright © 2014-2022 Ilkka Seppälä
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+package com.iluwatar.rpi;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * The client-side component of the RPI pattern. Uses {@link RestTemplate} to make a synchronous
+ * HTTP GET request to the remote {@link RpiService} and returns the response. This demonstrates the
+ * core of RPI — a client blocking on a remote call and waiting for the result.
+ */
+@Slf4j
+public class RpiClient {
+
+ private final RestTemplate restTemplate;
+ private final String baseUrl;
+
+ /**
+ * Creates a new RpiClient.
+ *
+ * @param restTemplate the RestTemplate used to perform HTTP calls
+ * @param baseUrl the base URL of the remote service (e.g. "http://localhost:8080")
+ */
+ public RpiClient(RestTemplate restTemplate, String baseUrl) {
+ this.restTemplate = restTemplate;
+ this.baseUrl = baseUrl;
+ }
+
+ /**
+ * Invokes the remote greeting service with the given name.
+ *
+ * @param name the name to send to the remote service
+ * @return the greeting response from the service
+ */
+ public String greet(String name) {
+ var url = baseUrl + "/greet?name=" + name;
+ LOGGER.info("Calling remote service: {}", url);
+ var response = restTemplate.getForObject(url, String.class);
+ LOGGER.info("Received response: {}", response);
+ return response;
+ }
+}
\ No newline at end of file
diff --git a/remote-procedure-invocation/src/main/java/com/iluwatar/rpi/RpiService.java b/remote-procedure-invocation/src/main/java/com/iluwatar/rpi/RpiService.java
new file mode 100644
index 000000000000..b7116dce365c
--- /dev/null
+++ b/remote-procedure-invocation/src/main/java/com/iluwatar/rpi/RpiService.java
@@ -0,0 +1,49 @@
+/*
+ * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt).
+ *
+ * The MIT License
+ * Copyright © 2014-2022 Ilkka Seppälä
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+package com.iluwatar.rpi;
+
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * The server-side component of the RPI pattern. This REST controller exposes an endpoint that
+ * accepts a name parameter and returns a greeting string. It represents the service that clients
+ * invoke remotely using a request/reply protocol.
+ */
+@RestController
+public class RpiService {
+
+ /**
+ * Returns a greeting message for the given name.
+ *
+ * @param name the name to greet
+ * @return a greeting string
+ */
+ @GetMapping("/greet")
+ public String greet(@RequestParam(defaultValue = "World") String name) {
+ return "Hello, " + name + "!";
+ }
+}
\ No newline at end of file
diff --git a/remote-procedure-invocation/src/test/java/com/iluwatar/rpi/AppTest.java b/remote-procedure-invocation/src/test/java/com/iluwatar/rpi/AppTest.java
new file mode 100644
index 000000000000..240992c1d85c
--- /dev/null
+++ b/remote-procedure-invocation/src/test/java/com/iluwatar/rpi/AppTest.java
@@ -0,0 +1,89 @@
+/*
+ * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt).
+ *
+ * The MIT License
+ * Copyright © 2014-2022 Ilkka Seppälä
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package com.iluwatar.rpi;
+
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.web.client.TestRestTemplate;
+import org.springframework.boot.test.web.server.LocalServerPort;
+
+/**
+ * Tests for the Remote Procedure Invocation pattern.
+ */
+@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+class AppTest {
+
+ @LocalServerPort
+ private int port;
+
+ @Autowired
+ private TestRestTemplate testRestTemplate;
+
+ /**
+ * Verify that the application starts without exception.
+ */
+ @Test
+ void shouldExecuteApplicationWithoutException() {
+ assertDoesNotThrow(() -> App.main(new String[] {"test"}));
+ }
+
+ /**
+ * Verify that the /greet endpoint returns a greeting with default name.
+ */
+ @Test
+ void shouldReturnDefaultGreeting() {
+ var response =
+ testRestTemplate.getForObject("http://localhost:" + port + "/greet", String.class);
+ assertEquals("Hello, World!", response);
+ }
+
+ /**
+ * Verify that the /greet endpoint returns a greeting with a custom name.
+ */
+ @Test
+ void shouldReturnCustomGreeting() {
+ var response =
+ testRestTemplate.getForObject(
+ "http://localhost:" + port + "/greet?name=Java", String.class);
+ assertEquals("Hello, Java!", response);
+ }
+
+ /**
+ * Verify that the RpiClient correctly calls the service and receives a response.
+ */
+ @Test
+ void shouldClientReceiveGreetingFromService() {
+ var client =
+ new RpiClient(
+ testRestTemplate.getRestTemplate(), "http://localhost:" + port);
+ var result = client.greet("RPI");
+ assertEquals("Hello, RPI!", result);
+ }
+}
\ No newline at end of file
diff --git a/remote-procedure-invocation/src/test/java/com/iluwatar/rpi/RpiClientTest.java b/remote-procedure-invocation/src/test/java/com/iluwatar/rpi/RpiClientTest.java
new file mode 100644
index 000000000000..cd4efad857c2
--- /dev/null
+++ b/remote-procedure-invocation/src/test/java/com/iluwatar/rpi/RpiClientTest.java
@@ -0,0 +1,53 @@
+/*
+ * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt).
+ *
+ * The MIT License
+ * Copyright © 2014-2022 Ilkka Seppälä
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+package com.iluwatar.rpi;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.mockito.Mockito.when;
+
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.junit.jupiter.MockitoExtension;
+import org.springframework.web.client.RestTemplate;
+
+/** Unit tests for {@link RpiClient} using a mocked {@link RestTemplate}. */
+@ExtendWith(MockitoExtension.class)
+class RpiClientTest {
+
+ @Mock private RestTemplate restTemplate;
+
+ @Test
+ void shouldReturnGreetingFromRemoteService() {
+ var baseUrl = "http://localhost:8080";
+ var client = new RpiClient(restTemplate, baseUrl);
+
+ when(restTemplate.getForObject(baseUrl + "/greet?name=Alice", String.class))
+ .thenReturn("Hello, Alice!");
+
+ var result = client.greet("Alice");
+ assertEquals("Hello, Alice!", result);
+ }
+}
\ No newline at end of file
diff --git a/remote-procedure-invocation/src/test/java/com/iluwatar/rpi/RpiServiceTest.java b/remote-procedure-invocation/src/test/java/com/iluwatar/rpi/RpiServiceTest.java
new file mode 100644
index 000000000000..4f4e42072640
--- /dev/null
+++ b/remote-procedure-invocation/src/test/java/com/iluwatar/rpi/RpiServiceTest.java
@@ -0,0 +1,45 @@
+/*
+ * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt).
+ *
+ * The MIT License
+ * Copyright © 2014-2022 Ilkka Seppälä
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+package com.iluwatar.rpi;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.jupiter.api.Test;
+
+/** Unit tests for {@link RpiService}. */
+class RpiServiceTest {
+
+ private final RpiService service = new RpiService();
+
+ @Test
+ void shouldGreetWithGivenName() {
+ assertEquals("Hello, Alice!", service.greet("Alice"));
+ }
+
+ @Test
+ void shouldGreetWithDefaultName() {
+ assertEquals("Hello, World!", service.greet("World"));
+ }
+}
\ No newline at end of file