Welcome to Apache MINA

Overview

Apache MINA is a network application framework which helps users develop high performance and high scalability network applications easily. It provides an abstract · event-driven · asynchronous API over various transports such as TCP/IP and UDP/IP via Java NIO.

Apache MINA is often called:

  • NIO framework · library,
  • client · server framework · library, or
  • a networking · socket library.

However, it’s much more than that. Please take a look around the list of the features that enable rapid network application development, and what people says about MINA.

Please grab yourself a 2.0.x download or a 2.1.x download, try our Quick Start Guide, surf our FAQ or start join us on our community

News

MINA 2.2.3, 2.1.8, 2.0.25 released posted on September, 12, 2023

The MINA project is pleased to announce the MINA 2.2.3, 2.1.8 and 2.0.25 release.

Changes

Those versions are fixing some Datagram session issue:

  • DIRMINA-996 IoSessionRecycler RemoteAddress Collision
  • DIRMINA-1172 Multiple DatagramAcceptors and the creation of a session object

MINA 2.2.2, 2.1.7, 2.0.24 released posted on June, 05, 2023

The MINA project is pleased to announce the MINA 2.2.2, 2.1.7 and 2.0.24 release.

Changes

Those versions are fixing some SSL/TLS issues and bring some added features:

  • DIRMINA-1122 support for endpoint identification algorithm (thanks to Marcin L)
  • DIRMINA-1157 A fix for a sporadic SSL/TLS connection establishement for version 2.0.X and 2.1.X (thanks to Steffen Liersch)
  • DIRMINA-1169 A fix in the Acceptor for Java 11 and upper (thanks to Thomas Wolf)

MINA 2.2.1 released posted on july, 24, 2022

The MINA project is pleased to announce the MINA 2.2.1 release.

Changes

This new version is just a fix in some OSGi export declaration that was done wrong in the previous release.

MINA 2.2.0 released posted on july, 19, 2022

The MINA project is pleased to announce the MINA 2.2.0 release.

Changes

This new version comes with complete rewrite of the SSL/TLS layer. The previous implementation had some flaws that were difficult to fix or workaround, and with the arrival of TLS-1.3, it was the opportunity to review and recode this part, which is the main change.

For any information about the API modifications and the impact on existing application, please read the 2.2 vs 2.1 page.

MINA 2.1.6 & MINA 2.0.23 released posted on Februray, 18, 2022

The MINA project is pleased to announce two new releases, MINA 2.1.6 and MINA 2.0.23.

MINA 2.1.6 fixes

Here is the list of fixed issues :

  • DIRMINA-1152 IoServiceStatistics introduces huge latencies
  • DIRMINA-1156 Inconsistent worker / idleWorker in OrderedThreadPoolExecutor

It also contain some minor fixes (ignored tests being fixed, a minor infinite loop fixed in the Buffer toString() method if used in some corner case, etc)

For any information about the API modifications and the impact on existing application, please read the 2.1 vs 2.0 page.

MINA 2.0.23

This is a maintenance release for MINA 2.0.

It contains many backported issues from the 2.1 and 2.2 branches.

MINA 2.1.5 & MINA 2.0.22 released posted on October, 29, 2021

The MINA project is pleased to announce two new releases, MINA 2.1.5 and MINA 2.0.22.

These are fixing a critical issue, CVE-2021-41973

CVE-2021-41973: ‘Apache MINA HTTP listener DoS’

We urge anyone using any previous MINA version to migrate to one of those two new versions

MINA 2.1.4 released posted on August, 24, 2020

The MINA project is pleased to announce a new release, MINA 2.1.4. This is a bug fix release. Here are the fixed issues :

Bugs

  • DIRMINA-966 NIO Datagram messages can get duplicated when unable to be sent by the underlying DatagramChannel
  • DIRMINA-1014 SocketAcceptor doesn’t unbind correctly
  • DIRMINA-1115 Filter ProfilerTimerFilter ArithmeticException
  • DIRMINA-1123 Receive buffer size is never set for NIO acceptor
  • DIRMINA-1126 filterWrite in ProtocolCodecFilter can send corrupted writeRequest message to the next filter
  • DIRMINA-1064 Implement cipher suites preference flag introduced in JDK 8
  • DIRMINA-1105 SSLHandler buffer handling

For any information about the API modifications and the impact on existing application, please read the 2.1 vs 2.0 page.

MINA 2.1.3 released posted on June, 2, 2019

The MINA project is pleased to announce a new release, MINA 2.1.3. This is a bug fix release: it fixes a 100% CPU usage in some corner case. Here are the fixed issues :

  • DIRMINA-1095 Seems like the management f UDP sessions is really unneficient
  • DIRMINA-1107 SslHandler flushScheduledEvents race condition, redux
  • DIRMINA-1111 100% CPU (epoll bug) on 2.1.x, Linux only
  • DIRMINA-1104 IoBufferHexDumper.getHexdump(IoBuffer in, int lengthLimit) does not truncate the output

For any information about the API modifications and the impact on existing application, please read the 2.1 vs 2.0 page.

MINA 2.1.2 released posted on April, 20, 2019

The MINA project is pleased to announce a new release, MINA 2.1.2. This is a bug fix release: it fixes an issue for applications using SSL/TLS, which will stall waiting on a WriteFuture because it does not get signaled when the message has been fully sent.

For any information about the API modifications and the impact on existing application, please read the 2.1 vs 2.0 page.

MINA 2.1.1 & MINA 2.0.21 released posted on April, 14, 2019

The MINA project is pleased to announce two new releases, MINA 2.1.1 and MINA 2.0.21.

These are fixing a critical issue, CVE-2019-0231

CVE-2019-0231: ‘Handling of the close_notify SSL/TLS message does not lead to a connection closure, leading the server to retain the socket opened and to have the client potentially receive clear-text messages which were supposed to be encrypted.’

MINA 2.1.1 also fixes the CompressionFilter usage, by simplifying the way we proceed with writes. A side effect is that it should be slightly faster to write data from an application. (This fix is not included in 2.0.21)

We urge anyone using any previous MINA version to migrate to one of those two new versions

MINA 2.1.0 released posted on March, 14, 2019

The MINA project is pleased to announce a new release, MINA 2.1.0. This is a evolution over the 2.0.x branch, with some API modifications that makes it incompatible.

That means some effort will be required from applications to be able to use Apache MINA 2.1.0 as a replacement for Apache MINA 2.0.20.

Otherwise, every fix applied in Apache MINA 2.0.20 has been ported to this version, so one can still keep going with Apache MINA 2.0.20 which will be maintained for the coming months.

For any information about the API modifications and the impact on existing application, please read the 2.1 vs 2.0 page.

MINA 2.0.20 released posted on February, 24, 2019

The MINA project is pleased to announce a new release, MINA 2.0.20, fixing some API issues:

  • DIRMINA-1092 Removed a spurious printstacktrace
  • DIRMINA-1098 handshakeStatus variable has been wrongly made global
  • DIRMINA-1088 the OrderedThreadPool implementation has been made Java 10 compatible

We urge you to switch to this version if you were using MINA 2.0.19 or any older version.

MINA 2.0.19 released posted on June, 11, 2018

The MINA project is pleased to announce a new release, MINA 2.0.19, fixing some API regression:

  • the ‘event’ message has been removed from the IoHandler interface
  • the SESSION_SECURED/SESSION_UNSECURED message are back

Those changes have been introduced in MINA 2.0.18 by mistake, and break applications that were working with MINA 2.0.17.

They will be reintroduced in MINA 2.1.0

We urge you to switch to this version if you were using MINA 2.0.17 or any older version.

MINA 2.0.18 released posted on June, 1, 2018

The MINA project is pleased to announce a new bug fix release, MINA 2.0.18.

There is some important addition in this version, the IoHandler interface now exposes a new method :

void event(IoSession session, FilterEvent event) throws Exception;

This can be used by any filter to generate a specific event (which will be handled on demand by the application).

Currently, the only added event is defined in SslEvent, and it tells if the session has been secured (ie the Handshake has completed) or isn’t anymore.

It changes one thing in your application: if you were implementing IoHandler, you have to add this method. You may also extends IoHandlerAdapter which has a void implementation of this event() method.

The few fixes bugs/added features are:

  • Added a flag to tell the Handshake to start immediately or not
  • The IoBufferHexDumper implementation now does not modify the IoBuffer position
  • Some missing synchronization have been added in teh SslFilter
  • The suspendRead call is handled for Datagrams, instead of throwing an exception

We urge you to switch to this version if you were using MINA 2.0.17 or any older version.

MINA 2.0.17 released posted on March, 15, 2018

The MINA project is pleased to announce a new bug fix release, MINA 2.0.17. It fixes many issues, and adds the missing Javadoc.

Here are the fixed issues :

Bugs :

  • DIRMINA-844 - Http Proxy Authentication failed to complete (see description for exact point of failure)
  • DIRMINA-1002 - Mina IoHandlerEvents missing inputClosed enum item.
  • DIRMINA-1051 - The MD5withRSA cipher is not anymore supported by Java 8, and our tests certificates have been generated with it.
  • DIRMINA-1052 - Fix the mvn-site command
  • DIRMINA-1056 - IllegalArgumentException when setting max and minReadBufferSize > 65536 (default)
  • DIRMINA-1057 - AbstractIoSession getScheduledWriteMessages always -negative?
  • DIRMINA-1059 - NioProcessor’s selector is synchronized but accessed outside
  • DIRMINA-1060 - Handle the spinning selectors in Socket/Datagram Acceptor and Connector
  • DIRMINA-1072 - SslFilter does not account for SSLEngine runtime exceptions
  • DIRMINA-1073 - NioSocketSession#isSecured does not comply with interface contract
  • DIRMINA-1076 - Leaking NioProcessors/NioSocketConnectors hanging in call to dispose
  • DIRMINA-1077 - Threads hanging in dispose() on SSLHandshakeException

Improvement :

  • DIRMINA-1061 - When AbstractPollingIoProcessor read nothing, free the temporary buffer should be better

Task :

We urge you to switch to this version if you were using MINA 2.0.16 or any older version.

MINA 2.0.16 released posted on October, 31, 2016

The MINA project is pleased to announce a new bug fix release, MINA 2.0.16. It fixes a critical SSL issue, and a regression introduced in 2.0.14.

Here are the fixed issues :

Bugs :

  • DIRMINA-1043 NullPointerException after upgrade to mina 2.0.14
  • DIRMINA-1044 Non-Secure (no TLS/SSL) based client could successfully send message to secure Mina endpoint after second attempt

We urge you to switch to this version if you were using MINA 2.0.15 or any older version.

MINA 2.0.15 released posted on September, 27, 2016

The MINA project is pleased to announce a new bug fix release, MINA 2.0.15. It fixes a hang, a NPE and a few other minor issues.

Here are the fixed issues :

Bugs :

  • DIRMINA-1041 WriteFuture.await() hangs when the connection is closed remotely before await is invoked
  • DIRMINA-1047 NullPointerException in AbstractIoSession.destroy()
  • DIRMINA-1049 Error in mina-statemachine manifest prevents using it in Apache Karaf

We urge you to switch to this version if you were using MINA 2.0.14 or any older version.

MINA 2.0.14 released posted on August, 30, 2016

The MINA project is pleased to announce a new bug fix release, MINA 2.0.14. It fixes many issues, some of them being a real burden for SSHD DIRMINA-1021). Some patches were also applied (thanks to Maria Petridan).

Here are the fixed issues :

Bugs :

  • DIRMINA-760 Client fails to detect disconnection
  • DIRMINA-976 ScheduledWriteBytes Increases after Exception on Writing
  • DIRMINA-1021 MINA-CORE does not remove sessions if exceptions occur while closing
  • DIRMINA-1025 A call to session.closed(true) may still flush messages.
  • DIRMINA-1028 The supported ciphers configuration might not be used
  • DIRMINA-1029 The sent buffer is reset to its original position when using the SSL Filter after a session.write()
  • DIRMINA-1037 Throw exception in NioProcessor.write if the session is closing
  • DIRMINA-1039 Response messages queue up on the server side waiting to be written to socket, while the server continues to read more request messages, causing out of heap memory
  • DIRMINA-1042 Epoll spinning causes memory leak

Task :

  • DIRMINA-986 Update the web site to reflect the switch to git for the release process
  1. SSLHandler writes corrupt messages under heavy load

A security issue has also been fixed in this version.

We urge you to switch to this version if you were using MINA 2.0.13.

MINA 2.0.13 released posted on February, 16, 2016

Another release to fix a critical SSL bug ( a race condition which could lead to a deadlock in some corner cases).

We urge you to switch to this version if you were using MINA 2.0.12.

Bugs :

  • DIRMINA-1019 SslHandler flushScheduledEvents race condition
  • DIRMINA-1027 SSLHandler writes corrupt messages under heavy load

MINA 2.0.12 released posted on February, 07, 2016

This new release of MINA is a bug fix release. There are a few new bugs that were wound in the way we handle closure, leading to some infinite loop consuming 100% CPU, and a bad counter update forbidding the main loop to be exited.

We urge you to switch to this version if you were using MINA 2.0.11.

Bugs :

  • DIRMINA-1001 mina2.0.9 session.close cpu100%
  • DIRMINA-1006 mina2.0.9 NioProcessor thread make cpu 100%
  • DIRMINA-1024 There is no way to start a SslHandshake when the autoStart flag is set to false
  • DIRMINA-1026 Session may be removed twice from the removedSession queue

MINA 2.0.11 released posted on January, 26, 2016

This new release of MINA is a bug fix release. We have found a critical bug in the SSL Handler, that may cause a loop when dealing with big messages being transmitted over an SSL connection.

Otherwise, thee Javadoc has been cleaned.

We urge you to switch to this version if you were using MINA 2.0.10.

Bugs :

  • DIRMINA-1023 - Infinite loop in SslHandler when the AppBuffer is too small
  • DIRMINA-1022 - The IoBuffer.fill(byte, int) method does not work when byte > 0x7F

Improvements :

MINA 2.0.10 released posted on December, 16, 2015

This new release of MINA is a bug fix release. Among important fixes, we have removed a bottleneck in the way we were using Codecs, removed a deadlock in SSL when using the proxy, a race condition, and a few other things :

Bugs :

  • DIRMINA-992 - NioSocketConnector.newHandle throws the wrong exception
  • DIRMINA-994 - The ConnectionRequest.cancel() method is inconsistent wrt concurrent access
  • DIRMINA-995 - Deadlock when using SSL and proxy
  • DIRMINA-1013 - Threading model is suppressed by ProtocolCodecFilter
  • DIRMINA-1016 - Regression with 2.0.9: Missing javax.net.ssl import in manifest
  • DIRMINA-1017 - SSLEngine BUFFER_OVERFLOW (unwrap)
  • DIRMINA-1019 - SslHandler flushScheduledEvents race condition

Improvements :

MINA 2.0.9 released posted on October, 25, 2014

This new release of MINA is just a bug fix release. A few issues have been fixed, one critical, inducing a 100% CPU, and one was annoying as it was generating stack traces for nothing.

You can check the list of fixes for this version there :

Release note

  • DIRMINA-921 - Maven build fails if test phase is given
  • DIRMINA-988 - 100% CPU when using IoBuffer.shrink() method in some cases
  • DIRMINA-989 - Frequent CancelledKeyException
  • DIRMINA-990 - Control flow over exceptional path in AbstractIoBuffer
  • DIRMINA-991 - Possible faster deserialization in AbstractIoBuffer object deserialization.

MINA 2.0.8 released posted on September, 22, 2014

It’s 2 years we haven’t had a release of MINA 2.0, it’s about time.

We have tried to fix as much issues as we could in the last 3 weeks. As a result, we have closed around 90 JIRAs (fixed, postponed or simply discarded).

There is one change that might break the build for those switching from MINA 2.0.7 to MINA 2.0.8 : the IoHandler interface now has a method called inputClosed(), so either you have to implement this method if you are directly implementing the IoHandler interface, or better, you can extends IoHandlerAdapter, which implements a placeholder for this method.

You can check the list of fixes for this version there :

Release note

Bug

  • DIRMINA-539 - NioDatagramConnector doesn’t takes the TrafficClass value set to his DatagramSessionConfig
  • DIRMINA-574 - ClassCastException when a message is written on a closed session.
  • DIRMINA-604 - Deadlock occurs when implementing two mina StateMachine
  • DIRMINA-639 - WriteFuture are updated long after a session.write() is done
  • DIRMINA-738 - Using IoEventQueueThrottler with a WriteRequestFilter can lead to hangs
  • DIRMINA-760 - Client fails to detect disconnection
  • DIRMINA-764 - DDOS possible in only a few seconds…
  • DIRMINA-777 - IoSessionConfig.setUseReadOperation(true) doesn’t seem to work
  • DIRMINA-779 - SSLHandler can re-order data that it reads
  • DIRMINA-782 - Combination of SslFilter & FileRegionWriteFilter causes messageSent events to be lost
  • DIRMINA-785 - Half-duplex close of TCP channel
  • DIRMINA-789 - Possible Deadlock/Out of memory when sending large amounts of data using Nio
  • DIRMINA-792 - await() forever
  • DIRMINA-804 - NioDatagramAcceptor.unbind does not unbind cleanly
  • DIRMINA-805 - No cipher suites and protocols in SslFilter
  • DIRMINA-813 - Starvation occurs sometimes in SerialSession#close()
  • DIRMINA-818 - Loosing connects on NioSocketConnector
  • DIRMINA-833 - LoggingFilter does not log SENT bytes when used with a ProtocolCodecFilter
  • DIRMINA-843 - NioSocketAcceptor does not provide an interface to input connectiontimeout parameter.
  • DIRMINA-844 - Http Proxy Authentication failed to complete (see description for exact point of failure)
  • DIRMINA-845 - ProtocolEncoderOutputImpl isn’t thread-safe
  • DIRMINA-891 - SSLHandler throws SSLException during handshake that sequence number triggers
  • DIRMINA-899 - IoSession.getAttribute() doesn’t store default value
  • DIRMINA-902 - Buffer read incorrectly when reading after a NEED_DATA trigger.
  • DIRMINA-905 - mina serial close
  • DIRMINA-911 - Surprising behaviour with ConnectFuture
  • DIRMINA-912 - Different instances of OrderedThreadPoolExecutor may use same task queue
  • DIRMINA-920 - HTTP server decoding is broken
  • DIRMINA-926 - IoSession IP Error when Socket Server Communicate With Microcomputer In LAN and Internet.
  • DIRMINA-928 - when client want to connect to server by binding wrong ip address,there is a bug.
  • DIRMINA-931 - HTTP header decoding is broken
  • DIRMINA-932 - HTTP Request decoding is broken if request headers are received in several messages
  • DIRMINA-933 - subtle HttpServerDecoder problems
  • DIRMINA-937 - sslfilter hangs with openjdk works with oracle?
  • DIRMINA-940 - HTTP Client decoder does not support responses without Content-Length header
  • DIRMINA-942 - Infinite loop flushing to broken pipe
  • DIRMINA-948 - Performance recession when invoke session.write concurrent
  • DIRMINA-956 - Status code match bug in AbstractHttpLogicHandler
  • DIRMINA-957 - MINA build in BlacklistFilter does not support IPV6 address
  • DIRMINA-962 - Immediate session close with a SSL filter
  • DIRMINA-963 - Socks5 and ProxyConnector don’t work with InetSocketAddress.createUnresolved
  • DIRMINA-965 - HttpServerDecoder is broken in certain condition
  • DIRMINA-966 - NIO Datagram messages can get duplicated when unable to be sent by the underlying DatagramChannel
  • DIRMINA-967 - IoSession updateThroughput not automatically called
  • DIRMINA-968 - Memory leak in SSL Handshake errors
  • DIRMINA-970 - ProtocolEncoderOutputImpl.flush() occur a IllegalArgumentException
  • DIRMINA-972 - NPE during handshake on Android using SSLFilter
  • DIRMINA-973 - IllegalArgumentException thrown on ProtocolCodecFilter.flush
  • DIRMINA-976 - ScheduledWriteBytes Increases after Exception on Writing
  • DIRMINA-977 - DefaultIoFilterChain.replace does not call register/deregister
  • DIRMINA-978 - ClosedSelectorException handling in AbstractPollingIoProcessor
  • DIRMINA-980 - Missing implementation of write() method in SerialSessionImpl.SerialIoProcessor
  • DIRMINA-981 - IoBuffer GetSlice throw an IllegalArgumentException
  • DIRMINA-982 - ProtocolEncoderOutputImpl.flush() throws an IllegalArgumentException if buffers queue is empty
  • DIRMINA-983 - Problems with TextLineDecoder and special characters

Improvement

  • DIRMINA-210 - Investigate removal of static methods in ByteBuffer
  • DIRMINA-237 - Improve Spring integration
  • DIRMINA-572 - Add Spring support for Mina statemachine
  • DIRMINA-586 - Dynamic delimiter support for TextLineCodecFactory
  • DIRMINA-593 - Javadoc & documentation for org/apache/mina/filter/reqres
  • DIRMINA-629 - The IoServiceStatistics methods are called for every new session creation
  • DIRMINA-631 - AbstractIoFilter: increment written- and receivedMessages statistics on application end of filter chain
  • DIRMINA-668 - Modify the way we use IoProcessors
  • DIRMINA-682 - We need a better documentation for the ExecutorFilter [was :Writing more than one message will block until the MessageReceived as been fully proceced]
  • DIRMINA-723 - OrderedThreadPoolExecutor behavior: configurable queue size, corePoolSize, maximumPoolSize
  • DIRMINA-752 - maybe move SerialAddressEditor.class to the mina beans project
  • DIRMINA-761 - how to shutdown a mina application
  • DIRMINA-766 - Read does not exploit buffer optimally
  • DIRMINA-767 - Move encoder/decoder out of the session Attributes
  • DIRMINA-773 - org.apache.mina.filter.firewall.Subnet should consider 0.0.0.0/0 as a subnet that contains ‘all the ipv4 addresses’
  • DIRMINA-780 - Writing null objects to the Session should raise an Exception
  • DIRMINA-825 - Add host and port info to BindException thrown by NioSocketAcceptor#open
  • DIRMINA-838 - Redundant AttributeKey allocation resulting in high garbage collector activity
  • DIRMINA-913 - Add a method IoSession.isSecured() to tell the user if the SSL filter has been started or not
  • DIRMINA-921 - Maven build fails if test phase is given
  • DIRMINA-929 - AbstractPollingIoProcessor patch to mark buffer as free
  • DIRMINA-934 - Replace synchronized with a Semaphore for better performance
  • DIRMINA-941 - DefaultIoFilterChain (or any other class) should not catch Throwable without re-throwing
  • DIRMINA-945 - DefaultVmPipeSessionConfig is empty

New Feature

  • DIRMINA-23 - New transport type: non-NIO sockets
  • DIRMINA-68 - Automatic reconnect configuration for client channels.
  • DIRMINA-389 - Create a Connection Throttle Filter
  • DIRMINA-453 - Multiple IoServices for one java.nio.Selector
  • DIRMINA-485 - SCTP Transport based on APR (Apache Portable Runtime)
  • DIRMINA-489 - Composite IoBuffer
  • DIRMINA-507 - IoBuffer: Support prepending data
  • DIRMINA-554 - A hook between bind() and accept()
  • DIRMINA-655 - Add a more general purpose text based decoder
  • DIRMINA-816 - NioSocketConnector missing defaultLocalAddress
  • DIRMINA-964 - Custom NIO SelectorProvider for NioSocketAcceptor

Task

  • DIRMINA-56 - Create a Benchmark Suite That Generates HTML Reports.
  • DIRMINA-188 - All-in-one JAR
  • DIRMINA-477 - Update page about differences between 1.x and 2.x
  • DIRMINA-721 - Get rid of multiton iohandler and netty2 codec as proposed on ML

Test

  • DIRMINA-922 - Add a benchmark project to compare with other IO frameworks

Wish

  • DIRMINA-250 - Provide a test suite for a transport implementor.
  • DIRMINA-916 - Adding Http Status code 101 “101 Switching Protocols” in org.apache.mina.http.api.HttpStatus

MINA 2.0.7 released posted on October, 12, 2012

The Apache MINA project is pleased to announce MINA 2.0.7 ! This version is a bug fix release.

It fixes a regression introduced in MINA 2.0.5, and some performance improvements for the UDP server.

We recommend all users to upgrade to this release. We consider this a stable and production ready release.

Release note1 Release note2

MINA 2.0.5 released posted on August, 26, 2012

The Apache MINA project is pleased to announce MINA 2.0.5 ! This version is a bug fix release.

We recommend all users to upgrade to this release. We consider this a stable and production ready release.

Release note

MINA 2.0.4 released posted on August, 26, 2012

The Apache MINA project is pleased to announce MINA 2.0.4 ! This version is a bug fix release.

We recommend all users to upgrade to this release. We consider this a stable and production ready release.

Release note