1 jbus, a platform independent publish/subscribe bus for cwave 2000 m.s. thesis defense joseph w....
Post on 20-Dec-2015
223 Views
Preview:
TRANSCRIPT
1
JBus, A Platform Independent Publish/Subscribe Bus for CWave
2000
M.S. Thesis Defense
Joseph W. Longson
March 30, 2000
2
Publish / Subscribe bus
BusClient
BusClient
BusClient
Pub/Sub bus
Implementation is like a chat room– Each member uses a room number for communication (topic)
– Allows multiple clients in the same room (topic)
– Transmit strings, pictures, sounds, etc (data)
Introduction
3
Platform Independent
Code does not rely upon a platform– Implemented for a virtual platform
– Multiple Operating Systems for clients (Mac, Windows, UNIX, etc)
– Multiple Hardware Platforms for clients (Mac, PC, SGI, SUN, etc)
Introduction
UNIXPlatform
MacPlatform
WindowsPlatform
BusClient
BusClient
BusClient
Pub/Sub bus
4
CWave 2000 Toolkit
Toolkit containing many components including– Environment for setting up bus clients
– Publish Subscribe bus implementation
Includes a Publish / Subscribe bus implementation– Based on Microsoft’s COM/DCOM, limited to the Windows platform
– Allows process and machine independent client interaction
Introduction
VBProgram
C++Program
MS JavaProgram
WindowsPlatform
WindowsPlatform
WindowsPlatform
CWave bus
5
Problem Statement
Problem: CWave 2000 not platform independent.– Limited to the Windows OS, on the PC platform
– Uses DCOM, which is designed for a LAN, not for the Internet
Solution: – Extend CWave 2000’s Publish / Subscribe bus
– Allow communication from other operating systems
– Allow non-COM languages to communicate with bus
Introduction
6
JBus
Provides a platform independent Publish / Subscribe bus
– Implemented in Java for the Java Virtual Machine
– Interfaces available for Java, C, and C++
Compatible with the CWave 2000 System– But not dependent on it
Introduction
VBProgram
C++Program
MS JavaProgram
WindowsPlatform
WindowsPlatform
WindowsPlatform
CProgram
JavaProgram
WindowsPlatform
UNIXPlatform
MacPlatform
JBus
Java Pub/Sub bus CWave Pub/Sub bus
C++Program
7
Primary Design Constraints
Platform independence– Hard to achieve completely, so this will used as a guideline
Leverage the Internet for communication– Using HTTP and XML for message Transport
Maintain compatibility with CWave 2000– Compatible but not dependent on CWave
Modular design– Allows bus implementation to be easily replaced
Introduction
8
Secondary Design Constraints
Have a small memory and disk space footprint– This allows JBus clients such as Web Browsers to be developed
Platform independent data marshalling– This is a hard constraint that may not be solved
Support new and existing C/C++ clients– Extends the languages available for JBus client implementation
Entire system should perform at an interactive level– Performance will be tuned to a usable level
Introduction
9
Related Work
Introduction
Platform Inde-
pendence
HTTPCWave
compatibleModularDesign
SmallSize
DataMarshaling
C/C++Clients
Performance
CWave2000
no no yes no partial no yes yes
TIBCO partial no yes no yes no yes yes
Voyager yes no yes no partial no yes yes
iBus yes no maybe no partial no yes yes
JMS/JMQ
partial yes maybe no no partial partial yes
SOAP yes yes no no N/A partial no no
Siena no yes no no no no yes yes
JINI yes no no no yes yes no yes
JBus yes yes yes yes yes partial partial no
Product
Secondary ConstraintsPrimary Constraints
10
Java BusImplementation
11
JBus Representation
Provided the illusion of a single omnipresent bus– Platform independent (using Java)
– Topic based communication
JBus
JavaClient
Machine 1, Windows Machine 3, Web Browser
WebClient
JavaClient
Machine 2,UNIX C++
Client
Phase 1
12
JBus Implementation
Implemented as a set of connected local buses– Each client has a local bus instance
– Transport objects used for communication between buses
– Each local bus acts as either a Server or Proxy
Phase 1
Machine 2, UNIX
JBus
JavaClient
Machine 1, Windows
C++Client
Transport Transport
JBus
13
JBus Architecture
Bus Client Interface
Message Filtering
Message Transport
Bus Client Interface– Used to get a JBus instance
– Publish/Subscribe methods
Message Filtering– Routes messages to Bus
Clients
– Filtering of messages
Message Transport– Implemented as Bus Client
– Can have local filtering
– Communicates using desired medium (e.g. HTTP, SSL)
Phase 1
14
JBus Client Example
Case 1, Java Client– Connects as a Bus Server
– Installs an HTTP Server on the local machine
Case 2, C/C++ Client– Connects as a Bus Proxy
– Remotely connects to a machine using the HTTP protocol
Phase 1
15
2
Bus Factory
JavaClient
(1) - Java Client asks Bus Factory to create a Bus Server
HTTPServer
Bus Server
(2) - Bus factory creates Bus Server and HTTP Server
(3) - HTTP Server subscribes to bus and begins communicating with bus
(4) - Client begins communicating with bus
43
Phase 1
Bus Factory
1
JBus Client Example Case 1: Java Client
Machine 1
16
Bus Factory
5
6
Bus Factory
(5) - C/C++ Client asks Bus Factory to create a Bus Proxy to a Server
(6) - Bus Factory creates a local Bus Proxy and a local Transport object
(8) - Communication commences between Transport Objects
JavaClient
HTTPServer
Bus Server
C/C++Client
Bus Proxy Transport
(7) - Remote HTTP Server creates a Transport Object for proxy connection
(9) - Client and Transports begin communicating with their buses
Transport7
89
Phase 1
JBus Client Example Case 2: C/C++ Client with Transports
Machine 1
Machine 2
17
JBus Client Example Case 1 and 2 in action
18
CWave 2000 GatewayObject
19
Gateway Object Representation
Interfaces between the JBus and CWave 2000– Transparent to the client
– Allows communication from either implementation
Phase 2
JBus CWave 2000
Gateway
JBus interface
CWave interface
JavaClient
CWaveClient
20
Gateway Object Implementation
Implemented as a JBus object– This provides a transparent interface for JBus clients
Uses Microsoft’s Extensions for Java– This allows communication with the CWave 2000 bus
Phase 2
21
JBus Client Example
Case 3, CWave Client– Uses the Gateway Object
– Connects as a Bus Proxy
– Begins communicating with JBus or CWave bus clients
Phase 1
22
10
Bus Factory
(11) - Bus Factory creates Gateway and Transports. Transports connect and begin communicating
JavaClient
HTTPServer
Bus Server
C/C++Client
Bus Proxy Transport
(10) - CWave Client asks Bus Factory to create a Gateway Proxy to Server
(12) - Client and Transports begin communicating with their buses
Transport
Phase 1
JBus Client Example Case 3: CWave Client with Gateway
CWaveClient
JBus Gateway Transport
Transport
12
12
12
Machine 1
Machine 2
Machine 3
Bus Factory
11
23
JBus Client Example Case 3 in action
24
Data Marshalingwith XML
25
Data Marshaling
What is Data Marshaling?– The translation of data from one
form to another
Where is it used?– Between Transport Objects
– Between Programming Languages
What options do we have?– BINARY
– ASCII
– XML
Phase 3
01 10110111
04 01011011
BINARY
183 c
ASCII
<INT>183</INT>
<CHAR>c</CHAR>
XML
26
XML
Similar to HTML– ASCII format
– Uses the concept of Tags
Structure of XML– Stores the format with the data
– Multiple formats can be intermixed in a transmission
Why use?– Flexible
– Platform Independent
– Many parser implementations available.
<?xml version=1.0”?><CWAVE> <CM t=”Hello” f=”SIMPLE”> <SIMPLE> <STRING>World</STRING> </SIMPLE> </CM> <CM t=”Hello” f=”COMPLEX”> <COMPLEX n=“2”>
<STRING>World</STRING> <FLOAT>3.14159</FLOAT>
</COMPLEX> </CM></CWAVE>
Phase 3
27
What to Marshall?
Easy Hard
Primitives: Int, Float, Char, etc
Multi-element A: AnEvent, Java Vector
Complex:Struct, Class
Subtyping:Inherited classes, Multiple class instances
JBus 1.0
Multi-element B: general collectionclasses
Phase 3
28
Bus Factory
JavaClient
HTTPServer
Bus Server
C/C++Client
Bus Proxy Transport
(13) - Properly Marshal data between the Client and the bus, and between Transports
Transport
Phase 1
JBus Client Example with Data Marshaling
CWaveClient
JBus Gateway Transport
Transport
Machine 1
Machine 2
Machine 3
13
29
JBus Client Example with Data Marshaling in action
30
Performance Results
31
Preliminary PerformanceSingle Process Subscriber Notify Time
0
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
100 1,000 10,000 100,000
Number of Messages
Me
ssa
ge
s p
er
Se
con
d
1
5
10
25
32
Preliminary PerformanceSingle Process Subscriber Notify Time
with Gateway Object
0
100
200
300
400
500
600
100 1,000 10,000
Number of Messages
Me
ssa
ge
s p
er
Se
con
d
1
5
10
25
33
Preliminary Performance
Network Subscriber Notify Time
0
20
40
60
80
100
120
100 1,000 10,000
Number of Messages
Me
ssa
ge
s p
er
Se
con
d
Transmit and Parse
34
Conclusion
35
Contributions
Platform independent extension to CWave 2000– Extends client implementation choice
– Extends CWave communication to the Internet
Message Transport using XML over HTTP– Allows more Platform independent data marshaling
Can function with or without CWave 2000– Allows use of the JBus beyond CWave 2000
Modular bus design– More flexible for bus experimentation
Conclusion
36
Future Research
Performance Tuning
Better data marshaling for complex data types
Enhance the ability for thin clients to use the JBus
Conclusion
37
Questions?
Thank you!
38
Preliminary Performance 2Single Process Subscriber Notify Time
0
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
1 5 10 25
Number of Messages
Me
ss
ag
es
pe
r S
eco
nd
100
1,000
10,000
100,000
39
Preliminary Performance 2Single Process Subscriber Notify Time
with Gateway Object
0
100
200
300
400
500
600
1 5 10 25
Number of Messages
Me
ssa
ge
s p
er
Se
con
d
100 Messages
1,000 Messages
10,000 Messages
40
Preliminary Performance 2
41
Extensions
C/C++ Extension
Web Extension
42
JBus++ Extension (C/C++)
Extension to the JBus Client Interface
– Allows C or C++ clients to use the JBus functionality
– Relies upon the JNI from Sun
Data Marshaling– XML
– JNI Data Types
JBus Client Interface
Message Filtering
Message Transport
JBus++ Client Interface
Extensions
43
Web Extension
HTTP Transport– Allows Firewall Penetration
– Works with Proxy Servers
Web Clients– Create a Web Server
– Serves Web pages with embedded Applets
Thin Clients– Use the JME (Java Micro Edition)
– Download Applets
Extensions
44
Research Progression
Phase 1– Java version of the bus
– Simple TCP/IP communication
Phase 2– CWave 2000 Gateway
Phase 3– Data Marshalling using XML
– HTTP communication
Introduction
Extensions– C/C++ clients
– Web Interface
top related