Refactor ForwardingJob class and fix few issues #38
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi All,
This PR does the $subject and in the process I have fixed two issues as well.
Programmers spend more time to reading code and less time on writing code. Therefore, it is needless to say that having readable code is essential in any project.
ForwardingJob
class was actually the opposite of this (forgive me for saying this) and it is very hard to read the code do new modification. Making the code vulnerable for regression issues.Therefore, I have refactored the code starting the basic principle of functions doing one and only one thing. In the processes I have moved some variables into class variables as actually control the state of the
ForwadingJob
. Also, code abstraction done in a way that, reader starts with the highest abstraction of the concept and then drill down to more granular abstractions. This is similar to news-paper metaphor. Also, all the functions follow vertical affinity and therefore closely related functions are placed next to other.Please note that after the refactor I have re-tested all the scenarios such as,
Out Only Scenario
Response Scenario
Along with this I have fixed below two bugs,
https://issues.apache.org/jira/browse/SYNAPSE-1120
https://issues.apache.org/jira/browse/SYNAPSE-1121