Apache MINA: High-performance Network Applications Framework
Apache MINA is a robust framework for building high-performance network applications. With features like non-blocking I/O, event-driven architecture, and enhanced scalability, MINA provides a reliable platform for developing multipurpose infrastructure and networked applications. Its strengths lie in its mature API, performance optimization, and low latency, making it a preferred choice for developers working on network-centric projects. Various organizations, including Apache, Tigris, and Openfire, utilize MINA for services like LDAP, SMTP, and Jabber/XMPP. The framework's engine facilitates asynchronous operations and supports efficient handling of network connections. By leveraging MINA, developers can enhance their application's performance, scalability, and reliability in network communications.
Download Presentation
Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
E N D
Presentation Transcript
Apache MINA Apache MINA High-performance network applications
Multipurpose Infrastructure Networked Application http://mina.apache.org 2
Where? Where? frontend full stack - developer 3
Design Design Smart Inversion of control pattern (good for Spring) Bad scalability ver. 2.0 since 2012 4
Strengths Strengths Maturity ( 2006 -> v.1.0, v.1.1, , v.2.x -> 2016) API simplification Performance boost (almost like C/C++) Low latency v.2.0 decreased connection latency Queueing sessions Delegated to Executor (i.e. java.util.concurrent.ThreadPoolExecutor) 5
Who is using it? Who is using it? Apache (LDAPv3, NTP, DNS, DHCP, Kerberos) Tigris (SMTP) Openfire (Jabber/XMPP) 6
Engine 1/3 Engine 1/3 NIO Non Blocking Async Event-Driven Agnostic Framework ByteBuffer (very powerfull, v2 Heap only, no Stack and no Pooling) Future (unlike java5) Blocking functions avail Callbacks on completion Single thread for new connections 7
public public class class My MyHandler Handler extends extends IoHandlerAdapter{ acceptor.getFilterChain().addLast( "logger", new acceptor.getFilterChain().addLast( "codec", @Override @Override new LoggingFilter()); public public Server() throws // Create a TCP acceptor IoAcceptoracceptor= new // Associate the acceptor to an IoHandler instance (your application) acceptor.setHandler( ); // Bind : this will start the server... acceptor.bind(new new InetSocketAddress(PORT)); } public public void sessionIdle(IoSessionsession,IdleStatusstatus) throws } throws IOException{ new new ProtocolCodecFilter( new new TextLineCodecFactory( public public void exceptionCaught(IoSessionsession,Throwablecause) throws Engine 2/3 Engine 2/3 throws Exception{ } new NioSocketAcceptor(); Charset.forName( "UTF-8" )))); @Override @Override public public void messageReceived(IoSessionsession,Objectmessage) throws throws Exception{ } @Override @Override throws Exception { } Service Filter Handler Filter Processor Filter Connector public public Server() throws // Create a TCP connector NioSocketConnectorconnector= new throws Throwable{ App. Logic new NioSocketConnector(); Service Filter Filter Handler Processor connector.setHandler( // Bind : this will connect to server... IoSession session; try try { ConnectFuturefuture=connector.connect(new future.awaitUninterruptibly(); session=future.getSession(); } } Filter ); Acceptor connector.getFilterChain().addLast("codec", new new InetSocketAddress(HOSTNAME, PORT)); new ProtocolCodecFilter( new new SumUpProtocolCodecFactory(false false))); 8
Engine 3/3 Engine 3/3 Write Service Filter Handler Filter Processor Filter Connector App. Logic Service Filter Filter Handler Processor Filter Acceptor Read Reusability Hot Deployment All events 9
Pre Pre- -set features set features All famous network protocols as application (FTP, HTTP/s, Proxy, Firewall, Traffic Shaper, DNS, NTP, ) Many codecs on IoBuffer (aka ByteBuffer) Blacklists, Logging, SSL/TLS, Compression DI & Spring Framework 10
Clone Desktop to TV via Clone Desktop to TV via Wifi Wifi Screen Recorder 30fps MINA MINA@Pi3 de- compressing media compressing media pics pics 11
Converting chat from TCP to UDP Converting chat from TCP to UDP Chat Server Jabber/XMPP (TCP) TCP TCP Chat Proxy (MINA) NAT w UDP-2-TCP conversion High-bandwidth internet Low-bandwidth internet UDP UDP 12
Q? Q? Branislav Bajlovski, VP/CTO @ Sourcico 13