Thứ Sáu, 5 tháng 9, 2014

MDB

Demo: Alpha is the name of a mail-order company. You are part the team that isdeveloping a solution for automating the processes involved between order logging, invoicing, and the shipment of goods. You have to develop a message-driven bean that acts as an intermediary between the sub-systems that constitute the solution. Each of the subsystems is implemented in the form of entity beans. The first subsystem is where the orders are logged. As soon as the order is registered, a message is sent from the Order subsystem to the message-driven bean. The message-driven bean, in turn calls the other two subsystems, Invoicing and Shipping to proceed with the order. In other words, the message-driven bean that you develop should act as a trigger for the other two subsystems. 

Bước 1: Chạy View Domain Admin Console


Bước 2: Chọn Destination Resources, chọn new



 Bước 3: Hoàn thành các thao tác


Bước 4: Vào netbean tạo 1  Web Application


Bước 5: Tạo 1 JSF Managed Bean

                             

Bước 6: Gọi JMS


Kết quả:


Bước 8: Viết code cho trang JSF Manager vừa tạo


Bước 9: Viết code cho trang index.xhtml

Bước 10:Tạo EJB Module


Bước 11: Tạo Message-Drive Bean


Bước 12: Viết code cho trang Message-Drive Bean vừa tạo



Kết quả:




          Demo:https://drive.google.com/file/d/0B-EFzewQLSMDV2otZnF4ZEV2c2s/edit?usp=sharing
                  https://drive.google.com/file/d/0B-EFzewQLSMDejExNzFQTS1Ycjg/edit?usp=sharing

Nhận xét:
 - MDB có thể xử lý nhiều yêu cầu gửi đến một lúc, điều này tiến bộ hơn so với JMS
 - MDB có thể gửi và nhận tin nhắn không đồng bộ thông qua một máy chủ MOM
 - MDB cung cấp một lợi thế rất lớn về khả năng mở rộng.




Không có nhận xét nào:

Đăng nhận xét