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

Adding consumer for uSubscription service #292

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

agosh01
Copy link
Member

@agosh01 agosh01 commented Aug 15, 2024

This PR is to implement consumer api which act as L3 interface for the user to do subscribe request to uSubscription service

Note: Current uSubscription proto file is not usable by C++ as its missing build configuration. In order for this PR to work up-core-api needs to updated. See

Copy link

Code coverage report is ready! 📈

@agosh01 agosh01 force-pushed the feature/add_usubscription_client branch from 4b4518a to 20d3c56 Compare August 15, 2024 15:52
Copy link

Code coverage report is ready! 📈

@agosh01 agosh01 force-pushed the feature/add_usubscription_client branch from 20d3c56 to 38912eb Compare August 15, 2024 15:57
Copy link

Code coverage report is ready! 📈

@agosh01 agosh01 force-pushed the feature/add_usubscription_client branch from 38912eb to cc64305 Compare August 15, 2024 16:00
Copy link

Code coverage report is ready! 📈

@agosh01 agosh01 force-pushed the feature/add_usubscription_client branch from cc64305 to 80ee1f9 Compare August 15, 2024 17:03
Copy link

Code coverage report is ready! 📈

@agosh01 agosh01 force-pushed the feature/add_usubscription_client branch from 80ee1f9 to 692eb81 Compare August 15, 2024 17:22
include/up-cpp/client/usubscription/SubscriptionClient.h Outdated Show resolved Hide resolved
include/up-cpp/client/usubscription/SubscriptionClient.h Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: I would move this to include/up-cpp/client/usubscription/v3/SubscriptionClient.h. I'm also tempted to replace "SubscriptionClient" with "Subscriber" or "Consumer" (the publish side would be "Publisher" or "Producer")

include/up-cpp/client/usubscription/SubscriptionClient.h Outdated Show resolved Hide resolved
///
/// Like all L3 client APIs, the SubscriptionClient is a wrapper on top of the
/// L2 Communication APIs and USubscription service.
struct SubscriptionClient {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm tempted to call this Subscriber or Consumer since client is already in the namespace. Not 100% sure there yet. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Subscriber may cause confusion between L2 Subscriber just in context of writing and talking.
Might be better to call it Consumer unless Consumer might be used elsewhere too

Comment on lines 55 to 57
SubscriptionResponse getSubscriptionResponse() const {
return subscription_response_;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is really needed - we can probably handle the response internally and provide just a status outward. I'll need to think on it a little more.

Copy link
Member Author

@agosh01 agosh01 Aug 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

message SubscriptionResponse {
  // Current status of the subscription
  SubscriptionStatus status = 1;

  // Any platform (uDevice) specific additional event delivered configuration
  // information for how the subscriber should consume the published events.
  EventDeliveryConfig config = 2;

  // Subscription topic passed to SubscriptionRequest
  uprotocol.v1.UUri topic = 3;
}

As SubscriptionResponse may contain configuration information which might be critically to consume information. I am not entirely sure tho

Copy link

Code coverage report is ready! 📈

@agosh01 agosh01 force-pushed the feature/add_usubscription_client branch from b8e7a61 to 14215c0 Compare August 19, 2024 18:20
@agosh01 agosh01 changed the title Adding header for subscription client Adding consumer for uSubscription service Aug 19, 2024
@agosh01 agosh01 force-pushed the feature/add_usubscription_client branch from 14215c0 to 18e9c02 Compare August 19, 2024 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants