September 28, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser

Slides:



Advertisements
Similar presentations
DISTRIBUTED COMPUTING PARADIGMS
Advertisements

J0 1 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento.
SIP and Instant Messaging. SIP Summit SIP and Instant Messaging What Does Presence Have to Do With SIP? How to Deliver.
11 Copyright © 2005, Oracle. All rights reserved. Creating the Business Tier: Enterprise JavaBeans.
Chapter 10: Execution Models Service-Oriented Computing: Semantics, Processes, Agents – Munindar P. Singh and Michael N. Huhns, Wiley, 2005.
Erin Collins Topics in Computer Science Spring 2011 Paper by: Patrick Eugster, Pascal Felber, Rachid Guerrapui and Anne-Marie Kermarrec.
Approaches to EJB Replication. Overview J2EE architecture –EJB, components, services Replication –Clustering, container, application Conclusions –Advantages.
A Study in JMS (Java Messaging Service) Chad Beaudin CS 522 Fall Semester 2002.
Java Messaging Services CS-328. Messaging Systems A messaging System allows and promotes the loose coupling of components –allows components to post messages.
Java Messaging Service Notes prepared from GBC Professional Development Seminar :Understanding the Java Messaging Service David Chappell & Rick Kuzyk,
A Study in JMS (Java Messaging Service) Chad Beaudin CS 522 Fall Semester 2002.
Understanding Networked Applications: A First Course Chapter 12 by David G. Messerschmitt.
Java Message Service API CSE 487/587 Feb 17, 2005 References: JRun Programmer’s Guide.
JMS Java Message Service Instructor Professor: Charles Tappert By Student: Amr Fouda.
ECSE Software Engineering 1I HO 7 © HY 2012 Lecture 7 Publish/Subscribe.
Click to add text Introduction to z/OS Basics © 2006 IBM Corporation Chapter 15: WebSphere MQ.
EEC-681/781 Distributed Computing Systems Lecture 6 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Distributed Publish/Subscribe Network Presented by: Yu-Ling Chang.
Service Broker Lesson 11. Skills Matrix Service Broker Service Broker, provides a solution to common problems with message delivery and consistency that.
Messaging Technologies Group: Yuzhou Xia Yi Tan Jianxiao Zhai.
Java Messaging Services PresentationBy Anurudh Gupta.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Client Server Technologies Middleware Technologies Ganesh Panchanathan Alex Verstak.
1 G52IWS: Distributed Computing Chris Greenhalgh.
Java Message Service Sangeetha Chavala. What is Messaging? Method of Communication between software components/applications peer-to-peer facility Not.
September 16, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser
1 Stateful Session Beans Stateless Session Beans Michael Brockway Sajjad Shami Northumbria University School of Computing, Engineering & Information Sciences.
Enterprise Java Bean Matt. 2 J2EE 3 J2EE Overview.
Message-Driven Beans and EJB Security Lesson 4B / Slide 1 of 37 J2EE Server Components Objectives In this lesson, you will learn about: Identify features.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Chapter 4 Communication.
Asynchronous Communication Between Components Presented By: Sachin Singh.
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 5: JMS.
EGEE is a project funded by the European Union under contract IST Messaging and queuing Common components Krzysztof Nienartowicz EGEE JRA1.
1 Java Message Service Манин П Enterprise messaging Key concept: 1. Messages are delivered asynchronously 2. Sender is not required to wait for.
DISTRIBUTED COMPUTING PARADIGMS. Paradigm? A MODEL 2for notes
New features for CORBA 3.0 by Steve Vinoski Presented by Ajay Tandon.
Message Oriented Communication Prepared by Himaja Achutha Instructor: Dr. Yanqing Zhang Georgia State University.
Databases JDBC (Java Database Connectivity) –Thin clients – servlet,JavaServer Pages (JSP) –Thick clients – RMI to remote databases –most recommended way.
Collaborate Lesson 4C / Slide 1 of 22 Collaborate Knowledge Byte In this section, you will learn about: The EJB timer service Message linking in EJB 2.1.
21 September 2006Kaiser: COMS W4156 Fall COMS W4156: Advanced Software Engineering Prof. Gail Kaiser
Enterprise Integration Patterns CS3300 Fall 2015.
JMS (Java Messaging Service)
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 13. Review Shared Data Software Architectures – Black board Style architecture.
Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat.
Information-Centric Networks10b-1 Week 10 / Paper 2 Hermes: a distributed event-based middleware architecture –P.R. Pietzuch, J.M. Bacon –ICDCS 2002 Workshops.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
AMQP, Message Broker Babu Ram Dawadi. overview Why MOM architecture? Messaging broker like RabbitMQ in brief RabbitMQ AMQP – What is it ?
Information-Centric Networks Section # 10.2: Publish/Subscribe Instructor: George Xylomenos Department: Informatics.
Java Message Service (JMS) Web Apps and Services.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Spring RabbitMQ Martin Toshev.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB Markus.
E81 CSE 532S: Advanced Multi-Paradigm Software Development Venkita Subramonian, Christopher Gill, Ying Huang, Marc Sentany Department of Computer Science.
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
Enterprise Java Beans N.V.RAJASEKHAR REDDY. Definition of EJB EJBs are the components that are the set of classes and interfaces deployed within a container.
Copyright © 2004, Keith D Swenson, All Rights Reserved. OASIS Asynchronous Service Access Protocol (ASAP) Tutorial Overview, OASIS ASAP TC May 4, 2004.
EJB Enterprise Java Beans JAVA Enterprise Edition
September 29, 2009COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser
Java Message Service Introduction to JMS API. JMS provides a common way for Java programs to create, send, receive and read an enterprise messaging system’s.
Slide No. 1 of 111 JMS ( J AVA M ESSAGE S ERVICE ) -Dhananjay Singh.
Java Messaging Service (JMS)
Java Messaging Service (JMS)
Java Messaging Service (JMS)
Harjutus 3: Aünkroonne hajussüsteemi päring
Understanding and Designing with EJB
Indirect Communication Paradigms (or Messaging Methods)
Indirect Communication Paradigms (or Messaging Methods)
J2EE Lecture 13: JMS and WebSocket
Message Passing Systems
Presentation transcript:

September 28, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser

September 28, 2010COMS W41562 Topics covered in this lecture Publish/Subscribe Overview COM Events COM+ Events EJB Message-Driven Beans

September 28, 2010COMS W41563 Publish/Subscribe

Messaging Pattern Publish/subscribe (or pub/sub) is a messaging pattern where senders (publishers) of messages are not programmed to send their messages to specific receivers (subscribers) Published messages are characterized into classes, without knowledge of what, if any, subscribers there may be Subscribers express interest in one or more classes, and only receive messages that are of interest, without knowledge of what, if any, publishers there are Decoupling of publishers and subscribers can allow for greater scalability and a more dynamic network topology September 28, 2010COMS W41564

Message Filtering Subscribers typically receive only a subset of the total messages published Topic-based: messages are published to "topics" or named logical channels - subscribers in a topic-based system will receive all messages published to the topics to which they subscribe, and all subscribers to a topic will receive the same messages Content-based: messages are only delivered to a subscriber if the attributes or content of those messages match constraints defined by the subscriber Some systems support a hybrid where publishers post messages to a topic while subscribers register content-based subscriptions to one or more topics September 28, 2010COMS W41565

Topology Publishers post messages to an intermediary message broker and subscribers register subscriptions with that broker The broker performs a store and forward function (possibly with temporal message queuing) to route messages from publishers to subscribers September 28, 2010COMS W41566

September 28, 2010COMS W41567 COM Events

September 28, 2010COMS W41568 Original COM Events Choice between two techniques –Interface callback mechanism –Connectable Objects

September 28, 2010COMS W41569 Interface Callbacks Client implements a COM interface defined by the event publisher component, and passes to the component a pointer to this interface Client then receives notifications (i.e., callbacks) when the component calls a method through the interface implemented by the client code

September 28, 2010COMS W Connectable Objects Also known as connection points Client implements a COM interface defined by COM’s standard IConnectionPoint interface (and other related interfaces), and passes a pointer to this interface –Connect ( Advise ) and disconnect ( Unadvise ) –Enumerate connections ( EnumConnections) Client then receives notifications (i.e., callbacks) when the component calls a method through the interface implemented by the client code

September 28, 2010COMS W Example

September 28, 2010COMS W COM Events Limitations Only a series of interfaces - developers still have to write all the code to implement these interfaces (no infrastructure) Implementing a complex application making heavy use of events may require complex coding to handle multiplexing events to multiple connected clients, circular references, deadlock situations, etc. Client and component lifetimes are tightly coupled through the exchanged interface pointer - the client must be running and connected to receive events It is difficult to get between a component instance and its clients to monitor the connection, provide trace information, etc.

September 28, 2010COMS W COM+ Events

September 28, 2010COMS W COM+ Events Publish-subscribe model rather than request- reply An intermediary object manages communication between a publisher and its subscribers –Publishers and subscribers are not tightly bound –Asynchronous: Publishers do not block when firing an event and subscribers do not wait to receive

September 28, 2010COMS W Event Class An event class component sits between a publisher of information and any potential subscribers COM+ Events system provides the actual implementation of this intermediate object Eliminates the need to directly pass an interface pointer

September 28, 2010COMS W Publisher The event class looks like a subscriber to the publisher When a publisher wants to “fire” an event, it creates an instance of the event class, calls the appropriate method, and then releases the interface (as in queued components) The runtime then determines how and when to notify any subscribers

September 28, 2010COMS W Subscriber To receive events, need only implement the event interface Registers with the COM+ Events service by creating a subscription object, through the IEventSubscription interface The component will be (activated and) notified as events are published Either persistent or transient subscriptions

September 28, 2010COMS W Example

September 28, 2010COMS W Example

September 28, 2010COMS W Improved COM+ Events Provides a “third-party” publish-subscribe environment: Once an event class is created, anyone can become a publisher or subscriber of the events Supports a rich filter mechanism: one can filter at the publisher method level – IPublisherFilter allows the event class object to decide which subscribers receive a particular event, or at the method parameter level – ISubscribeControl supports a complex criteria string per subscriber

September 28, 2010COMS W Filtering Example

EJB Events: Message-Driven Beans September 28, 2010COMS W415622

September 28, 2010COMS W Messaging Messaging enables distributed communication that is loosely coupled A component sends a message to a destination, and the recipient retrieves the message from the destination The sender and the receiver do not have to be available at the same time The sender does not need to know anything about the receiver, nor vice versa Both only need to know which message format and which destination to use Differs from tightly coupled technologies, such as Remote Method Invocation (RMI), which require an application to know a remote application’s methods

September 28, 2010COMS W Message Consumption Synchronous (pull): A subscriber explicitly fetches the message from the destination by calling the receive method - the receive method can block until a message arrives or can time out if a message does not arrive within a specified time limit Asynchronous (push): A client can register a message listener with a consumer - Whenever a message arrives at the destination, the provider delivers the message by calling the listener’s onMessage method, which acts on the contents of the message

September 28, 2010COMS W Message-Driven Beans Allows Java Enterprise Edition applications to process messages asynchronously (session beans can only receive synchronous messages) Acts as a JMS (Java Message Service) message listenerJava Message Service Messages can be sent by an application client, another enterprise bean, a web component, or a JMS system that does not use Java EE technology

September 28, 2010COMS W JMS API Common set of interfaces and associated semantics that allow programs written in Java to communicate with other messaging implementations The JMS API can ensure that a message is delivered once and only once ( PERSISTENT ) Lower reliability, at most once ( NON_PERSISTENT ), is available for applications that can afford to miss messages

September 28, 2010COMS W JMS API Architecture A JMS provider is a messaging system that implements the JMS interfaces and provides administrative and control features (included in Java EE) JMS clients are the programs or components that produce and consume messages Messages are the objects that communicate information between JMS clients Administered objects are preconfigured JMS objects (destinations and connection factories) created by an administrator for the use of clients via Java Naming and Directory Interface (JNDI)Java Naming and Directory Interface

September 28, 2010COMS W JMS API Architecture

September 28, 2010COMS W Messaging Domains Either point-to-point or publish/subscribe JMS API provides common interfaces not specific to either model

September 28, 2010COMS W Point-to-Point Built on the concept of message queues, senders and receivers Each message is addressed to a specific queue, and receiving clients extract messages from the queues established to hold their messages Queues retain all messages sent to them until the messages are consumed or until the messages expire

September 28, 2010COMS W Point-to-Point Each message has only one consumer A sender and a receiver of a message have no timing dependencies - the receiver can fetch the message whether or not it was running when the client sent the message The receiver acknowledges the successful processing of a message

September 28, 2010COMS W Publish/Subscribe Clients address messages to a topic Each message can have multiple consumers Publishers and subscribers are anonymous and can dynamically publish or subscribe to the content hierarchy The system distributes the messages arriving from a topic’s multiple publishers to its multiple subscribers Topics retain messages only as long as it takes to distribute them to current subscribers

September 28, 2010COMS W Publish/Subscribe Publishers and subscribers have a timing dependency – a client that subscribes to a topic can consume only messages published after the client has created a subscription, and normally the subscriber must continue to be active in order for it to consume messages JMS relaxes this timing dependency by allowing durable subscriptions, which receive messages sent while the subscribers are not active

September 28, 2010COMS W How are Message-Driven Beans Different from Session Beans? Developer does not define any interfaces, only a bean class that implements the MessageListener interface Otherwise resembles a stateless session bean: – Retains no data or conversational state for a specific client – All instances equivalent, allowing EJB container to assign a message to any bean instance in a pool – Can process messages from multiple clients (one at a time) – Client-independent state can be retained across messages (e.g., JMS API connection, open database connection, object reference to an enterprise bean)

September 28, 2010COMS W Lifecycle of a Message-Driven Bean The container usually creates a pool of message-driven bean instances For each, the container calls method, if any

September 28, 2010COMS W Lifecycle of a Message-Driven Bean A message-driven bean is never passivated, and it has only two states: nonexistent and ready to receive messages At the end of the life cycle, the container calls method, if any

Upcoming Assignments September 28, 2010COMS W415637

Upcoming Assignments Homework #3 due Thursday 30 September, 10am Homework #3 Project Concept due Tuesday 5 October, 10am Project Concept Posted on course websitecourse website Submit via CourseWorksCourseWorks September 28, 2010COMS W415638

COMS W4156: Advanced Software Engineering Prof. Gail Kaiser September 28, 2010COMS W415639