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

Add support for HTTP servers and clients #260

Closed
fmvilas opened this issue Feb 24, 2022 · 16 comments
Closed

Add support for HTTP servers and clients #260

fmvilas opened this issue Feb 24, 2022 · 16 comments
Labels
enhancement New feature or request gsoc This label shoudl be used for issues or discussions related to ideas for Google Summer of Code stale

Comments

@fmvilas
Copy link
Member

fmvilas commented Feb 24, 2022

Reason/Context

Currently, Glee only supports WebSocket and MQTT protocols. That makes it unusable for someone wanting to use any other protocol, like HTTP.

Description

Glee should be able to create an HTTP server (API) or a client out of an AsyncAPI definition. We can probably use the same x-kind extension defined in #259, as a way to understand when we want a client and when we want a server.

One key part of this issue is to actually work on the HTTP binding. Especially, in this issue about adding support for multiple methods.

@fmvilas fmvilas added enhancement New feature or request gsoc This label shoudl be used for issues or discussions related to ideas for Google Summer of Code labels Feb 24, 2022
@AMorgaut
Copy link

AMorgaut commented Feb 24, 2022

To me there is a specific usage of HTTP that totally makes sense for AsyncAPI and which is not WebSocket

I'm thinking about EventSource aka "Server-Sent Events" which is typically event-based

The protocol definition can be seen there:
https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events

but it probably deserve a seperated feature request issue

@fmvilas
Copy link
Member Author

fmvilas commented Feb 25, 2022

That's a good point, @AMorgaut. I don't think it should be separated. We should aim for full HTTP support IMHO.

@Souvikns
Copy link
Member

@fmvilas by client do you mean glee server will make a API call to the client server as per the bindings information and the data that is returned from operationId function?

@fmvilas
Copy link
Member Author

fmvilas commented Apr 28, 2022

Nope. I mean Glee should behave like a client not like a server. It should make calls to some APIs but it shouldn't be a server itself.

@Souvikns
Copy link
Member

Souvikns commented May 3, 2022

Nope. I mean Glee should behave like a client not like a server. It should make calls to some APIs but it shouldn't be a server itself.

🤔 Kinda confused, I should be able to create a http REST API with glee if I want right, so like I would make an API call to glee through http and get a response. Would you call it a server?

@fmvilas
Copy link
Member Author

fmvilas commented May 5, 2022

Yeah sorry, somehow I got confused by your question too. What I mean is that Glee should behave in two different ways, depending on how you configure your AsyncAPI document:

  1. As a server: this would, for instance, leverage ExpressJS or something similar behind the scenes. This is for people who want to create a REST API.
  2. As a client: this would let you make calls to other REST APIs. Say, for instance, every time you receive a message via MQTT you want to call a 3rd-party REST API. That should be possible too.

Note that a Glee application may be a mix of both, a client and a server. For instance, imagine we want to create a REST API, and every time the user does POST /users we want to call an external service, e.g., the Google Analytics API, another API in our system, etc.

Does that make sense?

@ritik307
Copy link
Contributor

ritik307 commented May 5, 2022

Hi, @fmvilas I would like to work on this issue. So can you kindly help me out in figuring out where to start? Like should I start making REST APIs or some other approach? 😊

@Souvikns
Copy link
Member

Souvikns commented May 6, 2022

Hey, @ritik307 I was working on this issue and made some progress as well #265, since we need to update the bindings I am focusing on that right now asyncapi/bindings#131. I would love to mentor you (if you want me as a mentor) if this idea gets issue gets selected.

@ayushpaharia
Copy link

Hello @Souvikns Can you give some context on this issue. I'm interested in working on this as a Mentorship project

@Souvikns
Copy link
Member

So I will be mentoring this issue if it gets selected 😄 . To answer both @ayushpaharia and @ritik307 you should start getting familiar with glee and its codebase. I would suggest you fork and play around with glee. look into the examples folder to get a better understanding of how glee is working. Secondly, start reading the codebase and tweaking some code here and there to get a feel of things.

Also, check out #265, and even review it. You guys can also join the asyncapi/community#352 meeting for understanding how the HTTP binding will shape up. Lastly, feel free to ask any questions you have here or on slack.

@ritik307
Copy link
Contributor

@Souvikns Will surely start exploring the glee. 😄

@ayushpaharia
Copy link

#265 - Looks interesting. I'll get started with playing around with glee. See you in asyncapi/community/#352 💯 @Souvikns

@Souvikns
Copy link
Member

Souvikns commented Jun 6, 2022

So this idea was selected for AsyncAPI Mentorship 2022 ->
asyncapi/community#376 (comment)

@ritik307 since you contributed to cli, modelina, website, and many more projects, I would like to select you as a mentee for this issue- would you like to become an AsyncAPI-sponsored mentee for this idea? 🙏🏼I would be your mentor for the coming months.

@ritik307
Copy link
Contributor

ritik307 commented Jun 6, 2022

@Souvikns I will be more than happy to be mentee for the mentioned issue 😁. Thank you so much for providing me the opportunity.🥳

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2022

This issue has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions bot added the stale label Oct 5, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 3, 2023
@Souvikns
Copy link
Member

Souvikns commented Feb 3, 2023

@fmvilas can you please reopen this, as it is being currently worked on #320

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gsoc This label shoudl be used for issues or discussions related to ideas for Google Summer of Code stale
Projects
None yet
Development

No branches or pull requests

5 participants