Comments (14)
After considering different approaches to resolving this issue with the help of @fmvilas, three potential solutions were identified.
1) Utilizing Extensions in the AsyncAPI File
This solution appears to be an obvious first choice. By adding an extension such as x-glee-trigger
to the messages or channels in the specification file, Glee can handle it automatically. However, one drawback of this approach is that it would require adding another configuration to specify the TOKEN or similar information in the Glee configuration.
2) Exporting Configuration from the Functions
The current approach that we use for lifecycle methods. Where a function and the corresponding triggering event are returned.
This approach is logical for functions as well. By returning a function and its configuration from the file in the functions folder, it is possible to specify what should be called, which method to use, and the header and body. This method appears to be a compelling option as it requires no additional configuration and can also address authentication concerns by allowing the user to parse their token and include it in the header. However, the downside of this approach is that it needs to be done for every operation, which can become complex when working with protocols that only have one channel, such as WebSockets.
3) Adding a trigger
Option Alongside send
or reply
In my opinion, the third option offers the greatest level of flexibility. It provides additional versatility that the second option does not have, by allowing for chaining of calls. While this may result in a coupling issue, it can also be considered a feature, as the user has the choice to utilize it or not. For example, if the return of a SaaS function is another function, Glee has the capability to call it as well. Additionally, it allows for the function to carry out its normal actions, such as sending or broadcasting results, while also triggering another SaaS function. Overall, I do not perceive any major drawbacks with this solution.
from glee.
Yeah! The last point is optional though. Depending on the protocol we may not be able to give any feedback to the user.
from glee.
Hello sir, @fmvilas
This sounds really interesting if no one is working on this issue then i like to work on this for a part of mentorship program but i have to first learn required skills for this so can i get help form you for move ahead.
from glee.
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️
from glee.
@fmvilas interesting idea for sure.
So here is a use case (is this what you mean)
- User has asyncapi file (lets say basic WebSocket for now)
- We know from the file we can listen for the event
onMessage
- Rather than doing
onMessage
locally, user wants to trigger external function (lambda, netlify etc). - When onMessage comes to our application, we trigger the function for the user (using HTTP + apis)
- We read the response and give the user feedback (somehow).
Is this the kinda flow you mean?
from glee.
@fmvilas The runtime mechanism was removed in #212, so is this feature still relevant?
from glee.
Awesome! Yeah, no worries. During the mentorship program, I'll be here to support you. If this issue gets selected, of course 😄
from glee.
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 ❤️
from glee.
This is still relevant, @github-actions. Please don't close it 🙏
from glee.
@fmvilas
There are a few points that I would need some input on:
- Do users need to have the FaaS function already in place, or will they be able to write their function in Glee and have us generate the functions for them to upload to their FaaS provider?
- What should the user interface for this feature look like? I understand that users need to provide the link to their endpoint and the method for calling it, but I'm not sure how they would do this in the interface. Can you provide more details on how this feature would work in practice?
@Souvikns anything from your side?
from glee.
@KhudaDad414 Help me understand here, is this the flow you are going with
some data gets published to Glee --> control goes to Glee function --> Glee function returns another functions and some config --> glee uses that config to make API call and then calls the returned functions with the response
can't I make the API call in glee function itself as part of my business logic.
from glee.
some data gets published to Glee --> control goes to Glee function --> Glee function returns another functions and some config --> glee uses that config to make API call and then calls the returned functions with the response
more or less.
this is what I think the flow should be.
some data gets published to Glee --> control goes to Glee function --> Glee function has the option to send trigger
alongside send
and/or reply
--> glee makes the API call and then evaluates the response.
what it should do with the response?
Short answer, I don't know. 😆
IMO we have two options here. We can send
/reply
the response or we can treat the response just like a Glee function response. this way a function can return another trigger
/send
/reply
object. this enables us to chain the function calls but it creates a coupling issue.
can't I make the API call in glee function itself as part of my business logic.
You definitely can but glee can abstract the API call for you. like retrying the call in case it fails with the 429
error code. etc.
from glee.
we can treat the response just like a Glee function response
We should definitely treat the response the same way we treat a function's return
. The idea is to be able to decouple the function's code from Glee and JS/TS, so people can write their functions in any programming language.
this enables us to chain the function calls but it creates a coupling issue.
Well, this creates coupling but it doesn't have to necessarily be an issue. Some people would argue it is and some will not. IMHO, Glee shouldn't make any opinion on that matter since it's an architectural decision.
like retrying the call in case it fails with the 429 error code. etc.
This! 💯 Anyone can make an HTTP call but making sure you retry it if it fails, you adapt to rate limiting issues, etc. is what actually makes it production-ready.
from glee.
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 ❤️
from glee.
Related Issues (20)
- handling request error for websocket connection HOT 1
- Support for Multiple .env Files HOT 4
- Improve Stability in Glee by Handling Message and Connection Failures HOT 3
- Internal nodejs error while running the example app HOT 8
- Apply `default` property to event fields HOT 4
- Update Kafka Adapter to support spec v3 HOT 2
- Improved Error Messaging for Missing Auth Function HOT 4
- Spread syntax requires HOT 2
- but this path is not defined in your AsyncAPI file - Caused by trailing slash HOT 6
- Unable to send message with glee when payload is an object with an allOf of two or more objects HOT 5
- MQTT channel seems to be using wrong topic when sending message HOT 1
- Parameters in channel address not used HOT 3
- Divide "Maintainer" role into two categories: Triager and Committer HOT 3
- [BUG] It does not support non-ssl Kafka Brokers HOT 2
- [BUG] Glee subscribes to topics using channel names instead of "channel.address" (v3) HOT 8
- [FEATURE] Run Glee in a container HOT 2
- [FEATURE] invoke send action for operation in v3 HOT 2
- [FEATURE] Investigate bun if it's right for glee HOT 10
- extract glee-core from glee HOT 4
- [FEATURE] The future of glee as a framework HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glee.