Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uPClient Interface (uP-L2) #129

Closed
stevenhartley opened this issue May 2, 2024 · 2 comments
Closed

uPClient Interface (uP-L2) #129

stevenhartley opened this issue May 2, 2024 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@stevenhartley
Copy link
Contributor

We have now concluded clear interface and data model definitions for the transport layer (Layer 1) with UUri, UAttributes, UPayload, UMessage and UTransport.

The purpose of Layer 2 in the uProtocol stack is to handle the communication patterns for RPC, pub/sub, and notifications however all we had so far is RpcClient for client-side RPC but there is no interface for server-side RPC, pub/sub, and notifications. uSubscription has been defined at L3 as it defines the protobuf messages that are sent between client and server (inside UPayload of a UMessage).

After creating numerous implementations of uProtocol across 5 different programming languages, we've noticed that no 2 L2 interfaces for the communication patterns are defined the same as each programmer would like to leverage language specific features like Flows for Kotlin, or certain traits in Rust.

The purpose of this issue shall be to provide a place to discuss and propose the minimum requirements for what uP-L2 client facing APIs should be extending/clarifying what is in https://github.com/eclipse-uprotocol/up-spec/tree/main/up-l2 and https://github.com/eclipse-uprotocol/up-spec/blob/main/upclient.adoc. Depending on the feedback for the proposal below, the contents of up-l1 folder and upclient.adoc will be updated.

NOTE: uP-L1 interfaces implements the core uProtocol (across the communication middlewares) and uP-L2 API are the client-facing APIs that wrap the transport functionality into easy to use APIs to do the most common functionality of the protocol (subscribe, publish, notify, invoke a Method, or handle RPC requests).

UPClient API

Below lists the high level APIs and their purpose that will be implemented per programming language. The signature of said APIs are left up to the language library implementer to define.

API Name Pattern Description
subscribe() pub/sub Subscribe to a given topic (regardless of the location of the publisher). API must be able to optimally receive the message (ex. passing UListener for handling in a callback)
publish() pub/sub Publish to a given topic a message
notify() Notification Send a notification message to a given topic
invoke_method() RPC Client-side API for RPC to send a request and receive a reply
register_method_listener() RPC Server-side API for services to receive the request and send a reply
@stevenhartley stevenhartley added documentation Improvements or additions to documentation enhancement New feature or request v1.5.8 labels May 2, 2024
@PLeVasseur
Copy link
Contributor

I think these APIs are reasonable.

A couple of suggestions (these may already be on your todo list :) )

  • Would be good to flesh out the APIs a little more with what parameters they take and what return types are.
  • Would be good to map how the uP-L2 APIs map down into uP-L1 APIs
    • i.e. we had some lengthy discussions about how for different message types we would register on various things

stevenhartley added a commit to eclipse-uprotocol/up-java that referenced this issue May 6, 2024
@stevenhartley stevenhartley self-assigned this May 16, 2024
sophokles73 added a commit to SoftwareDefinedVehicle/uprotocol-spec-fork that referenced this issue May 17, 2024
Use UML2 to define interfaces, added sequence diagrams illustrating
behavior.
stevenhartley added a commit that referenced this issue May 21, 2024
The following change provides the minimal requirements such that language libraries can declare and provide a default  implementations of the communication layer (uP-L2) APIs for pub/sub, notification, and RPC messaging patterns.

#129
stevenhartley added a commit that referenced this issue May 23, 2024
* Messaging Pattern API Specifications

The following change provides the minimal requirements such that language libraries can declare and provide a default  implementations of the communication layer (uP-L2) APIs for pub/sub, notification, and RPC messaging patterns.

#129

* Tried to put as much info in as needed for 1.5.8

* Update up-l2/README.adoc

Co-authored-by: Kai Hudalla <kai.hudalla@bosch.com>

* remove idempotent requirement for now

* Update up-l2/api.adoc

Co-authored-by: Kai Hudalla <kai.hudalla@bosch.com>

---------

Co-authored-by: Kai Hudalla <kai.hudalla@bosch.com>
@stevenhartley
Copy link
Contributor Author

completed

eclipse-uprotocol-bot pushed a commit to eclipse-uprotocol/up-java that referenced this issue Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants