안녕하세요 @flyyou 입니다. 미나라고 아시는지요? 자바로 네트웍 프로그램을 쉽게 할 수 있도록 구성된 네트웍 개발 프레임워크라고 볼 수 있습니다. 지금은 Netty라는 이름으로 변경되어서 오플 프로젝트로 진행되고 있습니다. 자세한 사항은 MINA 나 Netty로 검색해보면 정말 수많은 자료가 나옵니다. Netty는 아래 그룹스에서 활발하게 토론이 이루어지고 있습니다. https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!forum/netty-ko 이전에 대충 메모해둔 내용과 그려놓은 아키텍처 디자인이 있어서 기록에 남기기 위해서 이곳에 다시 정리해 봅니다. (참고 : https://mina.apache.org/) ## What is Apache MINA ## * A Java open-source network application framework - high performance - high scalability * Abstract API - Event-driven - Asynchronous - Unit-testable * Implementations - Sockets & datagrams ? Java NIO & APR via Tomcat Native - Serial ports ? RXTX.org - In-VM pipes ## MINA Features ## * Unified API for various transport types: - TCP/IP & UDP/IP via Java NIO - Serial communication (RS232) via RXTX - In-VM pipe communication - You can implement your own! * Filter interface as an extension point; similar to Servlet filters * Low-level and high-level API: - Low-level: uses ByteBuffers - High-level: uses user-defined message objects and codecs * Highly customizable thread model: - Single thread - One thread pool - More than one thread pools * Out-of-the-box SSL · TLS · StartTLS support using Java 5 SSLEngine * Overload shielding & traffic throttling * Unit testability using mock objects * JMX managability * Stream-based I/O support via StreamIoHandler * Integration with well known containers such as PicoContainer and Spring ## MINA Key Concepts ##  ## MINA in Action ## 아래 디자인은 실제로 제가 진행했던 과제에서 도입했던 디자인입니다. * MINA의 Event-Driven 방식으로 I/O 수행 쓰레드와 비즈니스 로직처리 쓰레드를 분리 * Handler를 이용하는 방식으로 Pool지원  ## Architecture Design ## * Start Daemon 시에 ServiceDaemonLoader의 main()메쏘드 실행 * Main() 메쏘드에서 init() / start() 실행 - Init() : Spring DI를 이용하여 HttpProxyService의 서버 종류를 선택 - Start() : 선택된 HttpProxyServie 실행.  * HttpProxyServie를 구현한 구현체(HttpProxyServiceMINA / HttpProxyServicePOJO)에서 start()메쏘드 실행시 해당 Bean Id에 list 형태로 매핑된 Processor Bean이 실행. - AbstractServiceProcessor을 구현한 해당 서비스 프로세스(ProxtServerProcessor / CommunicationProcessor / CommonProcessor)의 serviceStart() 메쏘드 실행  #### context-beans.xml #### ```xml <bean id="proxyServerProcessor" class="com.~~~~~~~~~.service.mina.ProxyServerProcessor"> <property name="startYn" value="Y" /> <property name="ipAddress" value="127.0.0.1" /> <property name="port" value="1001" /> <property name="sslYn" value="N" /> <property name="processorName" value="proxyServerProcessor" /> </bean> <bean id="httpProxyServiceMINA" class="com.~~~~~~~~~.service.HttpProxyServiceMINA" > <property name="processorList"> <list> <ref bean="proxyServerProcessor" /> <ref bean="communicationProcessor" /> <ref bean="CommonProcessor" /> </list> </property> </bean> ``` * Http Client에서 요청시 MINA 실행 데몬은 Accept를 받아서 Agent에서 등록된(Session ID) Socket Object를 찾는다. - ServiceLocator는 동기화된 MAP으로 Command Socket Map과 Communication Socket Map의 Repository 역할. - Cashing으로 관리되며 Pooling.  ## Class Diagram ###  요즘은 Netty가 책도 잘 나와있고 인터넷에 자료도 많아서 훨씬 도입하기가 쉽습니다. 좀 지난 자료지만 올려봅니다. 많은 의견 부탁드립니다.
author | flyyou |
---|---|
permlink | what-is-apache-mina-and-mina-in-action |
category | dev |
json_metadata | {"tags":["dev","kr-dev","kr","memo"],"users":["flyyou"],"image":["https://steemitimages.com/DQme8k3fHoPT7sN1Y1M18CQQ1iGW3o9X49LYWYgoHKj1wZB/image.png","https://steemitimages.com/DQmNRX6DUjoQSRwuoAwX5oY3UicQtbqWmSgYEa81Az1KeLZ/image.png","https://steemitimages.com/DQmb9fi9H1HkpgX755EHt825ZwrwHoLSKrgLtnXyXtt2Fe5/image.png","https://steemitimages.com/DQmPr8ewsC8fWxg9Amn9YzpCb1NDe5syjDGFB4GKBiMaHHi/image.png","https://steemitimages.com/DQmeVJ4hcHzn7iSzcZm7gfPMb7PUAdszJkUJ7EshZsvk6ZK/image.png","https://steemitimages.com/DQmPfBEBi46wE8V1yqwKiSWea8ac1RBY2PnpjEWnP5ysZ7a/image.png"],"links":["https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!forum/netty-ko","https://mina.apache.org/"],"app":"steemit/0.1","format":"markdown"} |
created | 2017-07-18 07:30:06 |
last_update | 2017-07-18 07:30:06 |
depth | 0 |
children | 6 |
last_payout | 2017-07-25 07:30:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 6.196 HBD |
curator_payout_value | 1.769 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 3,657 |
author_reputation | 4,447,836,923,106 |
root_title | "What is Apache MINA & MINA in Action" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,849,623 |
net_rshares | 1,539,411,031,384 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
kdj | 0 | 936,355,959,694 | 100% | ||
ksc | 0 | 76,904,575,756 | 20% | ||
agile | 0 | 3,608,329,757 | 100% | ||
ludorum | 0 | 497,325,798,783 | 25% | ||
flyyou | 0 | 18,541,248,473 | 100% | ||
geusgod | 0 | 4,427,285,815 | 100% | ||
capslock | 0 | 1,307,686,594 | 100% | ||
numlock | 0 | 940,146,512 | 100% |
이희승님 트위터에 스카웃됬다가 현재 라인플러스에 계시죠ㅎㅎ 구글그룹스에서 질문하면 잘 답변해주십니다ㅎㅎ트위터가 네티 기반이라더군요ㅎㅎ
author | facemaker77 |
---|---|
permlink | re-flyyou-what-is-apache-mina-and-mina-in-action-20170804t113202711z |
category | dev |
json_metadata | {"tags":["dev"],"app":"steemit/0.1"} |
created | 2017-08-04 11:32:03 |
last_update | 2017-08-04 11:32:21 |
depth | 1 |
children | 0 |
last_payout | 2017-08-11 11:32:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 74 |
author_reputation | 1,102,596,876,877 |
root_title | "What is Apache MINA & MINA in Action" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 10,740,547 |
net_rshares | 0 |
wow
author | joeyarnoldvn |
---|---|
permlink | re-flyyou-what-is-apache-mina-and-mina-in-action-20170718t073043973z |
category | dev |
json_metadata | {"tags":["dev"],"app":"steemit/0.1"} |
created | 2017-07-18 07:30:45 |
last_update | 2017-07-18 07:30:45 |
depth | 1 |
children | 1 |
last_payout | 2017-07-25 07:30:45 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 3 |
author_reputation | 51,867,863,946,836 |
root_title | "What is Apache MINA & MINA in Action" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,849,661 |
net_rshares | 0 |
;)
author | flyyou |
---|---|
permlink | re-joeyarnoldvn-re-flyyou-what-is-apache-mina-and-mina-in-action-20170718t074709103z |
category | dev |
json_metadata | {"tags":["dev"],"app":"steemit/0.1"} |
created | 2017-07-18 07:47:09 |
last_update | 2017-07-18 07:47:09 |
depth | 2 |
children | 0 |
last_payout | 2017-07-25 07:47:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 2 |
author_reputation | 4,447,836,923,106 |
root_title | "What is Apache MINA & MINA in Action" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,850,616 |
net_rshares | 0 |
이희승님의 자바소녀 네티군요 :)
author | ludorum |
---|---|
permlink | re-flyyou-what-is-apache-mina-and-mina-in-action-20170718t123750919z |
category | dev |
json_metadata | {"tags":["dev"],"app":"steemkr/0.1"} |
created | 2017-07-18 12:37:51 |
last_update | 2017-07-18 12:37:51 |
depth | 1 |
children | 1 |
last_payout | 2017-07-25 12:37:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 18 |
author_reputation | 45,673,022,586,692 |
root_title | "What is Apache MINA & MINA in Action" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,868,764 |
net_rshares | 0 |
네 맞습니다. 네티라는 이름보다 예전에 미나라는 이름으로 아파치 프로젝트로 관리되었을때 정말 대단했습니다. ㅋ 네티 책사면 자바소녀 브로마이드가 들어가 있어요 ㅋㅋ
author | flyyou |
---|---|
permlink | re-ludorum-re-flyyou-what-is-apache-mina-and-mina-in-action-20170718t135708445z |
category | dev |
json_metadata | {"tags":["dev"],"app":"steemit/0.1"} |
created | 2017-07-18 13:57:09 |
last_update | 2017-07-18 13:57:09 |
depth | 2 |
children | 0 |
last_payout | 2017-07-25 13:57:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 91 |
author_reputation | 4,447,836,923,106 |
root_title | "What is Apache MINA & MINA in Action" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,874,937 |
net_rshares | 0 |
어여쁜 네티의
author | numlock | ||||||
---|---|---|---|---|---|---|---|
permlink | re-flyyou-2017727t15474538z | ||||||
category | dev | ||||||
json_metadata | {"tags":"dev","app":"esteem/1.4.6","format":"markdown+html","community":"esteem"} | ||||||
created | 2017-07-27 06:47:06 | ||||||
last_update | 2017-07-27 06:47:06 | ||||||
depth | 1 | ||||||
children | 0 | ||||||
last_payout | 2017-08-03 06:47:06 | ||||||
cashout_time | 1969-12-31 23:59:59 | ||||||
total_payout_value | 0.222 HBD | ||||||
curator_payout_value | 0.077 HBD | ||||||
pending_payout_value | 0.000 HBD | ||||||
promoted | 0.000 HBD | ||||||
body_length | 7 | ||||||
author_reputation | 7,683,157,205,946 | ||||||
root_title | "What is Apache MINA & MINA in Action" | ||||||
beneficiaries |
| ||||||
max_accepted_payout | 1,000,000.000 HBD | ||||||
percent_hbd | 10,000 | ||||||
post_id | 9,879,489 | ||||||
net_rshares | 86,527,301,570 | ||||||
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
flyyou | 0 | 86,527,301,570 | 100% |