-
Notifications
You must be signed in to change notification settings - Fork 195
Enhanced Rest Data Sink Component with ability to add headers to request, retry the request on failure, and upgrade to current streampipes interfaces #3541
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
base: dev
Are you sure you want to change the base?
Conversation
…functionality, and more extensive logging.
thanks a lot for your PR! The changes are highly welcome. I really appreciate the update to the new API and the additional functionality for the sink. Required ChangesThere are some changes required to ensure that this PR works and that existing instances of the
Please let us know if you need any assistance or if some of the changes I described are not clear. SuggestionWhat do you think about making Thank you again for your PR and we look forward to working with you. |
Thank you for the suggestions! This is helpful to figure out how to clean this up and get the PR passing. I'll get the version update and migration script done asap. The displayed labels comment makes a lot of sense and answers some of my confusion. I spent a long time looking for why so many components were using "withId" instead of "from". It would be helpful to include this in the "Extending Streampipes" tutorial section on the website. I could have also just missed it while skimming but I did look for a decent period of time and couldn't understand its usage. In regards to the retry delay, I had this same thought and was planning on adding it later on but I will go ahead and include it now! Makes sense to include this in case anybody doesn't want the retry functionality up front. |
@tenthe I could use help with conditional ui elements and how to add them. For example, the user input should be required for RETRY_DELAY_MS and NUM_RETRY integers if and only if the user has enabled them via the IS_RETRY_ENABLED boolean (or single selection... whatever suits better) |
Hi @heisenbergs-uncertainty thanks for your contribution. |
Sounds good. I'll just add documentation for it and maybe submit an issue as a reminder to me to update it to the conditional component once that's complete. Functionality should be done at this point and I just need to update the migration scripts. |
… instead of labels.from. This change simplifies the configuration and enhances readability. # Conflicts: # streampipes-extensions/streampipes-sinks-brokers-jvm/src/main/java/org/apache/streampipes/sinks/brokers/jvm/rest/RestSink.java
…ble to input if they want to retry the request and then configure the retry delay and max number of retries.
…type to a slider since I learned that a slider represents true or false in streampipes. I updated integerts from .requiredIntegerParameter to a static property free text integer since these values more closely represent a static property rather than a parameter. I also added the V0->V1 migration for those currently using the RestSink.
…and attempted to format correctly but I couldn't figure out everything in IDEA Ultimate.
@tenthe @dominikriemer I might need help on the checkstyle issues. I don't typically work in Java and I am not totally certain of IDEA IDE and I am having trouble getting the formatting to work correctly with the checkstyle.xml. It seems like all of my checkstyle errors are currently related to indentations. |
Purpose
This enhances the currently implemented RestPublisher Data Sink which has very little functionality outside of making a request. Many implementations of REST functionality are going to be utilizing the sink to trigger a webhook which should at bare minimum use authorization to confirm the legitimacy of the request origin. This enhancement allows for the addition of custom headers so that more advanced REST scenarios can be addressed with the RestPublisher. I have also added retry functionality on failure, timeouts, and better logging for more advanced debugging.
This also upgrades the interfaces on from older streampipes models to the newer "IDataSinkInterface" as demonstrated by the Streampipes tutorial documentation.
Here is a picture of what the new sink looks like in the UI:
Here is an example of this same request hitting RequestBin:
Remarks
No remarks.
PR introduces (a) breaking change(s): no
PR introduces (a) deprecation(s): no