본문 바로가기

FrameWorks/Spring

Spring - Spring Messaging Service :: 준비




여기에 소스를 입력

Spring Messaging Service :: 준비
Spring Messaging Service 를 시작하기 전 준비 단계입니다.
Spring Messaging Service(이하, SMS)를 사용하기 전 알아두면 좋은 용어 정리를 먼저 합니다.


▶ 목차
  1. JMS : Java Message Service
  2. EJB : Enterprise JavaBeans
  3. MDB : Message-Driven Bean
  4. POJO : Plain Old Java Object


1.  JMS : Java Message Service

원문 발췌 : http://en.wikipedia.org/wiki/Java_Message_Service.

위키백과에서는 다음과 같이 소개하고 있습니다.

The Java Message Service (JMS) API is a Java Message Oriented Middleware (MOM) API for sending messages between two or more clients. JMS is a part of the Java Platform, Enterprise Edition, and is defined by a specification developed under the Java Community Process as JSR 914.[1] It is a messaging standard that allows application components based on the Java Enterprise Edition (JEE) to create, send, receive, and read messages. It allows the communication between different components of a distributed application to be loosely coupled, reliable, and asynchronous.
자바 메시지 서비스 (JMS) API는 두 개 이상의 클라이언트 간의 메시지를 보내는 자바 메시지 지향 미들웨어 (MOM) API입니다.
JMS는 자바 플랫폼, 엔터 프라이즈 버전의 일부이며,
JSR 914으로 자바 커뮤니티에서 개발한 프로세스 사양에 의해 정의됩니다.
JMS는 자바 엔터 프라이즈 에디션을 기반으로 한 메시징 표준 응용 프로그램의 구성요소를 생성, 수신 및 메시지를 읽습니다.
JMS는 분산 응용 프로그램의 다른 구성 요소 간의 통신을 비동기식으로 결합 수 있습니다

정리하자면, JMS는 서로 다른 응용 프로그램 간의 통신을 위한 수단이며, 이 수단으로써 비동기식 통신 방식을 이용합니다.

JMS는 하나의 Publisher(배포자)가 여러 Subscriber(구독자)에게 메세지를 전송하는 모델, P2P모델, 그리고 메세지가 중간에 유실되지 않도록 하는 Reliable Messaging, 비동기식 방식으로 메세지 전달, 분산 트랜잭션, 클러스터링 등을 지원합니다.


2. EJB : Enterprise JavaBeans

출처 : http://terms.co.kr/EJB.htm

EJB는 클라이언트/서버 모델의 서버 부분에서 운영되는 자바 프로그램 컴포넌트들을 설정하기 위한 아키텍처이다. EJB는 네트웍 내의 클라이언트들에 분산되어 있는 프로그램 컴포넌트들을 위한 자바빈즈 기술 위에서 구현된다. EJB는 기업들에게, 새로운 프로그램 컴포넌트가 추가되거나 또는 변경될 때마다, 각 개별 컴퓨터를 갱신하지 않고서도 서버에서 변화를 통제할 수 있도록 하는 이점을 제공한다.
EJB 컴포넌트들은 다중 응용프로그램들에서 재 사용되는 장점을 가지고 있다.
EJB 빈이나 컴포넌트가 배치되기 위해서는 컨테이너라고 불리는 특정 응용프로그램의 일부가 되어야한다.
썬마이크로시스템즈에 의해 비롯된 EJB는, 개략적으로 마이크로소프트의 COM/DCOM 아키텍처에 필적하는 것이다. 그러나, 모든 자바 기반의 아키텍처와 같이, 프로그램들은 윈도우즈뿐만 아니라 모든 주요 운영체계에 걸쳐 배치될 수 있다.
EJB의 프로그램 컴포넌트들은 대개 서블릿이라고 알려져 있다. 서블릿을 실행시키는 응용프로그램이나 컨테이너를 때로 애플리케이션 서버라고도 부르는 경우가 있다. 서블릿의 전형적인 용도는 CGI와 Perl 스크립트를 사용하는 웹프로그램을 대체하는 것이다. 또다른 일상적인 용도는 웹사용자와 레거시 메인프레임 응용프로그램과 데이터베이스 사이의 인터페이스를 제공하는 것이다.
EJB 내에 두 가지 종류의 빈즈가 있는데, 하나는 세션 빈즈이고 또 하나는 엔터티 빈즈이다.
엔터티 빈즈는 세션 빈즈와 달리, 지속성을 가지고 있으며 원래의 습성이나 상태를 유지할 수 있다.



3. MDB : Message-Driven Bean

원문 발췌 : http://en.wikipedia.org/wiki/Message-driven_bean
위키백과에서는 다음과 같이 소개하고 있습니다.

Message Driven Beans[15] are business objects whose execution is triggered by messages instead of by method calls. The Message Driven Bean is used among others to provide a high level ease-of-use abstraction for the lower level JMS (Java Message Service) specification. It may subscribe to JMS message queues or message topics, which typically happens via the activationConfig attribute of the @MessageDriven annotation. They were added in EJB to allow event-driven processing. Unlike session beans, an MDB does not have a client view (Local/Remote/No-interface), i. e. clients can not look-up an MDB instance. It just listens for any incoming message on, for example, a JMS queue or topic and processes them automatically. Only JMS support is required by the Java EE spec[16], but Message Driven Beans can support other messaging protocols.[17][18] Such protocols may be asynchronous but can also be synchronous. Since session beans can also be synchronous or asynchronous, the prime difference between session- and message driven beans is not the synchronicity, but the difference between (object oriented) method calling and messaging.

Examples
  • Sending a configuration update to multiple nodes might be done by sending a JMS message to a 'message topic' and could be handled by a Message Driven Bean listening to this topic (the message paradigm is used here, since the sender does not need to have knowledge about the amount of consumers or their location or even their exact type).
  • Submitting a job to a work cluster might be done by sending a JMS message to a 'message queue' and could also be handled by a Message Driven Bean, but this time listening to a queue (the message paradigm and the queue is used, since the sender doesn't have to care which worker executes the job, but it does need assurance that a job is only executed once).
  • Processing timing events from the Quartz scheduler can be handled by a Message Driven Bean; when a Quartz trigger fires, the MDB is automatically invoked. Since Java EE doesn't know about Quartz by default, a JCA resource adapter would be needed and the MDB would be annotated with a reference to this.[19]

▣ Message-Driven Bean

일반적인 JMS 클라이언트 프로그래밍 모델 외에도 J2EE 플랫폼 응용 프로그램 컨텍스트에서 사용하는, 보다 특수화된 JMS 버전이 있습니다. 이 특수화된 클라이언트를 Message-Driven Bean이라고 부르며, EJB(Enterprise JavaBeans) 구성 요소 중 하나로서EJB 2.0 이상 사양(http://java.sun.com/products/ejb/docs.html)에 설명되어 있습니다.


▣ JMS / J2EE 프로그래밍에서 Message-Driven Bean에 대한 자세한 내용은 아래의 웹 사이트에서 확인하세요

http://download.oracle.com/docs/cd/E19148-01/820-0532/gbpeq/index.html


 

4. POJO : Plain Old Java Object

POJO는 Plain Old Java Object (직역하자면, 오래된 자바 객체)라고 합니다. 이 단어는 2000년 가을에 열렸던 어느 컨퍼런스의 발표를 준비하면서 만들어낸 말입니다.
단순히 POJO를 오래된 자바 객체라고 이해하기엔 너무 많은 내용이 있습니다.

잘 설명해 놓은 사이트를 소개할께요.

http://itewbm.tistory.com/40