Knotx / knotx

Knot.x is a highly-efficient and scalable integration framework designed to build backend APIs
https://knotx.io
Apache License 2.0
126 stars 26 forks source link

Rename shouldProcess method in AbstractKnotProxy #474

Closed scypio closed 5 years ago

scypio commented 5 years ago

Is your feature request related to a problem? Please describe. During implementation of fallback handling ( https://github.com/Cognifide/knotx/issues/466 ) we decided that knots should process only those fragments that are not marked as failed.

Therefore existing method protected abstract boolean shouldProcess(Set<String> knots) in AbstractKnotProxy should be removed and replaced with protected abstract boolean supports(Set knots);

New method ( boolean shouldProcess(Fragment fragment) ) implemented in the fore-mentioned feature should be used by knots to determine whether they should process given fragment

Describe the solution you'd like Remove the method - effectively rename it to supports

Describe alternatives you've considered We considered adding a @Deprecated marker to the method and providing a default implementation - it turned out to be very confusing. A simple, but compatibility-breaking change seems better.

Additional context

Note that the adjusted ( boolean shouldProcess(Fragment fragment) ) method is already configured for relevant verticles in the knotx project (this was done as part of the fallback handling feature implementation).

tomaszmichalak commented 5 years ago

This is not valid thanks to the new Knot Engine that process all Fragments one by one according to defined flow. Now you are able to define the flow in Fragment snippet:

    <knotx:snippet flow="knotx.knot.databridge,knotx.knot.te"
                   databridge-name-author="authors"
                   databridge-name-book="books">
    ...
    </kntox:snippet>

See https://github.com/Knotx/knotx-stack/blob/master/knotx-it-tests/src/test/resources/content/local/fullPage.html as a reference.