### Install Dependencies and Start Dev Server Source: https://github.com/line/armeria/blob/main/docs-client/README.md Install project dependencies and start the development server. Use `--legacy-peer-deps` if you encounter peer dependency issues. ```bash $ npm install --legacy-peer-deps $ npm run develop ``` -------------------------------- ### Install and Start Grafana Source: https://github.com/line/armeria/blob/main/site-new/src/content/blog/en/2021-07-09-monitoring-prometheus-metrics-from-armeria.mdx Installs and starts the Grafana service using Homebrew. Grafana is used for visualizing metrics. ```bash $ brew install grafana $ brew services start grafana ``` -------------------------------- ### Start Dev Server with Gradle Source: https://github.com/line/armeria/blob/main/docs-client/README.md Start the development server using Gradle. NodeJS will be downloaded automatically if not present. ```bash $ ./gradlew :docs-client:npm_run_develop --no-daemon ``` -------------------------------- ### Run Armeria Proxy Server with Gradle Source: https://github.com/line/armeria/blob/main/examples/proxy-server/README.md Execute this command to start the proxy server and its backend services. This setup includes three backend servers that stream ASCII animations at different intervals. ```bash #!/bin/bash ./gradlew run --no-daemon ``` -------------------------------- ### Start Minikube Source: https://github.com/line/armeria/blob/main/it/kubernetes-chaos-tests/README.md Starts a minikube cluster using the Docker driver with specified resources. ```bash minikube start --driver=docker --memory 8192 --cpus 3 ``` -------------------------------- ### Add Documentation Service with Example Request Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/tutorials/thrift/06-implement-delete.mdx Integrates Armeria's Documentation service into the server. Includes an example request for creating blog posts to be displayed in the documentation. ```java import com.linecorp.armeria.server.docs.DocService; import example.armeria.blog.thrift.CreateBlogPostRequest; ... private static Server newServer(int port) throws Exception { ... final CreateBlogPostRequest exampleRequest = new CreateBlogPostRequest() .setTitle("Example title") .setContent("Example content"); final DocService docService = DocService .builder() .exampleRequests(List.of(new BlogService.createBlogPost_args(exampleRequest))) .build(); ... ``` -------------------------------- ### Install Prometheus Source: https://github.com/line/armeria/blob/main/site-new/src/content/blog/en/2021-07-09-monitoring-prometheus-metrics-from-armeria.mdx Installs the Prometheus monitoring system using the Homebrew package manager. ```bash $ brew install prometheus ``` -------------------------------- ### Start the Armeria Server Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/tutorials/rest/01-create-server.mdx Implements the main method to start the Armeria server. It configures the server to shut down gracefully when the JVM is terminated and starts the server, joining the start future. ```java public static void main(String[] args) throws Exception { Server server = newServer(8080); server.closeOnJvmShutdown(); server.start().join(); logger.info("Server has been started. Serving dummy service at http://127.0.0.1:{}", server.activeLocalPort()); } ``` -------------------------------- ### Start the Armeria Server Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/tutorials/thrift/02-run-service.mdx Implement the main method to create the server instance, set up graceful shutdown on JVM termination, and start the server. The server will listen on the configured port. ```java public static void main(String[] args) throws Exception { final Server server = newServer(8080); server.closeOnJvmShutdown().thenRun(() -> { logger.info("Server has been stopped."); }); server.start().join(); } ``` -------------------------------- ### Install Armeria Claude Plugin Source: https://github.com/line/armeria/blob/main/site-new/src/content/community/claude-plugin.mdx Use these commands to install the Armeria Claude plugin from the marketplace. ```bash /plugin marketplace add line/armeria ``` ```bash /plugin install assistant@armeria ``` -------------------------------- ### Server Start Confirmation Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/tutorials/grpc/06-implement-delete.mdx This bash output confirms that the Armeria server has successfully started and is serving the Documentation service at the specified local address and port. ```bash Server has been started. Serving DocService at http://127.0.0.1:8080/docs ``` -------------------------------- ### Create Example Blog Post Request Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/tutorials/grpc/06-implement-delete.mdx Defines an example request object for creating a blog post. This is used to populate the request body in the Armeria Documentation service. ```java final BlogPost exampleRequest = BlogPost.newBuilder() .setTitle("Example title") .setContent("Example content") .build(); ``` -------------------------------- ### Build a Basic Server Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/server/basics.mdx Initialize a ServerBuilder and build a server instance. This is the starting point for any Armeria server configuration. ```java import com.linecorp.armeria.server.Server; import com.linecorp.armeria.server.ServerBuilder; ServerBuilder sb = Server.builder(); // TODO: Configure your server here. Server server = sb.build(); CompletableFuture future = server.start(); // Wait until the server is ready. future.join(); ``` -------------------------------- ### Configure DocService with Example Request Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/tutorials/rest/03-add-services-to-server.mdx Use DocService.builder() to configure example requests for your service methods. This helps in testing and documenting your API endpoints. ```java static Server newServer(int port) { ServerBuilder sb = Server.builder(); DocService docService = DocService.builder() .exampleRequests( BlogService.class, "createBlogPost", "{\"title\":\"My first blog\",\"content\":\"Hello Armeria!\"}") .build(); ``` -------------------------------- ### Configure DocService with Example Request Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/tutorials/grpc/06-implement-delete.mdx Configure the DocService builder to include an example request for the CreateBlogPost method. This helps users understand how to interact with the service via the documentation interface. ```java final DocService docService = DocService.builder() .exampleRequests(BlogServiceGrpc.SERVICE_NAME, "CreateBlogPost", exampleRequest) .exclude(DocServiceFilter.ofServiceName( ServerReflectionGrpc.SERVICE_NAME)) .build(); ``` -------------------------------- ### gRPC Service Implementation Example Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/server/grpc.mdx Provides an example implementation of the 'HelloService' gRPC service. This class extends the generated base class and overrides the 'hello' method to handle requests and send responses. ```java public class MyHelloService extends HelloServiceGrpc.HelloServiceImplBase { @Override public void hello(HelloRequest req, StreamObserver responseObserver) { HelloReply reply = HelloReply.newBuilder() .setMessage("Hello, " + req.getName() + '!') .build(); responseObserver.onNext(reply); responseObserver.onCompleted(); } } ``` -------------------------------- ### Create Example Request for createBlogPost Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/tutorials/thrift/06-implement-delete.mdx Defines an example request object for the createBlogPost method, used for testing via the Documentation service. ```java final CreateBlogPostRequest exampleRequest = new CreateBlogPostRequest() .setTitle("Example title") .setContent("Example content"); ``` -------------------------------- ### Configure DocService with Example Headers and Requests Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/server/docservice.mdx Use DocServiceBuilder to set default example HTTP headers and requests for services. This helps users interact with your services more easily. ```java import com.linecorp.armeria.common.HttpHeaders; import static com.linecorp.armeria.common.HttpHeaderNames.AUTHORIZATION; ServerBuilder sb = Server.builder(); ... sb.serviceUnder( "/docs", DocService.builder() // HTTP headers for all services .exampleHeaders(HttpHeaders.of(AUTHORIZATION, "bearer b03c4fed1a")) // Thrift example request for 'ThriftHelloService.hello()' .exampleRequests(List.of(new ThriftHelloService.hello_args("Armeria"))) // gRPC example request for 'GrpcHelloService.Hello()' .exampleRequests(GrpcHelloServiceGrpc.SERVICE_NAME, "Hello", // Method name HelloRequest.newBuilder().setName("Armeria").build()) .build()); ... ``` -------------------------------- ### Configure DocService with Example Requests Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/tutorials/rest/03-add-services-to-server.mdx Configure the DocService builder to include example requests for specific service methods. This helps users understand how to interact with your API. ```java import com.linecorp.armeria.server.docs.DocService; public final class Main { static Server newServer(int port) { ServerBuilder sb = Server.builder(); DocService docService = DocService.builder() .exampleRequests(BlogService.class, "createBlogPost", // Name of service method "{\"title\":\"My first blog\", \"content\":\"Hello Armeria!\"}") .build(); ``` -------------------------------- ### Log Server Start and DocService URL Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/tutorials/grpc/06-implement-delete.mdx Update the main method to log a message indicating the server has started and provide the URL for accessing the Documentation service, making it easier to find and use. ```java logger.info("Server has been started. Serving DocService at http://127.0.0.1:{}/docs", server.activeLocalPort()); ``` -------------------------------- ### Build and Start Armeria Server with Annotated Service Source: https://github.com/line/armeria/blob/main/site-new/src/content/blog/en/2018-09-13-making-a-basic-server-with-java-armeria.mdx Configure and start an Armeria server on port 8080, registering an instance of a custom service with annotated methods. The server's lifecycle is managed via CompletableFuture. ```java import com.linecorp.armeria.server.Server; import com.linecorp.armeria.server.ServerBuilder; import java.util.concurrent.CompletableFuture; public class ServerMain { public static void main(String[] args) { ServerBuilder sb = new ServerBuilder(); sb.http(8080); sb.annotatedService(new CustomService()); Server server = sb.build(); CompletableFuture future = server.start(); future.join(); } } ``` -------------------------------- ### Gradle Project Evaluation Output Source: https://github.com/line/armeria/blob/main/gradle/scripts/README.md Example output demonstrating how project flags are displayed during Gradle configuration. ```bash $ ./gradlew > Configure project : Project ':' has flags: [] Project ':bar' has flags: [java] Project ':foo' has flags: [java, publish] A Java project ':foo' will be published to a Maven repository. ``` -------------------------------- ### Add ManagementService to Server Source: https://github.com/line/armeria/blob/main/site-new/src/content/community/developer-guide.mdx Example of how to add the ManagementService to a Server builder, enabling monitoring of threads and heap. ```java Server.builder() .serviceUnder("/internal/management/", ManagementService.of()); ``` -------------------------------- ### Build a Simple 'Hello World' Server in Armeria Source: https://github.com/line/armeria/blob/main/site-new/src/content/blog/en/2020-07-03-reactive-streams-armeria-2.mdx Use this snippet to quickly set up a basic HTTP server that responds with 'Hello, World!'. It requires minimal configuration. ```java // Build your own server under 5 lines. var server = Server.builder() .http(8080) .service("/", (ctx, req) -> HttpResponse.of("Hello, World!")) .build(); server.start(); ``` -------------------------------- ### Install ghz using Homebrew Source: https://github.com/line/armeria/blob/main/benchmarks/ghz/README.md Use this command to install ghz on macOS via Homebrew. For other systems, refer to the ghz installation guide. ```bash brew install ghz ``` -------------------------------- ### Define an Annotated HTTP Service Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/server/annotated-service.mdx Use annotations like `@Get` and `@Param` to define HTTP endpoints and their parameters. This example maps a GET request to `/hello/{name}` and extracts the name parameter. ```java ServerBuilder sb = Server.builder(); b sb.annotatedService(new Object() { @Get("/hello/{name}") public HttpResponse hello(@Param("name") String name) { return HttpResponse.of(HttpStatus.OK, MediaType.PLAIN_TEXT_UTF_8, "Hello, %s!", name); } }); ``` -------------------------------- ### GET Endpoint with Mid-line Tags Ignored Source: https://github.com/line/armeria/blob/main/annotation-processor/src/test/resources/testing/DocumentationProcessor/WithJavaDoc.java.txt Illustrates that JavaDoc tags like @return and @throws must start at the beginning of a line to be recognized. ```java /** * Method with mid-line @return should be ignored because tags must be at line start. * Similarly, mid-line @throws IllegalArgumentException - should also be ignored. * @param x The x variable * @return valid return description */ @Get public int midLineTagsIgnored(@Param("x") String x) { System.out.println(x); return 1; } ``` -------------------------------- ### Create Server Instance with Dummy Service Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/tutorials/rest/01-create-server.mdx Creates a server instance and configures it to listen on a specified port. It includes a dummy service that returns a simple HTTP response. ```java import com.linecorp.armeria.common.HttpResponse; import com.linecorp.armeria.server.Server; import com.linecorp.armeria.server.ServerBuilder; public final class Main { ... static Server newServer(int port) { ServerBuilder sb = Server.builder(); return sb.http(port) .service("/", (ctx, req) -> HttpResponse.of("Hello, Armeria!")) .build(); } ... ``` -------------------------------- ### Run Sample Service with Gradle Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/tutorials/grpc/index.mdx Run the sample gRPC service using the Gradle Wrapper. This command starts the application, making it available for requests. ```bash $ ./gradlew run ``` -------------------------------- ### Exclude Meters with MeterFilter Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/advanced/metrics.mdx Configure the MeterRegistry to deny meters based on their name or tags. This example shows how to exclude meters associated with 'MyHealthCheckService' and those starting with 'jvm'. ```java import com.linecorp.armeria.common.Flags; import io.micrometer.core.instrument.MeterFilter; Flags.meterRegistry() .config() .meterFilter(MeterFilter.deny(id -> id.getTag("service").equals("MyHealthCheckService"))) .meterFilter(MeterFilter.denyNameStartsWith("jvm")); ``` -------------------------------- ### Armeria Server with Annotated Service Source: https://github.com/line/armeria/blob/main/site-new/src/content/blog/en/2026-04-10-armeria-hyperfocal-1-building-a-native-image-with-armeria-and-graalvm.mdx An Armeria server using annotated service methods for defining routes. This example demonstrates using `@Get` and `@Param` annotations for path parameters. ```java public final class Main{ public static void main(String[] args) throws Exception { final Server server = Server .builder() .http(8080) .https(8443) .tlsSelfSigned() .annotatedService(new Object() { @Get("/greet/:name") public String greet(@Param("name") String name) { return "Hello, " + name + '!' ; } }) .service("/", (ctx, req) -> HttpResponse.of("Hello, world!")) .build(); server.start().join(); } } // A simple annotated service public class MyService { @Get("/hello/{name}") public String hello(@Param("name") String name) { return "Hello, " + name + "!"; } } ``` -------------------------------- ### Build Sample Service with Gradle Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/tutorials/grpc/index.mdx Build the sample gRPC service using the Gradle Wrapper. This command compiles the code and prepares the application for execution. ```bash $ ./gradlew build ``` -------------------------------- ### Server Startup Success Message Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/tutorials/thrift/06-implement-delete.mdx Example of the expected log message upon successful server startup, indicating that the Documentation service is available. ```bash Server has been started. Serving DocService at http://127.0.0.1:8080/docs ``` -------------------------------- ### Install Chaos Mesh Source: https://github.com/line/armeria/blob/main/it/kubernetes-chaos-tests/README.md Installs Chaos Mesh version 2.6.0 using the provided installation script. ```bash curl -sSL https://mirrors.chaos-mesh.org/v2.6.0/install.sh | bash ``` -------------------------------- ### Install npm Dependencies Source: https://github.com/line/armeria/blob/main/site-new/README.md Installs the necessary project dependencies using npm. ```console npm install ``` -------------------------------- ### Build and Test with Gradle Source: https://github.com/line/armeria/blob/main/it/kubernetes-chaos-tests/README.md Builds the Docker images for the control and checker components and runs the tests using Gradle. Ensure minikube's Docker environment is active. ```bash eval $(minikube -p minikube docker-env) ./gradlew :it:kubernetes-chaos-tests:k8sBuild :it:kubernetes-chaos-tests:test ``` -------------------------------- ### GET Endpoint with Multiline Comment Source: https://github.com/line/armeria/blob/main/annotation-processor/src/test/resources/testing/DocumentationProcessor/WithJavaDoc.java.txt Demonstrates a GET endpoint with a JavaDoc comment that spans multiple lines. ```java /** * hasMultilineComment method. * @param x The x variable in hasMultilineComment * and this continues on the next line */ @Get public void hasMultilineComment(@Param("x") String x) { System.out.println(x); } ``` -------------------------------- ### Initialize Main Class for Server Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/tutorials/thrift/02-run-service.mdx Set up the Main class for the Armeria server. This includes initializing a logger for server events. ```java package example.armeria.server.blog.thrift; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public final class Main { private static final Logger logger = LoggerFactory.getLogger(Main.class); } ``` -------------------------------- ### GET Endpoint with Return Value Source: https://github.com/line/armeria/blob/main/annotation-processor/src/test/resources/testing/DocumentationProcessor/WithJavaDoc.java.txt Defines a GET endpoint that returns an integer and documents the return value. ```java /** * hasReturn method. * @param x The x variable in hasReturn * @return The number 1 */ @Get public int hasReturn(@Param("x") String x) { System.out.println(x); return 1; } ``` -------------------------------- ### Create a Basic Armeria Server Source: https://github.com/line/armeria/blob/main/site-new/src/content/blog/en/2018-09-13-making-a-basic-server-with-java-armeria.mdx This Java code demonstrates how to build and start a simple Armeria HTTP server. It configures the server to listen on port 8080 and respond to requests at the '/hello' path with an HTML message. ```java import com.linecorp.armeria.common.HttpResponse; import com.linecorp.armeria.common.HttpStatus; import com.linecorp.armeria.common.MediaType; import com.linecorp.armeria.server.Server; import com.linecorp.armeria.server.ServerBuilder; import java.util.concurrent.CompletableFuture; public class ServerMain { public static void main(String[] args) { ServerBuilder sb = new ServerBuilder(); sb.http(8080); sb.service("/hello", (ctx, res) -> HttpResponse.of( HttpStatus.OK, MediaType.HTML_UTF_8, "

Hello Armeria...!

")); Server server = sb.build(); CompletableFuture future = server.start(); future.join(); } ``` -------------------------------- ### Install Grafana with Helm Source: https://github.com/line/armeria/blob/main/site-new/src/content/blog/en/2019-12-23-monitoring-a-spring-boot-app-in-kubernetes-what-i-learned-from-devoxx-belgium-2019.mdx Use Helm to install Grafana in your Kubernetes cluster. This command deploys Grafana with default settings. ```bash helm install my-grafana stable/grafana ``` -------------------------------- ### GET Endpoint with Type-Only Throws Tag Source: https://github.com/line/armeria/blob/main/annotation-processor/src/test/resources/testing/DocumentationProcessor/WithJavaDoc.java.txt Shows a GET endpoint where the @throws tag only specifies the exception type, not a message. ```java /** * Method where only the type is specified in the throws tag. * @param x The x variable * @throws IllegalArgumentException */ @Get public void throwsTypeOnly(@Param("x") String x) { if (x.isEmpty()) { throw new IllegalArgumentException(); } System.out.println(x); } ``` -------------------------------- ### Server1 Application Entry Point Source: https://github.com/line/armeria/blob/main/site-new/src/content/blog/en/2020-07-08-circuit-breakers-armeria.mdx Standard Spring Boot application class to start Server1. It imports the necessary context configuration. ```java import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Import; @SpringBootApplication @Import(Server1Context.class) public class Server1Application { public static void main(String[] args) { SpringApplication.run(Server1Application.class, args); } } ``` -------------------------------- ### Initialize New Gradle Project Source: https://github.com/line/armeria/blob/main/gradle/scripts/README.md Use `gradle init` to create a new Gradle project structure. This command sets up the basic files and directories for a Gradle project. ```bash $ mkdir myproject $ cd myproject $ gradle init $ ls gradle/ gradlew gradlew.bat ``` -------------------------------- ### GET Endpoint with Exception Handling Source: https://github.com/line/armeria/blob/main/annotation-processor/src/test/resources/testing/DocumentationProcessor/WithJavaDoc.java.txt Defines a GET endpoint that may throw an IllegalArgumentException if the input parameter 'x' is empty. ```java /** * hasThrows method. * @param x The x variable in hasThrows * @throws IllegalArgumentException when x is empty */ @Get public void hasThrows(@Param("x") String x) { if (x.isEmpty()) { throw new IllegalArgumentException("x is empty"); } System.out.println(x); } ``` -------------------------------- ### GET /d/{x}/{y} Source: https://github.com/line/armeria/blob/main/annotation-processor/src/test/resources/testing/DocumentationProcessor/NoJavaDoc.java.txt Handles GET requests to the /d/{x}/{y} endpoint. It accepts 'x' and 'y' as path parameters and concatenates them. ```APIDOC ## GET /d/{x}/{y} ### Description Handles GET requests to the /d/{x}/{y} endpoint. It accepts 'x' and 'y' as path parameters and concatenates them. ### Method GET ### Endpoint /d/{x}/{y} ### Parameters #### Path Parameters - **x** (String) - Required - The first path parameter. - **y** (String) - Required - The second path parameter. ``` -------------------------------- ### Build and Configure Armeria Server Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/tutorials/grpc/02-run-service.mdx Construct a new Armeria Server instance, configuring it to listen on a specified HTTP port and to serve the created gRPC service. This completes the server setup. ```java public final class Main { static Server newServer(int port) throws Exception { ... return Server.builder() .http(port) .service(grpcService) .build(); } } ``` -------------------------------- ### GET Endpoint with Deprecated Parameter Source: https://github.com/line/armeria/blob/main/annotation-processor/src/test/resources/testing/DocumentationProcessor/WithJavaDoc.java.txt Defines a GET endpoint '/d/{x}/{y}' with path parameters 'x' and 'y', where 'x' is marked as deprecated. ```java /** * D method. * @deprecated x is deprecated * @param x The x variable in d * @param y The y variable in d */ @Get("/d/{x}/{y}") public void d(@Param("x") String x, @Param("y") String y) { System.out.println(x + y); } ``` -------------------------------- ### GET Endpoint with Return and Exception Source: https://github.com/line/armeria/blob/main/annotation-processor/src/test/resources/testing/DocumentationProcessor/WithJavaDoc.java.txt Defines a GET endpoint that returns an integer and may throw an IllegalArgumentException. It also includes a @since tag. ```java /** * hasReturnAndThrows method. * @since 1.4 * @param x The x variable in hasReturnAndThrows * @return The number 1 * @throws IllegalArgumentException when x is empty */ @Get public int hasReturnAndThrows(@Param("x") String x) { if (x.isEmpty()) { throw new IllegalArgumentException("x is empty"); } System.out.println(x); return 1; } ``` -------------------------------- ### Generate Site Sources with Gradle Source: https://github.com/line/armeria/blob/main/site-new/README.md Run this command to download and install Node.js, npm, and other dependencies, and to generate required .json files into the gen-src directory. ```console ../gradlew generateSiteSources ``` -------------------------------- ### GET Endpoint with Path Parameters Source: https://github.com/line/armeria/blob/main/annotation-processor/src/test/resources/testing/DocumentationProcessor/NoJavaDoc.java.txt Defines a GET endpoint at /d/{x}/{y} that extracts two path parameters, x and y, and prints their concatenation. ```java import com.linecorp.armeria.server.annotation.Get; import com.linecorp.armeria.server.annotation.Param; public class NoJavaDoc { @Get("/d/{x}/{y}") public void d(@Param("x") String x, @Param("y") String y) { System.out.println(x + y); } } ``` -------------------------------- ### Add Post-Release Instructions Source: https://github.com/line/armeria/blob/main/gradle/scripts/README.md Create a `.post-release-msg` file in the project root to display custom instructions after tagging. The `${tag}` variable will be replaced with the actual tag name. ```text 1. Upload the artifacts to the staging repository: git checkout ${tag} ./gradlew --no-daemon clean publish 2. Close and release the staging repository at: https://oss.sonatype.org/ 3. Update the release note. 4. Deploy the web site. ``` -------------------------------- ### Add Example Requests to Documentation Service Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/advanced/spring-boot-integration.mdx Customize the documentation service by providing example requests for specific methods using a DocServiceConfigurator bean. ```java @Bean public DocServiceConfigurator docServiceConfigurator() { return docServiceBuilder -> docServiceBuilder .exampleRequests(TodoAnnotatedService.class, "create", "{\"id\":\"42\", \"value\":\"foo bar\"}"); } ``` -------------------------------- ### Build and Run with Gradle Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/tutorials/grpc/02-run-service.mdx Execute the Gradle wrapper script to build and run the application. This command compiles your Java code and starts the Armeria server. ```bash ./gradlew run ``` -------------------------------- ### Install async-profiler Source: https://github.com/line/armeria/blob/main/benchmarks/jmh/README.md Steps to clone and build the async-profiler tool from its GitHub repository. This tool is used for generating flame graphs. ```bash $ cd "$HOME" $ git clone https://github.com/async-profiler/async-profiler.git $ cd async-profiler $ make ``` -------------------------------- ### Install Prometheus using Helm Source: https://github.com/line/armeria/blob/main/site-new/src/content/blog/en/2019-12-23-monitoring-a-spring-boot-app-in-kubernetes-what-i-learned-from-devoxx-belgium-2019.mdx Installs Prometheus in the Kubernetes cluster using the Helm package manager. This command deploys Prometheus with default configurations. ```bash $ helm install my-prometheus stable/prometheus ``` -------------------------------- ### Install Helm Package Manager Source: https://github.com/line/armeria/blob/main/site-new/src/content/blog/en/2019-12-23-monitoring-a-spring-boot-app-in-kubernetes-what-i-learned-from-devoxx-belgium-2019.mdx Install Helm, a package manager for Kubernetes, using Homebrew. Helm simplifies the deployment and management of applications on Kubernetes. ```bash $ brew install helm ``` -------------------------------- ### Initialize Blog Service State Source: https://github.com/line/armeria/blob/main/site-new/src/content/docs/tutorials/grpc/03-implement-create.mdx Initialize the `BlogService` with an atomic integer for ID generation and a concurrent hash map for storing blog posts. This setup is required before implementing service methods. ```java import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; public final class BlogService extends BlogServiceGrpc.BlogServiceImplBase { private final AtomicInteger idGenerator = new AtomicInteger(); private final Map blogPosts = new ConcurrentHashMap<>(); } ```