StevenLuMT commented on code in PR #8: URL: https://github.com/apache/pulsar-java-contrib/pull/8#discussion_r1797520951
########## pcip/pcip-1.md: ########## @@ -0,0 +1,552 @@ +# PCIP-1: Distributed RPC framework implemented by the Pulsar client + +# Background knowledge + +## Request-Reply Synchronize Model + +In this model, the client sends a request and waits for a response from the server. The server receives the request, processes it, and sends back a response. This interaction pattern is fundamental in client-server communication and is crucial for synchronous operations where the client needs a response before proceeding. + +## Remote Procedure Call (RPC) + +RPC allows functions or procedures to be executed on a different machine from the client making the call, as if they were local. This method abstracts the complexities of network communication, allowing developers to focus on the business logic rather than the underlying network details. + +The implementation of RPC is usually based on the Request-Reply model. In this case: + +- The RPC client plays the role of the requester, calling a remote procedure as if it were sending a request message. +- The RPC server plays the role of the responder, receiving the request, executing the procedure, and returning the result as a reply message. + +## Current behavior of sending messages in Pulsar + +The current sending behavior of Pulsar is when the message is successfully published, that is, successfully persisted to the storage layer. The MessageId assigned to the published message by the broker is returned. + +## Analogies of message flow in RPC and Pulsar + +- In Pulsar, producer is equivalent to RPC Client. +- The RPC Client initiates a request like sending a message producer. +- The RPC Server side receives this request as if the consumer receives the message and then carries out customized processing, and finally ACKs the message. +- If this ACK request contains the result returned by the "server side" and is sent to the original producer(RPC Client). +- After receiving the results returned by the consumer(RPC Server), the producer(RPC Client) directly returns the content of the results. + +# Motivation + Review Comment: Can you post [the structure picture](https://github.com/apache/pulsar-java-contrib/pull/6) here? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
