English 中文(简体)
Ballerina 调试器在我的芭蕾舞项目中只启动一个服务器
原标题:Ballerina debugger starts only one server in my ballerina project
My Ballerina project contains multiple servers. HTTP server (runs on port 9095) GraphQL server (runs on port 9090) The HTTP server acts as a proxy server for the GraphQL server. When I start the Ballerina project with debug mode from the VS Code, only the HTTP server is getting started in debug mode (i.e. Supports debugger breakpoints). While the GraphQL server runs without issues, it doesn t support pausing on the debugger breakpoints. I want to know how to start the GraphQL server with debugging mode. It s okay to have the debugging mode only for the GraphQL server and not for the HTTP server. Edit: Ballerina version: 2201.8.3
最佳回答
When running a Ballerina project in debug mode, all program entry points (i.e., all main functions and services) are initialized in debug mode. Hence, there s no need to explicitly run your GraphQL service in debug mode. Please refer to the sample below (a simplified version of your project having both HTTP and GraphQL services within the same program) and follow the mentioned steps to verify that the GraphQL service is up and running, and that the breakpoints within the service are reachable. (Verified with the latest Ballerina version up-to-date, which is 2201.9.2) import ballerina/graphql; import ballerina/http; service / on new http:Listener(9095) { resource function get greeting() returns string { return "Hello, World!"; } } @graphql:ServiceConfig { graphiql: { enabled: true } } service /graphql on new graphql:Listener(9090) { resource function get greeting() returns string { return "Hello, World!"; } } Steps to follow: Set breakpoints within the GraphQL resource function greeting, and run the project in debug mode. (Refer to Ballerina documentation on debugging) Navigate to the locally created GraphiQL endpoint (http://localhost:9090/graphiql) as suggested in the program logs. Run a sample query via the GraphiQL client UI, and you ll see the debug hit inside the GraphQL resource function.
问题回答

暂无回答




相关问题
Eclipse: Hover broken in debug perspective

Since upgrading Eclipse (Galileo build 20090920-1017), hover in debug no longer displays a variable s value. Instead, hover behaves as if I were in normal Java perspective: alt text http://...

IIS 6.0 hangs when serving a web-service

I am having issues with one of our web-services. It works fine on my development machine (win XP) whether I host it as a separate application or using cassini from Visual studio. Once I deploy on the ...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

Asp.Net MVC - Problem returning a model to the view

I ve recently started using the Areas functionality of the Preview2 and it was working ok until I needed to return a Model to the view. Controller: public ActionResult ForgotPassword() { return ...

Unable to generate PDB files in Visual Studio 2005

For most assemblies, I m able to generate their respective .pdb files. However, I ve got one project that isn t generating their .pdb files. I ve made sure that it on debug mode and that the project ...

热门标签