Eric J' Bruno - PowerPoint PPT Presentation

1 / 35
About This Presentation
Title:

Eric J' Bruno

Description:

The communication between and within components of a software system. More than JMS ... listener implements the new EventListenerDist interface, instead of ... – PowerPoint PPT presentation

Number of Views:49
Avg rating:3.0/5.0
Slides: 36
Provided by: ericb52
Category:

less

Transcript and Presenter's Notes

Title: Eric J' Bruno


1
Eric J. Bruno
  • www.ericbruno.com
  • eric_at_ericbruno.com
  • Consultant
  • Java C
  • Architecture and Development

2
Java Messaging
  • JMS
  • JavaBean Events
  • Web-services
  • Combining JMSand Web-services
  • Distributed softwaresystems design
  • Messaging framework

3
What is Messaging?
  • The communication between and within components
    of a software system.
  • More than JMS
  • Components may be within the same JVM or not
  • Take the same approach

4
Why is Messaging Important?
  • Complexity
  • Most software is not standalone
  • Monolithic development is mostly history
  • Web-based applications
  • Mobile applications

5
Lots of Java APIs for Communication
  • Java IO / NIO
  • JavaBeans
  • RMI
  • JNDI
  • JavaMail
  • JMS
  • JINI / JavaSpaces
  • JXTA
  • JAX-RPC (JAX-WS)
  • JAXM
  • SAAJ
  • JMS
  • MDB
  • J2ME
  • CORBA

6
JavaBean Events
  • Source component
  • Listener component
  • Event interface
  • Event object

7
JavaBean Event Downside
  • JavaBean events cause dependencies
  • Synchronous only
  • Confined to one JVM
  • Not anonymous

8
Java Event Agent
  • Anonymous events
  • Source and Listener completely abstracted
  • Demo!

9
Java Remote Method Invocation
  • Pure Java remote procedure calls
  • Across JVMs
  • RPCs are transparent

10
CORBA
  • Object Management Group
  • Allows Java / non-Java communication
  • Internet Inter-ORB Protocol (IIOP)

11
Enterprise MOM (not McNabbs)
  • Reliable exchange of data
  • Guaranteed delivery
  • Transaction support
  • Asynchronous and synchronous
  • Queue-based
  • Reply-based
  • Subscription-based

12
Message Paradigms
  • Request / Reply
  • Analogous to browser / Web server communication

13
Message Paradigms
  • Queue-based (store-and-forward)
  • Messages are persisted
  • One receiver per message

14
Message Paradigms
  • Subscription-based
  • Multi-cast like
  • Publish-and-subscribe
  • One-to-many message delivery
  • Anonymous

15
Combining Message Paradigms
  • Quote System Example
  • Demo!

16
Advanced Messaging (JMS)
  • Message filtering
  • Durable subscriptions
  • Persistence
  • Message acknowledgement
  • Reliable messaging
  • At-most once
  • At-least once
  • Once-and-only-once
  • Transactions
  • Message-Driven Beans (MDB)
  • Queue theory

17
The Messaging Toolkit
  • The JMS Façade
  • Abstracts the JMS API details, including the
    interfaces and setup
  • Quick and easy event listening
  • Quick and east event sending
  • Code comparison

18
The Messaging Toolkit
  • The Event Distributor
  • Extends JavaBean events across JVMs
  • Transparent
  • Uses JMS as the transport
  • Developers can be JMS-agnostic
  • Makes heavy use of Java Reflection

19
The Event Distributor
  • Event listener implements the new
    EventListenerDist interface, instead of
    EventListener
  • package com.toolkit.messagingpublic abstract
    class EventListenerDist private
    EventDistributor eventDistributor
    EventDistributor.getInstance() public
    EventListenerDist() eventDistributor.onNew
    Listener( this )

20
The Event Distributor
  • Event source implements the new EventSourceDist
    interface
  • package com.toolkit.messagingpublic abstract
    class EventSourceDist private
    EventDistributor eventDistributor
    EventDistributor.getInstance() public
    EventSourceDist() eventDistributor.onNewSo
    urce( this ) public abstract String
    getInterfaceNames()

21
The Event Distributor
  • Uses Reflection to
  • Intercept source events
  • Send over JMS
  • Call the correct listeners

22
The Event Distributor
  • Demo!

23
Java Component Server
  • JMS provides a robust message model
  • Messages are safe and guaranteed
  • What about your code?
  • JMS client software still vulnerable to failure
  • Something is needed to monitor JMS producer and
    consumer code

24
Java Component Server (JCS)
  • The JCS hosts producers and consumers
  • You can configure multiple servers to distribute
    them across
  • If a component fails, the JCS will detect and
    restart that component
  • If the entire JCS server fails, another JCS will
    take over
  • Enables cluster-like configuration for your JMS
    code

25
Java Component Server (JCS)
  • Any of number of servers can be clustered and
    configured

26
Java Component Server (JCS)
  • JCS Server B fails, Server A takes over

27
Java Component Server (JCS)
  • JCS component development is easy
  • Interface-based development
  • Supports Queues, Pub/Sub, Request/Response

28
Java Component Server (JCS)
  • Components are managed told when to start and
    stop message processing
  • Uses Reflection to load, start, and stop
    components
  • Provides thread management for parallel
    processing across components
  • JCS servers use JMS themselves to send and
    receive heartbear messages

29
Java Component Server (JCS)
  • Provides a web-based administrative front-end
  • Demo!

30
JMS SOAP Reliability
  • Options
  • JMS can be used within a web-service
    implementation
  • JMS can be used between parts of an SOA-based
    application
  • JMS can be tunneled through HTTP
  • SOAP messages can transported over JMS

31
JMS SOAP Reliability
  • JMS works over the Internet

32
JMS SOAP Reliability
  • An adapter allows SOAP messages to be transported
    over JMS

33
JMS SOAP Reliability
  • SOAP over JMS, tunneled through HTTP

34
JMS SOAP Reliability
  • JMSSOAPConnectionFactory class
  • The javax.xml.soap classes are extended

35
JMS SOAP Reliability
  • Source code
  • Demo!
Write a Comment
User Comments (0)
About PowerShow.com