-
Notifications
You must be signed in to change notification settings - Fork 36
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
Remove need for loopback when using callService, callRootService #319
Remove need for loopback when using callService, callRootService #319
Conversation
Signed-off-by: 1000TurquoisePogs <[email protected]>
Hi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving because the code seems to make sense and matches what the description is saying. However, I did not yet test the Sample App & also did not test it with API ML
I did test with internal routing enabled & login still works
this.urlPrefix = urlPrefix; | ||
if (!environment.loopbackConfig.port) { | ||
installLog.severe(`ZWED0003E`, loopbackConfig); //installLog.severe(`loopback configuration not valid,`,loopbackConfig, `loopback calls will fail!`); | ||
} | ||
this.environment = environment; | ||
this.isAgentService = isAgentService; | ||
} | ||
WebServiceHandle.prototype = { | ||
constructor: WebServiceHandle, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment below can be updated to include turning off HTTP call to localhost by setting node.internalRouting=true in the server config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Below line 856
requestOptions.path = this.environment.agentRequestOptions.apimlPrefix + requestOptions.path; | ||
} | ||
httpOrHttps = requestOptions.protocol == 'http:' ? http : https; | ||
console.log(`call agent direct`, requestOptions.path, requestOptions.hostname); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why we're using console.log instead of utilLog ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought I fixed every occurrence. Will fix now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works fine both with and without APIML. zowe/sample-angular-app#62 works fine, too. It looks safe to merge after removing(or replacing) console.log
.
Sorry, this was actually the wrong branch to review. #321 |
Signed-off-by: 1000TurquoisePogs [email protected]
Proposed changes
callService and callRootService currently do a loopback where there's a request from app-server to itself in order to reach the right part of the code to handle a request. This is overhead and causes ip config complications about how app-server reaches itself.
This PR fixes the problem in two ways.
Note 2, inter-server direct routing is disabled here for compatibility. It should be very compatible, but just dont want to disrupt behavior in v1. In zowe v2, we should switch this to enabled by default. The behavior can be enabled by setting the property
node.internalRouting=true
in the server config.Type of change
Please delete options that are not relevant.
PR Checklist
Please delete options that are not relevant.
Testing
Case 1)
To test, you should be attempting login to desktop with and without apiml.
Without apiml, the code should contact zss directly. With apiml, it should contact apiml to contact zss.
If login succeeds in both cases, then this is working.
Case 2)
Test inter-plugin service calls using this PR zowe/sample-angular-app#62
I sent a small message in postman and observed the following to prove it was working:
Further comments