SlideShare a Scribd company logo
- JMS 시스템의 이해


Uajjang.com 미디어 검색팀 정경석
                2012. 05 .09
   What is JMS?
   Why JMS?
   Producer/Consumer
   Type of JMS model
   About ActiveMQ
   When is the right time to use ActiveMQ?
   How to use ActiveMQ?
   How to monitoring in ActiveMQ?
   Fault tolerance and High availability
   JMS is Java Message Service
   Standard J2EE messaging API
   JMS is asynchronous in nature
   Producer/Consumer pattern의 구현체
   Producer, Message, Consumer로 구성됨.
   Message broker system
     메시지 전송 중계를 담당.
     Message의 전송을 보장.
       즉, JMS를 통해 전송된 메시지는 반드시 목적지에 도달함.
 Heterogeneous application integration
   Unix <-> IBM Host, Java <-> C++
   이기종, 다른 언어로 작성된 Applicaion간의 업무 통
    합이 가능함.
 High reliability and the performance
 Do not need to concern about
 communication.
   데이터의 통신은 JMS가 담당 하므로 개발자는 순수
   하게 메시지에만 관심을 가질 수 있음
   메시지 전송의 투명성을 가짐.
Broker(JMS)



    Producer                   Consumer

 생산자는 메시지를 만들어서 Broker에게 전송.
 소비자는 Broker로 부터 메시지를 수신
 즉, 메시지가 생성되어 소비하기까지의 과정을 중계하는 역할
 Point to Point(Sender/Receiver)
     하나의 메시지는 하나의 목적지로만 전달됨.
     특정한 App이 메시지를 수신하도록 유도 가능.



        Sender              Queue    Receiver 1

                                     Receiver 2

 Publish and Subscribe
    하나의 메시지는 다중의 목적지로 전달됨.
    모든 App이 메시지를 수신



       Publisher             Topic   Subscriber

                                     Subscriber
 Most popular and powerful open source
 Message Broker
 Java based JMS implementation
 Spring Integration with ActiveMQ
 Fault tolerance(High availability)
 Easy to Scale out
 Supports a large number of Cross
 Language Clients(C#, C++, Perl, PHP, Python,
 Ruby, Delphi…)
 RPC의 대체(Async)
 Event Driven Architecture with POJOs
 (Shopping)
 Software적인 scalability를 보장받고자 하는 경
 우(SOA)
 메시지 전송의 보장이 필요한 경우(System간)
 Transaction load balancing 필요한 경우
 각 시스템에 동일한 메시지를 전달해야 하는 경
 우(Notification)
 Install ActiveMQ(using default setting).
 Write sender application(using ActiveMQ Lib)
 Write receiver application(using ActiveMQ Lib)




                    Broker(JMS)


     Producer                        Consumer
     (Sender)                        (Receiver)
Write sender application
ActiveMQConnectionFactory connectionFactory = new
ActiveMQConnectionFactory(“tcp://10.1.0.11:61616”);
Connection connection = connectionFactory.createConnection();
connection.start();

// Create the session
session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
destination = session.createQueue(“com.jjanglive.jPush”);

// Create the producer.
producer = session.createProducer(destination);
producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);

TextMessage textMessage = session.createTextMessage(“This is a sample message!!”);

producer.send(textMessage);
Write receiver application with Spring
public class SampleMessageHandler implements MessageListener {
@Override
public void onMessage(Message message) {
  // do something
  System.out.println(“Message Received!!!!!!!!”);
}
Spring setting
<bean id="connectionFactory"
class="org.apache.activemq.spring.ActiveMQConnectionFactory">
<property name="brokerURL" value="failover:tcp://10.4.0.101:61616" />
</bean>
<bean id="jPushQueue" class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg index="0" value="com.jjanglive.jPush" />
</bean>
<bean class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="connectionFactory" />
<property name="destination" ref="jPushQueue" />
<property name="messageListener" ref="jMessageListenerAdapter" />
</bean>
<bean id="jMessageListenerAdapter"
class="org.springframework.jms.listener.adapter.MessageListenerAdapter">
<constructor-arg>
<bean class="com.jjanglive.jpush.message.handler.JPushMessageHandler"></bean>
</constructor-arg>
</bean>
Connect to http://server_address:8161/admin
Broker down case


            MQ Client    MQ Client    …   MQ Client

                         Broker Agent          Failover connect



              Active       Active           Active
              MQ 1         MQ 2       …     MQ n



            Receiver 1   Receiver 2   …   Receiver n


 특정 Broker가 Down된 경우 MQ Client와 Receiver는 자동으로 down을 감
  지하고 살아 있는 Broker를 찾아 auto reconnect

More Related Content

PDF
Enterprise Messaging with Apache ActiveMQ
PPTX
19 08-22 introduction to activeMQ
PDF
Swagger UI
PDF
Apache ActiveMQ
PDF
Rediscovering Spring with Spring Boot(1)
PDF
Spring Framework - AOP
PDF
Denys Serhiienko "ASGI in depth"
PPTX
Apache web server
Enterprise Messaging with Apache ActiveMQ
19 08-22 introduction to activeMQ
Swagger UI
Apache ActiveMQ
Rediscovering Spring with Spring Boot(1)
Spring Framework - AOP
Denys Serhiienko "ASGI in depth"
Apache web server

What's hot (20)

PDF
Spring Framework - Spring Security
PDF
Introduction to Spring Boot!
PDF
Modern API Security with JSON Web Tokens
PDF
C# ASP.NET WEB API APPLICATION DEVELOPMENT
PDF
Spring boot
PPTX
Introduction to node.js
PDF
REST API Basics
PDF
Secure Spring Boot Microservices with Keycloak
PDF
LetSwift 2017 - 토스 iOS 앱의 개발/배포 환경
PDF
JSON WEB TOKEN
PPT
Wireshark
PPTX
WAS vs JBoss, WebLogic, Tomcat (year 2015)
PPT
WebLogic Scripting Tool Overview
PPTX
PDF
Spring security oauth2
PPTX
Pentesting jwt
PDF
Introduction to JWT and How to integrate with Spring Security
PPTX
Understanding JWT Exploitation
PDF
Redux Saga - Under the hood
PPTX
Spring Boot & WebSocket
Spring Framework - Spring Security
Introduction to Spring Boot!
Modern API Security with JSON Web Tokens
C# ASP.NET WEB API APPLICATION DEVELOPMENT
Spring boot
Introduction to node.js
REST API Basics
Secure Spring Boot Microservices with Keycloak
LetSwift 2017 - 토스 iOS 앱의 개발/배포 환경
JSON WEB TOKEN
Wireshark
WAS vs JBoss, WebLogic, Tomcat (year 2015)
WebLogic Scripting Tool Overview
Spring security oauth2
Pentesting jwt
Introduction to JWT and How to integrate with Spring Security
Understanding JWT Exploitation
Redux Saga - Under the hood
Spring Boot & WebSocket
Ad

Viewers also liked (20)

PDF
Messaging With ActiveMQ
PDF
ActiveMQ In Action
PDF
Messaging With Apache ActiveMQ
PPT
Enterprise Integration Patterns with ActiveMQ
PDF
Advanced messaging with Apache ActiveMQ
PPTX
Messaging for Web and Mobile with Apache ActiveMQ
PPT
Apache ActiveMQ - Enterprise messaging in action
ODP
Apache ActiveMQ and Apache Camel
PDF
Zero aos와 DIY HTS비교
PPTX
Active mq Installation and Master Slave setup
PPTX
Enterprise mobility
PPT
Mcollective orchestration tool 소개
PDF
A Practical Guide for Selecting an Enterprise Messaging Platforms
PPTX
모바일 개발 트랜드
PDF
IoT with Apache ActiveMQ, Camel & Spark
PPTX
빌링:미터링 Bss platform구현
PPTX
토종 개발자가 바라본 실리콘밸리 개발 트랜드
PDF
Introduction to ActiveMQ Apollo
PPTX
클라우드 서비스운영 플랫폼 가루다 Open cloudengine_패스트캣_cto 송상욱
PPT
ActiveMQ 5.9.x new features
Messaging With ActiveMQ
ActiveMQ In Action
Messaging With Apache ActiveMQ
Enterprise Integration Patterns with ActiveMQ
Advanced messaging with Apache ActiveMQ
Messaging for Web and Mobile with Apache ActiveMQ
Apache ActiveMQ - Enterprise messaging in action
Apache ActiveMQ and Apache Camel
Zero aos와 DIY HTS비교
Active mq Installation and Master Slave setup
Enterprise mobility
Mcollective orchestration tool 소개
A Practical Guide for Selecting an Enterprise Messaging Platforms
모바일 개발 트랜드
IoT with Apache ActiveMQ, Camel & Spark
빌링:미터링 Bss platform구현
토종 개발자가 바라본 실리콘밸리 개발 트랜드
Introduction to ActiveMQ Apollo
클라우드 서비스운영 플랫폼 가루다 Open cloudengine_패스트캣_cto 송상욱
ActiveMQ 5.9.x new features
Ad

Similar to Active MQ (20)

PDF
JavaEE6 Tutorial - Java Message Service_sys4u
PDF
Amazon MQ 쉽게시작하는 메시지 브로커 서비스 - 트랙1, Community Day 2018 re:Invent 특집
PPTX
IBM MQTT Mobile Push Solution 소개서
PDF
IBM Websphere MQ Software 소개 ( Messaging Engine )
PDF
[오픈소스컨설팅]JBoss AS7/EAP6 - JMS and JMX
PPTX
[발표자료]신뢰적인 MQTT 프로토콜에서 성능향상을 고려한 Publish Queue 기반 데이터 전송 기법
PPTX
Wisepush
PDF
개량된 MQTT를 이용한 메시징 시스템_컨셉
PDF
개량된 MQTT 노드 관리 시스템을 이용한 학교 알림 서비스
PDF
AWS CLOUD 2018- Amazon MQ, 관리형 ActiveMQ 서비스 활용하기 (이창수 솔루션즈 아키텍트)
PDF
RabbitMQ 알아보기
PDF
Android Push Server & MQTT
PPTX
푸시개발 정리 - Push Notification Summary
PDF
MQTT 를 이용한 주문시스템 개선
PPTX
모바일 네트워크 친화적인 글로벌 메시징 서비스 - ChatON 개발
PDF
엔터프라이즈 어플리케이션을 위한 효과적인 이벤트 프로세싱 전략 (문종민, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
PPTX
RabbitMQ
PPTX
[테크데이즈2015] 개발하기 바쁜데 푸시와 메시지큐는 있는거 쓸래요
PDF
[16.01.05] node.js & mqtt
PPTX
Iris-iPNS / 푸시 솔루션 (Push Solution) 제품 소개
JavaEE6 Tutorial - Java Message Service_sys4u
Amazon MQ 쉽게시작하는 메시지 브로커 서비스 - 트랙1, Community Day 2018 re:Invent 특집
IBM MQTT Mobile Push Solution 소개서
IBM Websphere MQ Software 소개 ( Messaging Engine )
[오픈소스컨설팅]JBoss AS7/EAP6 - JMS and JMX
[발표자료]신뢰적인 MQTT 프로토콜에서 성능향상을 고려한 Publish Queue 기반 데이터 전송 기법
Wisepush
개량된 MQTT를 이용한 메시징 시스템_컨셉
개량된 MQTT 노드 관리 시스템을 이용한 학교 알림 서비스
AWS CLOUD 2018- Amazon MQ, 관리형 ActiveMQ 서비스 활용하기 (이창수 솔루션즈 아키텍트)
RabbitMQ 알아보기
Android Push Server & MQTT
푸시개발 정리 - Push Notification Summary
MQTT 를 이용한 주문시스템 개선
모바일 네트워크 친화적인 글로벌 메시징 서비스 - ChatON 개발
엔터프라이즈 어플리케이션을 위한 효과적인 이벤트 프로세싱 전략 (문종민, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
RabbitMQ
[테크데이즈2015] 개발하기 바쁜데 푸시와 메시지큐는 있는거 쓸래요
[16.01.05] node.js & mqtt
Iris-iPNS / 푸시 솔루션 (Push Solution) 제품 소개

More from Kris Jeong (6)

PPTX
Soscon2017 오픈소스를 활용한 마이크로 서비스의 캐시 전략
PPTX
Going asynchronous with netty - SOSCON 2015
PPTX
Redis data design by usecase
PPTX
This is redis - feature and usecase
PPTX
이것이 레디스다.
PDF
REDIS intro and how to use redis
Soscon2017 오픈소스를 활용한 마이크로 서비스의 캐시 전략
Going asynchronous with netty - SOSCON 2015
Redis data design by usecase
This is redis - feature and usecase
이것이 레디스다.
REDIS intro and how to use redis

Active MQ

  • 1. - JMS 시스템의 이해 Uajjang.com 미디어 검색팀 정경석 2012. 05 .09
  • 2. What is JMS?  Why JMS?  Producer/Consumer  Type of JMS model  About ActiveMQ  When is the right time to use ActiveMQ?  How to use ActiveMQ?  How to monitoring in ActiveMQ?  Fault tolerance and High availability
  • 3. JMS is Java Message Service  Standard J2EE messaging API  JMS is asynchronous in nature  Producer/Consumer pattern의 구현체  Producer, Message, Consumer로 구성됨.  Message broker system  메시지 전송 중계를 담당.  Message의 전송을 보장.  즉, JMS를 통해 전송된 메시지는 반드시 목적지에 도달함.
  • 4.  Heterogeneous application integration  Unix <-> IBM Host, Java <-> C++  이기종, 다른 언어로 작성된 Applicaion간의 업무 통 합이 가능함.  High reliability and the performance  Do not need to concern about communication.  데이터의 통신은 JMS가 담당 하므로 개발자는 순수 하게 메시지에만 관심을 가질 수 있음  메시지 전송의 투명성을 가짐.
  • 5. Broker(JMS) Producer Consumer  생산자는 메시지를 만들어서 Broker에게 전송.  소비자는 Broker로 부터 메시지를 수신  즉, 메시지가 생성되어 소비하기까지의 과정을 중계하는 역할
  • 6.  Point to Point(Sender/Receiver)  하나의 메시지는 하나의 목적지로만 전달됨.  특정한 App이 메시지를 수신하도록 유도 가능. Sender Queue Receiver 1 Receiver 2  Publish and Subscribe  하나의 메시지는 다중의 목적지로 전달됨.  모든 App이 메시지를 수신 Publisher Topic Subscriber Subscriber
  • 7.  Most popular and powerful open source Message Broker  Java based JMS implementation  Spring Integration with ActiveMQ  Fault tolerance(High availability)  Easy to Scale out  Supports a large number of Cross Language Clients(C#, C++, Perl, PHP, Python, Ruby, Delphi…)
  • 8.  RPC의 대체(Async)  Event Driven Architecture with POJOs (Shopping)  Software적인 scalability를 보장받고자 하는 경 우(SOA)  메시지 전송의 보장이 필요한 경우(System간)  Transaction load balancing 필요한 경우  각 시스템에 동일한 메시지를 전달해야 하는 경 우(Notification)
  • 9.  Install ActiveMQ(using default setting).  Write sender application(using ActiveMQ Lib)  Write receiver application(using ActiveMQ Lib) Broker(JMS) Producer Consumer (Sender) (Receiver)
  • 10. Write sender application ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(“tcp://10.1.0.11:61616”); Connection connection = connectionFactory.createConnection(); connection.start(); // Create the session session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE); destination = session.createQueue(“com.jjanglive.jPush”); // Create the producer. producer = session.createProducer(destination); producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT); TextMessage textMessage = session.createTextMessage(“This is a sample message!!”); producer.send(textMessage);
  • 11. Write receiver application with Spring public class SampleMessageHandler implements MessageListener { @Override public void onMessage(Message message) { // do something System.out.println(“Message Received!!!!!!!!”); }
  • 12. Spring setting <bean id="connectionFactory" class="org.apache.activemq.spring.ActiveMQConnectionFactory"> <property name="brokerURL" value="failover:tcp://10.4.0.101:61616" /> </bean> <bean id="jPushQueue" class="org.apache.activemq.command.ActiveMQQueue"> <constructor-arg index="0" value="com.jjanglive.jPush" /> </bean> <bean class="org.springframework.jms.listener.DefaultMessageListenerContainer"> <property name="connectionFactory" ref="connectionFactory" /> <property name="destination" ref="jPushQueue" /> <property name="messageListener" ref="jMessageListenerAdapter" /> </bean> <bean id="jMessageListenerAdapter" class="org.springframework.jms.listener.adapter.MessageListenerAdapter"> <constructor-arg> <bean class="com.jjanglive.jpush.message.handler.JPushMessageHandler"></bean> </constructor-arg> </bean>
  • 14. Broker down case MQ Client MQ Client … MQ Client Broker Agent Failover connect Active Active Active MQ 1 MQ 2 … MQ n Receiver 1 Receiver 2 … Receiver n  특정 Broker가 Down된 경우 MQ Client와 Receiver는 자동으로 down을 감 지하고 살아 있는 Broker를 찾아 auto reconnect