Date post: | 11-Jan-2016 |
Category: |
Documents |
Upload: | hillary-phelps |
View: | 227 times |
Download: | 4 times |
OpenJMS
An Open Source Implementation of the JMS Specification
Jim AlaterasIntalio Inc.
2
Contents
JMS Specification
History of OpenJMS
Existing Architecture
Work In Progress
Deployment
Development Environment
Current Release
Future Direction
Q & A
3
JMS Specifications
Two Messaging Models - Queues and Topics
Persistent and Non-Persistent Message Delivery
Five Message Types - Text, Byte, Object, Map and Stream
Synchronous and Asynchronous message consumption
Selectors, priority, QueueBrowser
Local and distributed transactions
4
JMS Specifications - Queues
Sender publishers to the Queue and Receiver consumers
Supports multiple senders/receivers per queue
Message Ordering
Undefined Delivery semantics for > 1receiver
Persistent messages delivered exactly once
Non-persistent messages delivered at most once
m sg n
m sg 1m sg 2m sg 3m sg 4m sg 5m sg 6m sg 7
:::
Publisher1
Subscriber1consume
publishmsg1
msg4
msg3
msg2
msg1
msg6
msg5
msg4
msg3
msg2
msg6
msg5
SubscriberProducer
JM S Server
msg1
msg4
msg3
msg2
msg1
msg6
msg5
msg4
msg3
msg2
SubscriberProducer
JM S Server
msg5
msg6
msg6
msg5
msg3
Publisher3
Publisher2
m sg n
m sg 1m sg 2m sg 3m sg 4m sg 5m sg 6m sg 7
:::
Publisher1
Subscriber1Subscriber2
consumeconsume
publish
5
JMS Specifications - Topics
Publisher publishes and Subscribers consumes
Multiple publishers/subscribers per topic
Subscriber each receives own copy of messages
Priority effects message delivery order
Persistent and non-persistent delivery semantics
m sg n
m sg 1m sg 2m sg 3m sg 4m sg 5m sg 6m sg 7
:::
Publisher1
Subscriber1consume
publish
Publisher3
Publisher2
m sg n
m sg 1m sg 2m sg 3m sg 4m sg 5m sg 6m sg 7
:::
Publisher1
Subscriber1Subscriber2
consumeconsume
publish
6
JMS Providers
JMS Providers distribute JMS compliant components/products
21 vendors have a JMS offering
Four Open Source offerings including OpenJMS, ObjectCube, Joram and spyderMQ
A number of commercial products including MQSeries, FioranoMQ and SonicMQ
No compliance test suite available to compare the various offerings
No industry benchmarks to compare performance
7
History of OpenJMS
Sponsored by the Exolab Group (OpenOrb, OpenEJB)
Started in Feb-2000
V0.1 released in May-2000 (pub-sub, p2p, non-persistent, rmi)
V0.2 released in Jun-2000 (jdbc-based persistence, gui, application, testharness)
V0.3 released in Aug-2000 (tcp, temporary destinations, database caching, selectors)
V0.4 released in Oct-2000 (bug fixes, initial queue browser, more client test coverage)
V0.5 released in Dec-2000 (wild card sub, queue browser and flow control)
3 core developers based in Melbourne
8
OpenJMS Architecture
Service based adaptive architecture
Initial focus was on time-to-market and features (RMI and JDBM)
Failed to initially architect for availability and scalability
Second iteration is focusing on failover, clustering and load balancing
In the end the architecture was quite tolerable to change.
Subsequently released more widely used adaptors (TCP, JDBC)
9
Server Internals
Destination Consumer
1
0..*
CacheIterator
1
1
Publisher
MessageManager
1
0..*
1
1
PriorityMessageCache
1
1
1
1
1
0..*
1
0..*
Message0..*0..*0..*
references
0..*
JMS Core
JMS Client
JMS Router
RMI
Server Skeleton Layer
Client Proxy Layer
TCP/IP IntraVM
JMS Cluster
PersistenceAdaptor
JDBCJDBM
LoggingAdaptor
JLogLog4j
ThreadPool
Database TransMgr
ServiceMgr Event
Scheduler
Lease
Logger
JMS Core
JM S Client
RMI
Server Skeleton Layer
Client Proxy Layer
TCP/IP IntraVM
PersistenceAdaptor
JDBCJDBM
LoggingAdaptor
JLogLog4j
ThreadPool
Database TransMgr
ServiceMgr Event
Scheduler
Lease
Logger
JM S Core
Service Layer
O RB Layer
JMS Client
JM S C lient L ibrary
10
OpenJMS Configuration
XML based configuration file generated from Castor tool
Server configuration
Administered Destinations
Participants and Authentication
Persistent adaptors
<element name="ServerConfiguration"> <complexType content="empty" > <attribute name="serverClass" type="string" maxOccurs="1"/> <attribute name="clusterName" type="string" minOccurs="0" maxOccurs="1" /> <attribute name="jmsServerName" type="string" maxOccurs="1"/> <attribute name="jmsAdminServerName" type="string" maxOccurs="1"/> </complexType> </element
<PersistenceAdapterConfiguration minConsumerListSize="10000" minMessageListSize="40000" persistentType="RDBMS" driver="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:oci8:@test" userName="jim" password="ab1234" retries="5" timeout ="2000" />
11
JNDI Integration
Client uses JNDI to lookup factories and destinations
Run an embedded JNDI provider
Connect to an external JNDI provider
Automatic object registration at start-up
Serverconnfactory1
topic1
queue1
connfactory 3
connfactory 2
JNDI Provider
Server
C lient
O penJM S Server
C lient
connfactory1
topic1queue1
connfactory 3connfactory 2
JNDI Provider
12
Administration GUI
Initial Administration GUI deployed with v0.2
New Administration GUI available in v0.6
Create administered destinations
Start and stop the server
Purge persistent messages for a destination
Register durable subscribers
13
Stateless Connections (WIP)
Original server maintained stateful client information
Compicates failover and dynamic load balancing
New architecture moves to stateless
Facilitates failover since client is not tied to a particular server
Facilitates dynamic load balancing
Client information is now part of the request context
OpenJMSClient
Context
ContextOpenJMS
Client
request
request
OpenJMSClient
Context
Context
OpenJMSClient
request
request
14
OpenJMS Clustering (WIP)
OpenJMS will support clustering
Servers in the cluster share the same resources
Multicast channel for inter server comms
Client failover confined to the cluster
You can configure multiple independent clusters
Client uses multicast channel for connection
Server 1
Server 4Server 3
Server 2
cluster2P
P
P
P
P
C
C
C
C
C
Cluster of OpenJMSServers
mul
ticas
t cha
nnel
Server 1
Server 3
cluster2
C
Server 1
Server 3
cluster2
mul
ticas
t cha
nnel
Config
Database
Server 1
Server 3
msg
mul
ticas
t cha
nnel
Server1
Server2
multicastchannel
JNDIServer
1
4
43
2
5
6
Clients load balanced within the cluster
15
Security (WIP)
Security is not specified by the JMS Specifications
OpenJMS uses JAAS for Authorization and Authentication
Authentication is based on participants
Participants are associated with an authentication data source
Supported actions are publish, consumer, browse and administer.
Security can be turned off
Authorization is fine grained and based on destinations, participants and actions
16
Deployment
Standalone Server Configuration
Symmetric Federated Configuration
Cluster Configuration
Asymmetric Federated Configuration
ServerS1
ServerS2t1, t2
ServerS3
t1
t1, t2
t1
t1
t1
Destinationst1 ,t2, t3
Destinationst1 ,t2, t3
Destinationst1 ,t2, t3
ServerS1
ServerS2t1
t1
Destinationst1, t2
Destinationst1, t2
JMSServer
P
C
P P
P
C
CCServer 1
Server 4Server 3
Server 2
cluster2P
P
P
P
P
C
C
C
C
C
Cluster of OpenJMSServers
mul
ticas
t cha
nnel
17
Development Environment
Jakarta ANT as the project build tool
JTF (but will move to Junit for unit testing)
Bugzilla for bug management
Castor’s SourceGen for configuration
ANTLR for selectors
A host of open source libraries including log4j and Tyrex
OpenExec for load and performance tests
18
Current Release
Publish-Subscribe and Point-to-Point
Persistent and Non-Persistent Message Delivery
Synchronous and asynchronous message consumption
Administration GUI
Message Selectors, Priority and QueueBrowser
Local transactions
Test cases and extensive examples
Stand alone or embeddable server
19
Future Direction
Refactored messaging core
New administration GUI
Clustering and federation support
Explicit support for XML messaging
Improved performance of the messaging core
Complete ASF support which includes session pools and XA.
IIOP and SSL support
20
Resources
OpenJMS
JMS Specifications
ANTLR
JUnit
Open Source Initiative
Castor, Tyrex
Jakarta ANT and Log4j
http://openjms.exolab.org
http://java.sun.com/products/jms
http://www.exolab.org
http://www.antlr.org
http://jakarta.apache.org
http://www.junit.org
http://www.opensource.org
Q & A
Thank you