-
Notifications
You must be signed in to change notification settings - Fork 755
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
[Task]: Implement sample Synapse API to Ballerina service mapping #43527
Comments
Update:
Identified concerns:
|
[Update on 08/11/2024]
import ballerina/http;
import ballerina/log;
listener http:Listener HealthcareAPI = new (8290, config = {host: "localhost"});
service /healthcare on HealthcareAPI {
resource function post categories/[string category]/reserve(http:Caller caller, http:Request req) returns error? {
json payload = check req.getJsonPayload();
string Hospital = check payload.hospital;
http:Response res;
match Hospital {
"grand oak community hospital" => {
log:printInfo("", message = "Routing to " + Hospital);
http:Client GrandOakEP = check new (string `http://localhost:9090/grandoaks/categories/${category}/reserve`);
res = check GrandOakEP->post("", req);
}
"pine valley community hospital" => {
log:printInfo("", message = "Routing to " + Hospital);
http:Client PineValleyEP = check new (string `http://localhost:9090/pinevalley/categories/${category}/reserve`);
res = check PineValleyEP->post("", req);
}
"clemency medical center" => {
log:printInfo("", message = "Routing to " + Hospital);
http:Client ClemencyEP = check new (string `http://localhost:9090/clemency/categories/${category}/reserve`);
res = check ClemencyEP->post("", req);
}
_ => {
log:printInfo("", message = "Invalid hospital - " + Hospital);
res = new;
res.setPayload(payload);
}
}
check caller->respond(res);
}
}
|
The initial implementation for https://mi.docs.wso2.com/en/latest/learn/integration-tutorials/routing-requests-based-on-message-content/ to Ballerina code has been completed. The following mediators were incorporated.
As per the offline discussion, this work is currently deprioritized. |
Description
$subject
Describe your task(s)
No response
Related area
-> Runtime
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
The text was updated successfully, but these errors were encountered: