integrating openedge ® applications with sonicmq ® pat bonser
Post on 19-Dec-2015
238 views
TRANSCRIPT
Integrating OpenEdgeIntegrating OpenEdge®® Applications with Applications with SonicMQSonicMQ®®
Pat Bonser
2 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Agenda
JMS (Java™ Messaging Service) concepts & SonicMQ
OpenEdge Adapter for SonicMQ– What is it?
– How do I install and configure? Show me examples! Futures, what’s planned for OpenEdge
10.1A Adapter for SonicMQ
3 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
What is Messaging?
A mechanism enabling autonomous applications to communicate
Messages - units of information composed of– Payload– Header
Destinations Priority Ordering Expiration Time-to-Live And more …
4 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Application A
JMS Broker
Destination
Application B
How Does It Work?
Message Oriented Middleware
Bind todestination
Bind todestination
Producer Consumer
Sendmessage
Consumemessage
Read message
5 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
JMS Messaging Models
Point to Point (1 to 1)
Publish and Subscribe (1 to Many)
QueueSender
Potential Receiver
TopicPublisher
Subscriber
Subscriber
Potential Receiver
6 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Connections and Sessions
A connection connects to a message broker
You can create one or more sessions within a connection
JMS Client
Connection
Queue Session
Topic Session
7 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Unified Domain (JMS 1.1)ConnectionFactory
Connection
Session
MessageConsumerMessageProducer
Destination(Queue or Topic)
MessageSends Messages To Receives Messages From
Destination(Queue or Topic)
CreatesCreates
Creates
Creates
Creates
8 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
So what is SonicMQ?
A Standards-Based Enterprise Messaging Server– A full functional implementation of JMS 1.1
specification
– J2EE Compatibility 1.3 - 1.4
– Distributed Management Framework
– Innovative Deployment Architectures User Benefits
– Enterprise-class reliability, scalability, performance using standards-based infrastructure
– Distributed management simplifies and reduces cost of deployment, configuration, monitoring
9 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
SonicMQ Domain Manager
Agent Manager
Directory Service
Domain Manager
SonicMQManagement
Broker
Start →Programs → Sonic Software → SonicMQ → SonicMQ Domain Manager
10 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Sonic Management ConsoleStart →Programs → Sonic Software → SonicMQ → Management Console
11 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Queues Must Be Predefined
12 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Sonic JMS Test Client
Allows you to use messaging concepts without having to write Java code
Start →Programs → Sonic Software → SonicMQ → JMS Test Client
13 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Demonstration SonicMQ
Demonstrate– Tool - Management Console
Create a queue
– Tool - JMS Test Client PTP demo using new Queue Pub/Sub demo creating a Topic
14 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
OpenEdge Adapter for SonicMQ
JMS concepts & SonicMQ OpenEdge Adapter for SonicMQ
– What is it?
– How do I install and configure? Show me examples! Futures, what’s planned for OpenEdge
10.1A Adapter for SonicMQ
15 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
OpenEdge Adapter for SonicMQ
OpenEdge Adapter for SonicMQ– Connects Progress 4GL app with SonicMQ
Seamless integration with existing 4GL– Development tools and Methodologies
Uses direct access from the 4GL to SonicMQ– Specific procedures for the Sonic API
Enterprise Integration for OpenEdge Applications
16 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
OpenEdge Adapter for SonicMQ
Direct access from 4GL to SonicMQ– GUI applications
– Character applications (UNIX)
– AppServer
– Webspeed agents
– Batch jobs Connection between
– 4GL applications
– 4GL and non 4GL applications
17 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
OpenEdge Adapter for SonicMQ Architecture
PROGRESS 4GL
*.w, *.p
4GL
A
dap
ter
bro
ker
4GL
cli
ent
OpenEdge Database SonicMQ
18 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Progress Adapter Programs
Supplied .r files with API– For point to point
Install-dir/jms/ptpsession.r
– For publish and subscribe Install-dir/jms/pubsubsession.r
19 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Leverage SonicMQ jars
Copy – from SonicMQ install to Progress directory
install-dir\java\sonicMQ\lib
Alternatively– Point your lib directory to
install-dir\java\sonicMQ\lib
20 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Environment Variables
Environment Variable
Used By
Description
SONIC_HOME Sonic The installation directory for SonicMQ. Typically, this is C:\Sonic\MQ6.1
JAVA_HOME Sonic &Progress
Can use the files installed with Sonic, Progress or a compatible jre directory
PATH Progress You should include SONIC_HOME\bin and JDK_HOME\bin in your PATH environment variable
21 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Progress Components
•AdminServer
•OpenEdge Adapter for SonicMQ
•NameServer (Optional)
22 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
OpenEdge Adapter for SonicMQ
JMS concepts & SonicMQ OpenEdge Adapter for SonicMQ
– What is it?
– How do I install and configure? Show me examples! Futures, what’s planned for OpenEdge
10.1A Adapter for SonicMQ
23 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
PTP - Example
SonicMQ
OpenEdge Application
OpenEdge
Application
24 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
PTP - Basic Steps
1. Requires a Queue
2. Connect to a SonicMQ Broker
3. Create a Message Consumer
4. Prepare to Receive Message From Queue
5. Send Message to Queue
6. Receive message from Queue
7. Delete message
25 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
PTP – Requires a Queue
Sonic Management Console
26 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
PTP - Connect to SonicMQ Broker
RUN jms/ptpsession.p PERSISTENT SET ptpsession
("-H localhost -S 5162 ").
RUN setBrokerURL IN ptpsession (“tcp//machinename:2506").
RUN beginSession IN ptpsession.
5162Broker2506
OpenEdge Application
27 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
PTP – Create Message to Send/* Create a Text Message */
RUN createTextMessage IN ptpsession
(OUTPUT messageH)./* Handles the messages */
RUN setText IN MessageH (“Your Message”).
SonicBroker
OpenEdge Application
5162
28 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
5162
OpenEdge Application
PTP - Send Message to Queue/* Send Message to the “desired” Queue */
RUN sendToQueue IN ptpsession (“YourQueue",
messageH, /* message handle */
?, /* priority, ? = system default */
?, /* timeToLive, ? = system default */
?). /* deliveryMode, ? = system default */
Sonic
Broker
29 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
PTP – Receive Message from Queue- Java/* Create Receiver Queues to receive messages */
javax.jms.Queue receiveQueue = receiveSession.createQueue(rQueue);
javax.jms.MessageConsumer qReceiver = receiveSession.createConsumer(receiveQueue);
qReceiver.setMessageListener(this);
connect.start();
Sonic
Broker
5162
OpenEdge Application
30 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
OpenEdge
Application
PTP – Receive Message from Queue – 4GL/* Receive Message to the “desired” Queue */
RUN receiveFromQueue IN ptpsession
(“YourQueue", /* Name of the Queue */
?, /* No message selector */
consumerH, /* Handle incoming message default */
Sonic
Broker
OpenEdge Application
31 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
PTP Demonstration
32 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Pub/Sub - Example
SonicMQ
OpenEdge Application
OpenEdge
Application
33 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Pub\Sub - Basic Steps
1. Connect to a SonicMQ broker Topics can be set on at run time
2. Create a message subscriber
3. Subscribe to Topic
4. Publish message to Topic
5. Consume message from a Topic
6. Delete message
34 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Pub\Sub - Connect to SonicMQ Broker
5162
5162
Broker2506
RUN jms/pubsubsession.p PERSISTENT SET pubsubsession ("-H localhost -S 5162 ").
RUN setBrokerURL
IN pubsubsession ("tcp://machinename:2506").
RUN beginSession IN pubsubsession.
OpenEdge Application
OpenEdge
Application
35 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Pub\Sub - Create Message Consumer – 4GL/* receives requests from the Topic */
RUN createMessageConsumer IN pubsubsession
(THIS-PROCEDURE, /* This proc handles it */
“YourHandler", /* name of internal proc. */
OUTPUT consumerH).
SonicBroker
OpenEdge Application
OpenEdge
Application
5162
5162
36 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Pub\Sub - Create Message Consumer - Java/* receives requests from the Topic */
subSession = connect.createSession(false,javax.jms.Session.AUTO_ACKNOWLEDGE)
javax.jms.MessageConsumer subscriber =
subsession.createConsumer(topic);
Subscriber.setMessageListener(this);
SonicBroker
OpenEdge Application
OpenEdge
Application
5162
5162
37 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Pub\Sub – Subscribe to TopicRUN SUBSCRIBE IN pubsubsession
("Topic", /* topic name */ ?,
/* Subscription durable */
?, /* No message selector */ NO, /* want my own messages to */ consumerH). /* Handles the messages */
/* Start receiving requests */
RUN startReceiveMessages IN pubsubsession.
SonicBroker
OpenEdge
Application
OpenEdge Application
5162
38 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
OpenEdge Application
Pub\Sub - Publish Message to Topic/* In Bytes Message use mptr to store the XML*/
RUN setMemptr IN msgH (memFile, ?, ?).
RUN publish IN pubsubsession
("Topic", /* Topic name */ msgH, /* message handle */ ?, /* priority, ? = system default */ ?, /* timeToLive, ? = system default */ ?). /* deliverymode, ? = system default */
Sonic Broker
5162
OpenEdge
Application
39 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
OpenEdge
Application
Pub\Sub – Consumer Message from Topic/* From chargeHandler internal procedure */
memptrDoc = DYNAMIC-FUNCTION ('getMemptr':U IN msgH).
hDoc:LOAD("memptr", memptrDoc, FALSE).
hDoc:GET-DOCUMENT-ELEMENT(hRoot).
hRoot:GET-CHILD(hTable, 1).
… /* All your standard business logic */
SonicBroker
OpenEdge Application
5162
40 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Pub/Sub Demonstration
41 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Integrating OpenEdge Applications with SonicMQ
JMS concepts & SonicMQ OpenEdge Adapter for SonicMQ
– What is it?
– How do I install and configure? Show me examples! Futures, what’s planned for OpenEdge
10.1A Adapter for SonicMQ
42 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
D I S C L A I M E R
Under Development
This talk includes information about potential future products and/or product enhancements.
What I am going to say reflects our current thinking, but the information contained herein is preliminary and subject to change. Any future products we ultimately deliver may be materially different from what is described here.
D I S C L A I M E R
43 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Installation
Prior to 10.1A – Users had to manually move jar files to
appropriate directories
In 10.1A – Sonic “Silent Install” will move files to
appropriate locations without user interaction
44 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Architecture
Prior to 10.1A, only one option– OpenEdge Adapter for SonicMQ
In 10.1A, two additional options – OpenEdge Adapter for SonicMQ ClientConnect
– OpenEdge Adapter for SonicMQ ServerConnect
45 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Prior to 10.1AOpenEdge Adapter for SonicMQ
RUN jms/ptpsession.p PERSISTENT SET hptpsession
("-H myAdminServerMachine -S 5162 ").
RUN setBrokerURL IN hptpsession (“tcp//mySonicMachine:2506").
RUN beginSession IN hptpsession.
AdminServer
NameServer
MQAdapter
SonicMQ Broker 2506
Thread 1
Thread 2
Thread 3
myAdminServerMachinemySonicMachine
QUEUEJMS
API-JMS
API-JMS
46 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
OpenEdge Adapter for SonicMQ ClientConnect
RUN jms/ptpsession.p PERSISTENT SET hptpsession
(“-SMQConnect").
RUN setBrokerURL IN hptpsession (“tcp//mySonicMachine:2506").
RUN beginSession IN hptpsession.
SonicMQ Broker 2506
mySonicMachine
QUEUE
API-JMS
Thread 2
Thread 1
Thread 2
Thread 1
API-JMS
47 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
OpenEdge Adapter for SonicMQ ServerConnect
AdminServer
NameServer
AppServer
SonicMQ Broker 2506
Thread 1
Thread 1
Thread 1
mySonicMachine
QUEUEAPI-JMS
X
48 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Combination of PTP and Pub/Sub
Prior to 10.1A– Two different session
RUN jms/ptpsession.p.. RUN jms/pubsubsession.p…
In 10.1A– Parent containing all API
RUN jms/jmssession.p…
49 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
Functionalities and Upgraded APIs
Client Persistence Enhanced XML support Temp Table messages ProDataSet messages Fault Tolerance Serialized Connection Objects …
50 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
In Summary
The adapter allows 4GL programmers to use JMS messaging techniques from 4GL code
It is easy to install and run examples
Customers are successfully using this technology in Progress V9 and OpenEdge 10
WebSpeed
Web Client
Java
Any
.NET
4GL
SonicBroker
51 Integrating OpenEdge Applications with SonicMQ © 2005 Progress Software Corporation
JMS concepts & SonicMQ OpenEdge Adapter for SonicMQ
– What is it?
– How do I install and configure? Show me examples! Futures
– OpenEdge 10.1A Adapter for SonicMQ
Questions