Professional Documents
Culture Documents
Trustin Lee
NHN Corporation
trustin@apache.org
http://people.apache.org/~trustin
Agenda
• Overview
• In-depth View
• Demonstration
• Future
• Conclusion
2
Agenda: Overview
• Overview
• What is MINA?
• Advantages
• References
• In-depth View
• Demonstration
• Future
• Conclusion
3
Overview
What is MINA?
A Multi-purpose
Infrastructure
for Network
Applications
4
Overview
What is MINA?
• Network application framework for Java
• Abstract API
• Event-driven
• Asynchronous
• Implementations
• NIO Socket & Datagram
• <Your favorite transport>
5
Overview
Advantages: Productivity
• Unit test friendly
• Abstract API + mock objects
• Extensible
• Runtime modification of application behavior
using ‘filters’
• Maintainable and Reusable
• Separation of networking code (MINA),
protocol codec, and business logic
6
Overview
Advantages: Performance
• AMQP Test
• Client and server
• 4 dual-core Opterons
• Via Gigabits Ethernet
• 10 clients
• Payload: 256+ bytes (excl. AMQP headers)
• Avg : 180,000 msg/sec
• Max: 220,000 msg/sec
Courtesy of Robert J. Greig, JP Morgan Chase & Co.
7
Overview
Advantages: Stability
• API design
• Running toward 1.0 fast
• Implementation
• We’ve been doing this since 2004
8
Overview
9
Overview
• Proprietary projects
• XMPP (Jabber · GTalk) implementation
• SMS · MMS Gateways
• And many more!
10
Agenda: In-depth View
• Overview
• In-depth View
• At a Glance
• Core Constructs
• In-VM Pipe
• Demonstration
• Future
• Conclusion
11
In-depth
At a GlanceLegend
Remote Peer Core
Extension Point
Low-level
Low-level
I/O Protocol Implementation
I/O
IoService
Filtered I/O
Performs Actual I/O
I/O Event
Request
IoFilterChain
IoFilter #1
IoFilter #2 Filters Events & Requests
IoFilter #3
Filtered I/O
Request
Event
I/O
A Connection
IoSession
IoHandler <Your Protocol Logic>
12
In-depth
IoService
IoSessionManager
IoService
Server-side: Client-side:
Accepts clients Connects to a server
IoAcceptor IoConnector
And their
nio::SocketAcceptor nio::SocketConnector
implementations
nio::DatagramAcceptor nio::DatagramConnector
v mpipe::VmPipeAcceptor v mpipe::VmPipeConnector
13
In-depth
IoFilter
• An event & request interceptor
• Reusable
• Hot-deployable
• SSL · TLS • Logger
• Thread pool • Overload detector
• Performance profiler • Traffic shaper
• Lightweight firewall • Authorization
14
In-depth
ThreadPoolFilter
No thread pool: single thread setting for minimal latency
IoAcceptor IoHandler
Thread
IoAcceptor Pool IoHandler
Filter
More than one thread pool: special setting for CPU-intensive jobs
CPU-
Thread Thread
intensive
IoAcceptor Pool Pool IoHandler
jobs
Filter Filter
(IoFilter)
15
In-depth
ProtocolCodecFilter
• Clear separation and reusability
16
In-depth
ProtocolCodecFilter Legend
Remote Peer Core
Extension Point
Low-level
Low-level
Protocol Implementation
I/O
I/O
IoService
Filtered I/O
I/O Event
Request
P
E ro
to
IoFilterChain
n
co co POJO → ByteB
d l
Encode
e
r C
o uffer
ProtocolCodecFilter d
D e
e c
Decode co F
a ByteBuffer
d ct
e
r o
ry → POJO
Filtered I/O
Request
Event
I/O
IoSession
IoHandler → Business Logic Only!
17
In-depth
In-VM Pipe
I/O events are converted into
18
Agenda: Demonstration
• Overview
• In-depth View
• Demonstration
• Future
• Conclusion
19
Example
20
Agenda: Future
• Overview
• In-depth View
• Demonstration
• Future
• MINA as a Platform
• Real-time Management
• Participation
• Conclusion
21
Future
MINA as a Platform
Real-Time
Integration Management
with Apache System
ASN.1 for complex protocols
Users can build customized
Rapidly Design custom
servers
HTTP FTP Prototyped
with Kerberos
ready-made protocol
protocols
codecs.
just like
Protocol
drawing a UML!
Visual Protocol
SMTP …… Designer LDAP
(ASN.1-based)
Popular ASN.1
Others
Protocols Codec
23
Future
24
Agenda: Conclusion
• Overview
• In-depth View
• Demonstration
• Future
• Conclusion
25
Conclusion
Conclusion
• MINA is…
• A network application framework for…
• Productivity
• Performance
• Stability
• MINA will be…
• Full-featured dev. & mgmt. platform for
network applications
26
Resources
• Homepage
• http://directory.apache.org/subprojects/mina/
• More useful examples
• Mailing List
• mina-dev@directory.apache.org
27
Thank You!
Q&A