Added support to send different headers, apiRoot and different query param values to candidate, primary and secondary servers
You can send different HTTP Header Key value pairs to candidate, primary and secondary servers. Add -candidateHeaders=Authorization:Basic OtxGHYUI, userRole:admin1 -primaryHeaders=Authorization:Basic NjhmskT, userRole:admin2 -secondaryHeaders=Authorization:Basic Tysfdg, userRole:admin3 to your command line arguments
You can add apiRoots to the api calls to candidate, primary and secondary servers. Add -candidateApiRoot="api/v2" -primaryApiRoot="api/v1" -secondaryApiroot="api/v1" to your command line arguments. Usage:- curl 'localhost:8880/getAllMessages' will send a request candidateServer:candidatePort/api/v2/getAllMessages to candidate server while it will send primaryServer:primaryPort/api/v1/getAllMessages to primary server
You can now substitute different queryParam values before multicasting to the three different servers. Usage:- curl 'localhost:8880/api/getUserMessages?message=userId'. Create a file apiParams.xml with the following structure
<apiParams> <userId> <candidate> 12 </candidate> <primary> 13 </primary> <secondary> 14 </secondary> </userId> </apiParams>
This will send a request candidateServer:candidatePort/api/getUserMessages?message=12 to candidate server while sending primaryServer:primaryPort/api/getUserMessages?message=13 and secondaryServer:secondaryPort/api/getUserMessages?message=14 request to primary and secondary servers respectively.
hi @puneetkhanduri these two tests failed on my local machine too. But I donot know why. The changes I have done should not effect those test cases.
Ok figured out why the test cases were failing. While I was treating the request as HttpRequest the test case was sending string. Added a check to execute my code only when the request is an HttpRequest. Test cases are passing now. Willc ommit soon.
hi @puneetkhanduri I think now the coverage test is failing. Don't understand why from the logs though.
Current coverage is 36.59%
- 6 files (not in diff) in
...la/com/twitter/diffywere modified. more- Misses
+1 - Hits
-1
- Misses
@@ master #43 diff @@
==========================================
Files 29 29
Lines 789 850 +61
Methods 772 833 +61
Messages 0 0
Branches 17 17
==========================================
+ Hits 288 311 +23
- Misses 501 539 +38
Partials 0 0
Powered by Codecov. Last updated by 8586972...18507a3
I will try to find some time and do the changes suggested
@sukalpomitra This PR is still open. Did you figure out a different way to send headers? I am trying out diffy and I met with this requirement of sending headers. cc @puneetkhanduri
@savakarv I moved on to other projects and did not have time to fix it. Why dont you fork mine and continue.
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.
:x: sukalpo.mitra
:x: sukalpomitra
sukalpo.mitra seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.