This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| com.linecorp.armeria.common.ProtocolViolationException: java.lang.NullPointerException | |
| at com.linecorp.armeria.client.Http1ResponseDecoder.channelRead(Http1ResponseDecoder.java:144) | |
| at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) | |
| at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) | |
| at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) | |
| at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438) | |
| at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:328) | |
| at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:302) | |
| at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253) | |
| at io.netty.channel.AbstractChannelHandlerContext.invokeChannelR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Armeria 0.67.1 | |
| // armeria-shaded | |
| // armeria-spring-boot-starter-shaded | |
| public class MySpringBootAppTest { | |
| @Rule | |
| public final MockitoRule rule = MockitoJUnit.rule(); | |
| @Mock | |
| private MyService.Iface iface; | |
| @Test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Configuration { | |
| @Bean | |
| HttpServiceRegistrationBean springMvcTomcatService(ServletWebServerApplicationContext applicationContext) { | |
| TomcatWebServer container = (TomcatWebServer) applicationContext.getWebServer(); | |
| // Starts the container explicitly to make sure all connectors are write back from serviceConnectors. | |
| container.start(); | |
| Connector tomcatConnector = container.getTomcat().getConnector(); | |
| return new HttpServiceRegistrationBean() | |
| .setServiceName("MyService") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "rawData": { | |
| "fortune": {}, | |
| "plaintext": { | |
| "netty": [ | |
| { | |
| "latencyAvg": "15.21ms", | |
| "latencyMax": "271.43ms", | |
| "latencyStdev": "13.85ms", | |
| "totalRequests": 2590928, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "Thread-7" #205 daemon prio=5 os_prio=0 tid=0x00007f4b6007f000 nid=0x1a641 runnable [0x00007f4c38fba000] | |
| java.lang.Thread.State: RUNNABLE | |
| at org.LatencyUtils.TimeCappedMovingAverageIntervalEstimator.determineNumberOfWindowPositionsOutsideOfTimeCap(TimeCappedMovingAverageIntervalEstimator.java:266) | |
| at org.LatencyUtils.TimeCappedMovingAverageIntervalEstimator.determineEarliestQualifyingTimeInWindow(TimeCappedMovingAverageIntervalEstimator.java:228) | |
| at org.LatencyUtils.TimeCappedMovingAverageIntervalEstimator.getEstimatedInterval(TimeCappedMovingAverageIntervalEstimator.java:107) | |
| - locked <0x00000001da96b688> (a org.LatencyUtils.TimeCappedMovingAverageIntervalEstimator) | |
| at org.LatencyUtils.LatencyStats.recordDetectedPause(LatencyStats.java:402) | |
| - locked <0x00000001da960c30> (a org.LatencyUtils.LatencyStats) | |
| at org.LatencyUtils.LatencyStats.access$600(LatencyStats.java:69) | |
| at org.LatencyUtils.LatencyStats$PauseTracker.handlePauseEvent(LatencyStats.java:480) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.linecorp.armeria.client.ClientFactory; | |
| import com.linecorp.armeria.client.ClientFactoryBuilder; | |
| import com.linecorp.armeria.client.HttpClient; | |
| import com.linecorp.armeria.client.HttpClientBuilder; | |
| import com.linecorp.armeria.client.metric.MetricCollectingClient; | |
| import com.linecorp.armeria.common.AggregatedHttpMessage; | |
| import com.linecorp.armeria.common.HttpResponse; | |
| import com.linecorp.armeria.common.SessionProtocol; | |
| import com.linecorp.armeria.common.metric.MeterIdPrefixFunction; | |
| import com.linecorp.armeria.common.metric.PrometheusMeterRegistries; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public final class ExceptionHandlingHttpService extends SimpleDecoratingService<HttpRequest, HttpResponse> { | |
| @Value(staticConstructor = "of") | |
| private static class ExceptionHandler { | |
| Class<? extends Throwable> exceptionType; | |
| BiFunction<HttpRequest, Throwable, HttpResponse> exceptionHandler; | |
| } | |
| private final ExceptionHandler defaultExceptionHandler = | |
| ExceptionHandler.of(Throwable.class, ExceptionHandlingHttpService::error); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.linecorp.armeria.server.annotation; | |
| import com.fasterxml.jackson.databind.ObjectMapper; | |
| import com.linecorp.armeria.common.DefaultHttpResponse; | |
| import com.linecorp.armeria.common.HttpData; | |
| import com.linecorp.armeria.common.HttpHeaderNames; | |
| import com.linecorp.armeria.common.HttpHeaders; | |
| import com.linecorp.armeria.common.HttpResponse; | |
| import com.linecorp.armeria.common.HttpStatus; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 16777216 byte(s) of direct memory (used: 4278190374, max: 4294967296) | |
| at io.netty.util.internal.PlatformDependent.incrementMemoryCounter(PlatformDependent.java:585) | |
| at io.netty.util.internal.PlatformDependent.allocateDirectNoCleaner(PlatformDependent.java:539) | |
| at io.netty.buffer.PoolArena$DirectArena.allocateDirect(PoolArena.java:760) | |
| at io.netty.buffer.PoolArena$DirectArena.newChunk(PoolArena.java:736) | |
| at io.netty.buffer.PoolArena.allocateNormal(PoolArena.java:244) | |
| at io.netty.buffer.PoolArena.allocate(PoolArena.java:226) | |
| at io.netty.buffer.PoolArena.allocate(PoolArena.java:146) | |
| at io.netty.buffer.PooledByteBufAllocator.newDirectBuffer(PooledByteBufAllocator.java:320) | |
| at io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:181) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private final class Handler implements HelloService.AsyncIface { | |
| @Override | |
| public void hello(String name, AsyncMethodCallback resultHandler) throws TException { | |
| setAsyncResult(resultHandler, CompletableFuture.completedFuture("hello")); | |
| } | |
| } | |
| public static <T> void setAsyncResult(AsyncMethodCallback<T> resultHandler, | |
| ListenableFuture<T> future) { | |
| Futures.addCallback(future, new FutureCallback<T>() { |
NewerOlder