Questions tagged [netty]

An open source asynchronous event-driven network application framework written in Java. It is a NIO client server framework which enables quick and easy development of network applications such as protocol servers and clients

Netty is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients.

If you have a question about using Netty in your network application, this is the tag you should use.

Useful Links

  • Netty home page provides a user guide, JavaDoc, and various examples. Please make sure to read the user guide before posting a question. Otherwise you have a very high chance of asking a trivial question.
  • User mailing list archive contains a number of questions and answers related with Netty. If you failed to find the answer for your question, you might want to search this archive before posting the question at StackOverflow.
  • Wikipedia page

Using as a dependency in a maven project

Netty can be used in combination with the dependency system from maven.

Depending on your use case, you can either include "netty-all", or add all the modules you use separately. The following examples give an example how to use netty-all in combination with maven.

The following should be placed under the <dependencies> tag in .

Latest SNAPSHOT

<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-all</artifactId>
    <version>5.0.0.Alpha3-SNAPSHOT</version>
</dependency>

Latest Beta

<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-all</artifactId>
    <version>5.0.0.Alpha3</version>
</dependency>

Latest Alpha

<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-all</artifactId>
    <version>4.1.0.Beta8</version>
</dependency>

Latest Final

<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-all</artifactId>
    <version>4.0.35.Final</version>
</dependency>
4961 questions
21
votes
2 answers

Enforce SSL on Play! Framework

I'm currently using Play! 1.2.2 and its new Netty client framework. I haven't found a straightforward method to enforce SSL, although can get HTTP and HTTPS to serve asynchronously. Does anyone that's worked with Play! have a straightforward method…
crockpotveggies
  • 12,682
  • 12
  • 70
  • 140
21
votes
2 answers

In Netty 4, what's the difference between ctx.close and ctx.channel.close?

Is there any difference? Is ctx.close just a shorter version of ctx.channel.close?
Ngoc Dao
  • 1,501
  • 3
  • 18
  • 27
20
votes
2 answers

Netty 4 - EventLoopGroup - EventLoop - EventExecutor - Thread affinity

I am studying the Netty 4.0.0.Alpha5 code in order to find out how threading is handled. I also read the introduction to the new threading model of Netty 4 at http://netty.io/wiki/new-and-noteworthy-in-4.0.html#wiki-h2-34. As I understand it, the…
user1752169
  • 383
  • 2
  • 7
19
votes
2 answers

Does gRPC server spin up a new thread for each request?

I tried profiling a gRPC java server. And i see the below set of thread pools majorly. grpc-default-executor Threads : Created 1 for each incoming request. grpc-default-worker-ELG Threads: May be to listen on the incoming gRPC requests & assign to…
Venkata Naresh
  • 377
  • 1
  • 2
  • 9
19
votes
2 answers

Differences between Akka HTTP and Netty

Can someone please explain the major differences between Akka HTTP and Netty? Netty offers other protocols like FTP as well. Akka HTTP can be used in Scala and Java and is build on the actor model. But apart from this both are asynchronous. When…
Kris
  • 4,595
  • 7
  • 32
  • 50
19
votes
1 answer

Connecting a client to a TCP server using TLS 1.2

I'm trying with no luck to connect a device to a .Net (4.5.2) server. It's a TCP connection opened by the device, that uses TLS 1.2. On the server side, I have a standard .Net implementation of a TCP Server: SslStream wrapped through DotNetty I…
ken2k
  • 48,145
  • 10
  • 116
  • 176
19
votes
2 answers

Are Websockets adapted to very long-lived connections?

I'm thinking about using web sockets with Netty for an application where clients connect to a server to get some information at first. Then, they are registered by the server and any changes on the information of a particular client will trigger a…
manash
  • 6,985
  • 12
  • 65
  • 125
19
votes
3 answers

Books and articles on Netty

Are there some good articles/books about how to use Netty? The documentation is short, and it's not simple for me to learn from the Javadoc. Thanks
manash
  • 6,985
  • 12
  • 65
  • 125
18
votes
2 answers

Benefits of having HTTP endpoints return Flux/Mono instances instead of DTOs

I've watched Spring Tips: Functional Reactive Endpoints with Spring Framework 5.0 and read a little about spring reactor but I can't quite understand it. What are the benefits of having endpoints return Flux/Mono instances (jacksonified) instead of…
18
votes
1 answer

How to fix the "Found Netty's native epoll transport in the classpath, but epoll is not available. Using NIO instead" warning?

I am using Cassandra and, during startup, Netty prints a warning with a stack trace: Found Netty's native epoll transport in the classpath, but epoll is not available. Using NIO instead." The application works normally, but is there a way to fix…
Philipp Claßen
  • 41,306
  • 31
  • 146
  • 239
18
votes
2 answers

How to turn off Netty library debug output?

I am using Netty (via the Ning async HTTP library) to retrieve documents via HTTP. This produces a huge amount of debug output the console, as listed below for a single document request. Anyone know how to turn this off? I really don't need to see…
Jonathan Stray
  • 2,708
  • 2
  • 26
  • 32
17
votes
7 answers

Netty + ProtoBuffer: A few communication messages for one connection

While reading the Netty tutorial, I've found a simple description of how to integrate Netty and Google Protocol Buffers. I've started to investigate its example (because there is no more information in the documentation) and written a simple…
Sergii Zagriichuk
  • 5,389
  • 5
  • 28
  • 45
17
votes
4 answers

Servlet API implementation using Netty

Has anyone made a Servlet API implementation built on top of Netty? I'm tempted to build my own as I can't google an implementation. http://www.jboss.org/netty/community#nabble-td4752485 http://markmail.org/message/4qmvuaacxqzevqhc Basically I'm…
Adam Gent
  • 47,843
  • 23
  • 153
  • 203
17
votes
2 answers

Monitoring the size of the Netty event loop queues

We've implemented monitoring for the Netty event loop queues in order to understand issues with some of our Netty modules. The monitor uses the io.netty.util.concurrent.SingleThreadEventExecutor#pendingTasks method, which works for most modules, but…
Eran Harel
  • 2,325
  • 19
  • 28
17
votes
3 answers

Shutdown netty programmatically

I'm using netty 4.0.24.Final. I need to start/stop netty server programmatically. On starting the server, the thread gets blocked at f.channel().closeFuture().sync() Please help with some hints how to do it correctly. Below is the EchoServer that…
fh76
  • 283
  • 2
  • 5
  • 14