SOA-2: OpenEdge® 10.1A Adapters for SonicMQ®New Install, New Architecture, and New APIs
Cheryl LaBargeSenior Training Program Manager
© 2006 Progress Software Corporation2SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Agenda
New Install Now Supporting JMS 1.1 New Architecture New APIs Error Handling
This presentation includes annotations with additional complementary information. API reference details are supplied in the notes for each slide.
OpenEdge 10.1A Adapters for SonicMQ
© 2006 Progress Software Corporation3SOA-2: OpenEdge 10.1A Adapters for SonicMQ
MQ Client
New Install – A Symbiotic Process
OpenEdge10.1A Connections to Sonic 6.1• SonicMQ 6.1 Client included on OpenEdge
Media
• SonicMQ 6.1 Client “Silent Install” to OpenEdge directory
– Offline.bat or Offline.sh to install later
A component no longer a product
© 2006 Progress Software Corporation4SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Agenda
New Install Now Supporting JMS 1.1 New Architecture New APIs Error Handling
OpenEdge 10.1A Adapters for SonicMQ
© 2006 Progress Software Corporation5SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Prior to 10.1A
Two different sessions• Queue
• TopicRUN jms/pubsubsession.p.
RUN jms/ptpsession.p.
JMS 1.0
© 2006 Progress Software Corporation6SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Example - Prior to 10.1A
DEFINE VARIABLE ptpsession AS HANDLE NO-UNDO.
DEFINE VARIABLE hMsg AS HANDLE NO-UNDO.
DEFINE VARIABLE cText AS CHARACTER
INITIAL “PTPsession ONLY" NO-UNDO.
RUN jms/ptpsession.p PERSISTENT SET ptpsession
("-H OEServer -S 5162").
RUN setBrokerURL IN ptpsession (“tcp://MQBrokerHost:2506”).
RUN beginSession IN ptpsession.
RUN sendToQueue IN ptpsession
("SampleQ1", hMsg, ?, ?, ?).
RUN deleteSession IN ptpsession.
Point to Point Session
Sends to Queue
Prior to 10.1A - Create a ptp session object
© 2006 Progress Software Corporation7SOA-2: OpenEdge 10.1A Adapters for SonicMQ
10.1A - Combination of PTP and Pub/Sub
New in 10.1A• Parent containing all APIs
All new code should use jmssession.p!!!
RUN jms/jmssession.p.
JMS 1.1 Unified Domain Model
© 2006 Progress Software Corporation8SOA-2: OpenEdge 10.1A Adapters for SonicMQ
DEFINE VARIABLE hSession AS HANDLE NO-UNDO.
DEFINE VARIABLE hMsg AS HANDLE NO-UNDO.
DEFINE VARIABLE cText AS CHARACTER
INITIAL “Unified JMSsession" NO-UNDO.
RUN jms/jmssession.p PERSISTENT SET hSession
("-H myMachine -S 5162").
RUN setBrokerURL IN hSession (“tcp://:2506").
RUN sendToQueue IN hSession
("SampleQ1", hMsg, ?, ?, ?).
RUN publish IN hSession ("Topic1", hMsg, ?, ?, ?).
RUN deleteMessage IN hMsg.
RUN deleteSession IN hSession.
Example - Unified Session in 10.1A
Using a single session handle
One session handle can send to queues AND publish to topics
© 2006 Progress Software Corporation9SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Demonstration – Unified SessionSampleQ1
Topic1
Using Sonic JMS Test Client to view messages
© 2006 Progress Software Corporation10SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Agenda
New Install Now Supporting JMS 1.1 New Architecture New APIs Error Handling
OpenEdge 10.1A Adapters for SonicMQ
© 2006 Progress Software Corporation11SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Architecture
Prior to 10.1A• OpenEdge Adapter for SonicMQ
OpenEdge 10.1A Connection Modes• BrokerConnect
• ClientConnect
• ServerConnect
OpenEdge Adapter for SonicMQ
© 2006 Progress Software Corporation12SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Example - BrokerConnect
Prior to 10.1A• Separate
processes– OpenEdge
Adapter – Client
Still available in 10.1A
RUN jms/jmssession.p PERSISTENT SET hSession
("-H OEServer -S 5162“).
RUN setBrokerURL IN hSession(“tcp://MQBrokerHost:2506").
RUN beginSession IN hSession .
© 2006 Progress Software Corporation13SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Example - ClientConnect
SonicMQ ClientConnect• Single Process -
OpenEdge Adapter & Client
• AdminServer & NameServer no longer needed
RUN jms/jmssession.p PERSISTENT SET hSession
(“-SMQConnect").
RUN setBrokerURL IN hSession(“tcp://MQBrokerHost:2506").
RUN beginSession IN hSession.
© 2006 Progress Software Corporation14SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Example - ServerConnect
MQ-ServerConnect
© 2006 Progress Software Corporation15SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Logging
ClientConnect logging disabled by default• JavaTools.properties
– brkLogginglevel– srvrLogginglevel
ServerConnect• Similar to 10.0A logging
• New page on AppServer and WebSpeed Agents
© 2006 Progress Software Corporation16SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Limitations of BrokerConnect
Feature BrokerConnect ClientConnect ServerConnect
Unified Domain Yes Yes Yes
Client Persistence No Yes Yes
Fault Tolerance No Yes Yes
Message Selectors Yes Yes Yes
Serialized Connection Objects No Yes Yes
TemporaryQueues and Topics Yes Yes Yes
BrokerConnect cannot take advantage of certain features
© 2006 Progress Software Corporation17SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Agenda
New Install Now Supporting JMS 1.1 New Architecture New APIs Error Handling
OpenEdge 10.1A Adapters for SonicMQ
© 2006 Progress Software Corporation18SOA-2: OpenEdge 10.1A Adapters for SonicMQ
New and Enhanced APIs
Client Message Persistence Fault Tolerant Client Connections Serialized Connection Objects Enhanced XML support Temp Table messages DataSet messages Temporary Destinations Server Based Message Selectors
© 2006 Progress Software Corporation19SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Client Persistence
Allows applications to continue to send/publish messages when MQBroker connection is lost
Rechecking at set intervals
Messages are sent from local store (directory) when a connection is reestablished
Available only with new connection modes
© 2006 Progress Software Corporation20SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Steps to Use Client Persistence
1. Create the session object
2. Use new client persistence APIs
3. Begin the session
4. Send/receive messages– If SonicMQ Broker unavailable,
messages sent will be persisted
© 2006 Progress Software Corporation21SOA-2: OpenEdge 10.1A Adapters for SonicMQ
1. Create Session Object
RUN jms/jmssession.p PERSISTENT SET hSession
("-SMQConnect").
RUN setBrokerURL IN hSession ("localhost:2506").
RUN SETUSER IN hSession ("Administrator").
RUN setPassword IN hSession("Administrator").
/* Client Persistence Requires a Client ID */
RUN setClientID IN hSession ("TestClientPersistence999").
Client Persistence Requires an ID
Type Name Parameters\Returns
Procedure setClientID INPUT clientID AS CHAR
Standard Steps…Except …
© 2006 Progress Software Corporation22SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Set/Get• Local Store Directory
• Local Store Size
• Reconnect Timeout
• Reconnect Interval
• Client Persistence
2. Use New Client Persistence APIs
New APIs
© 2006 Progress Software Corporation23SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Local Store Directory
Directory to persist messages
Type Name Parameters\Returns
Procedure setLocalStoreDirectory INPUT localStoreDir AS CHAR
Function getLocalStoreDirectory RETURNS CHAR
• Default, current working directory
– C:\OpenEdge\WRK
• Before beginSession
© 2006 Progress Software Corporation24SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Local Store Size
Maximum File Size
• Default 10,000(KB)
• Before beginSession
Type Name Parameters\Returns
Procedure setLocalStoreSize INPUT storeSize AS INTEGER
Function getLocalStoreSize RETURNS INTEGER
© 2006 Progress Software Corporation25SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Reconnect Timeout
How long will it keep trying to reconnect
• Default 0 Minutes = No limit
• Before beginSession
Type Name Parameters\Returns
Procedure setReconnectTimeout INPUT timeout AS INTEGER
Function getReconnectTimeout RETURNS INTEGER
© 2006 Progress Software Corporation26SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Reconnect Interval
Time between attempts
• Default 30 Seconds
• Before beginSession
Type Name Parameters\Returns
Procedure setReconnectInterval INPUT interval AS INTEGER
Function getReconnectInterval RETURNS INTEGER
QUESTION:What happens if you give up?
ANSWER: Messages stay in local store.
ANSWER: No, you can crack the local message open “just to look”!
© 2006 Progress Software Corporation27SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Client Persistence
Enable the client side property
• Default False
• Before beginSession
Type Name Parameters\Returns
Procedure setClientPersistence INPUT enabled AS LOGICAL
Function getClientPersistence RETURNS LOGICAL
© 2006 Progress Software Corporation28SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Create Rejected Message Consumer
Handles all rejected message
• After beginSession
Name Parameters
createRejectedMessageConsumer INPUT procHandle AS HANDLE
INPUT procName AS CHAR
OUTPUT consumerHandle AS HANDLE
© 2006 Progress Software Corporation29SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Example - Using the New APIs
/* local store directory relative to cwd */RUN setLocalStoreDirectory IN hSession ("mqstore").RUN setLocalStoreSize IN hSession (50000)./* Give up if broker down 10 hours */RUN setReconnectTimeout IN hSession (600)./* Retry every minute */RUN setReconnectInterval IN hSession (60)./* set Client Persistence */RUN setClientPersistence IN hSession (TRUE)./* Note CreateRejectedMessageConsumer must be done *//* AFTER BeginSession. You will see this later */
© 2006 Progress Software Corporation30SOA-2: OpenEdge 10.1A Adapters for SonicMQ
3. Example - Begin the Session
RUN beginSession IN hSession./*After beginSession, createRejectedMessageConsumer*/RUN createRejectedMessageConsumer
IN hSession (INPUT THIS-PROCEDURE, INPUT "RejectedMsgHandler", OUTPUT HrejectedMsg).
Standard Steps…plus calling new API
© 2006 Progress Software Corporation31SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Demonstration4a. Send Messages
Start • SendToQueue Window• Send “This is the first Message”
Stop Container1 Notice: Client shows no signs of lost
connection Send 4 more messages Restart Container1
• Persistent client will send to Queue by collecting from mqstore
© 2006 Progress Software Corporation32SOA-2: OpenEdge 10.1A Adapters for SonicMQ
4b. Receive Messages
Start JMS Test Client to receive all messages
Seeing is believing
© 2006 Progress Software Corporation33SOA-2: OpenEdge 10.1A Adapters for SonicMQ
New and Enhanced APIs – By Concepts
Client Message Persistence Fault Tolerant Client Connections Serialized Connection Objects Enhanced XML support Temp Table messages DataSet messages Temporary Destinations Server Based Message Selectors
© 2006 Progress Software Corporation34SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Domain
What is Fault Tolerance?
Container1
Broker1
Directory Service
JNDI Store
Agent Manager
DomainManager
PrimaryContainer
PrimaryBroker*
PrimaryBackupContainer
PrimaryBackupBroker*
Replication Connection(s)
*Requires CAA Licensing
Defining backup broker to pickup if primary broker fails
© 2006 Progress Software Corporation35SOA-2: OpenEdge 10.1A Adapters for SonicMQ
SonicMQ Broker • Must be licensed for Fault Tolerance
• Primary and Backup Broker must be configured and tested
ABL Client can Set/Get• Fault Tolerance
• Client Transaction Buffer Size
• Initial Connection Timeout
• Reconnect Timeout
Using Fault Tolerant Client ConnectionsAvailable only with new connection modes
© 2006 Progress Software Corporation36SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Fault Tolerant Client Connections
Enable/Disable Fault Tolerance
• Before beginSession• Default is FALSE
Type Name Parameters\Returns
Procedure setFaultTolerant INPUT enable AS LOGICAL
Function getFaultTolerant RETURNS LOGICAL
© 2006 Progress Software Corporation37SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Client Transaction Buffer Size
Client Transaction Buffer Size
• Before beginSession
• Maximum buffer size for transactions
• Default 0 Bytes. If 0, it will use SonicMQ Broker defined value instead
Type Name Parameters\Returns
Procedure setClientTransactionBufferSize INPUT CTBuffer AS INTEGER
Function getClientTransactionBufferSize RETURNS INTEGER
© 2006 Progress Software Corporation38SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Fault Tolerant Client Connections
Initial Connection Timeout
• Before beginSession
• Time to wait for initial connection to broker
• Seconds, default 30
Type Name Parameters\Returns
Procedure setInitialConnectionTimeout INPUT FTInitTimeout AS INTEGER
Function getInitialConnectionTimeout RETURNS INTEGER
© 2006 Progress Software Corporation39SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Fault Tolerant Client Connections
Reconnect Timeout
• Before beginSession
• Time to attempt to reconnect to broker
• Seconds, default 60
Type Name Parameters\Returns
Procedure setFaultTolerantReconnectTimeout INPUT PARAMETER
FTReconnect AS INTEGER
Function getFaultTolerantReconnectTimeout RETURNS INTEGER
© 2006 Progress Software Corporation40SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Fault Tolerant Example
DEFINE VARIABLE hSession AS HANDLE.RUN jms/jmssession.p PERSISTENT
SET hSession ("-SMQConnect").RUN setConnectionURLs IN hSession("Primary:2508,BackupServer:9876”).RUN setFaultTolerant IN hSession(TRUE)./***************************************************Default valuesClientTransactionBufferSize,0 bytes defaults to SonicInitialConnectionTimeout, 30 seconds FaultTolerantReconnectTimeout, 60 seconds ****************************************************/RUN beginSession IN hSession.RUN createChangeStateConsumer IN hSession
(THIS-PROCEDURE, "msgHandler", OUTPUT msgH).
Available only with new connection modes
© 2006 Progress Software Corporation41SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Verify Broker is licensed for Fault Tolerance
• After beginSession
• Default Disabled (FALSE)
Notify Application of lost Broker connection
• After beginSession
• Optional, default is not to notify
Fault Tolerant Client Connections
Type Name Parameters\Returns
Function isFaultTolerant RETURNS LOGICAL
Type Name Parameters\Returns
Procedure createChangeStateConsumer INPUT procHandle AS HANDLE
INPUT procName AS CHAR
OUTPUT consumerHandle
AS HANDLE
© 2006 Progress Software Corporation42SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Change State Consumer
PROCEDURE msgHandler: DEFINE INPUT PARAMETER hMessage AS HANDLE. DEFINE INPUT PARAMETER hMsgConsumer AS HANDLE. DEFINE OUTPUT PARAMETER hReply AS HANDLE. DEFINE VAR val AS CHAR NO-UNDO. val = DYNAMIC-FUNCTION
("getCharProperty" IN hMessage, "state"). /* val is "active", "reconnecting", "failed", or "closed" */ DISPLAY val. RUN deleteMessage IN hMessage.END.
© 2006 Progress Software Corporation43SOA-2: OpenEdge 10.1A Adapters for SonicMQ
New and Enhanced APIs – By Concepts
Client Message Persistence Fault Tolerant Client Connections Serialized Connection Objects Enhanced XML support Temp Table messages DataSet messages Temporary Destinations Server Based Message Selectors
© 2006 Progress Software Corporation44SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Example - Serialized Connection Objects
Define file that contains connection data
You can replace
WithRUN setConnectionFile IN hSession
(“connectionfilename”).
RUN setBrokerURL IN hSession ("localhost:2506").
RUN SETUSER IN hSession ("Administrator").
RUN setPassword IN hSession("Administrator").
Type Name Parameters
Procedure setConnectionFile INPUT filename AS CHARACTER
Available only with new connection modes
© 2006 Progress Software Corporation45SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Stores All Default Connection Information
Created by Sonic Administrator
Sonic Administrator completes:
•Lookup Name
•Connection URL
•Default User Name
•Default Password
•Confirm Password
WARNING: Always use machine
names or
IP addresses.
Localhost used
here for generic demo
© 2006 Progress Software Corporation46SOA-2: OpenEdge 10.1A Adapters for SonicMQ
New and Enhanced APIs – By Concepts
Client Message Persistence Fault Tolerant Client Connections Serialized Connection Objects Enhanced XML support Temp Table messages DataSet messages Temporary Destinations Server Based Message Selectors
© 2006 Progress Software Corporation47SOA-2: OpenEdge 10.1A Adapters for SonicMQ
XML Support
Provides easier integration between SonicMQ and OpenEdge• Create an XML message
– Use the X-DOCUMENT handle
or
– Use the SAX-Writer
• Receive an XML Message– Use the X-DOCUMENT handle
or
– Use the SAX-Reader
Additional APIs added to the XMLMessage Object
© 2006 Progress Software Corporation48SOA-2: OpenEdge 10.1A Adapters for SonicMQ
X-Document• Copy XML document into XML message
• Copy XML message into XML document
XML Support - DOM
Type Name Parameters
Function getX-Document RETURNS HANDLE
Type Name Parameters
Procedure setX-Document INPUT HXMLFile AS HANDLE
Additional APIs added to the XMLMessage Object
© 2006 Progress Software Corporation49SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Example - XML Support - DOM
RUN createXMLMessage IN hSession
(OUTPUT hMsg).
CREATE x-document hXDOC.
hXDOC:LOAD("file", “myCustom.xml", false).
RUN setX-Document IN hMsg (hXDOC).
RUN sendToQueue IN hSession
("SampleQ1", hMsg, ?, ?, ?).
RUN deleteMessage IN hMsg.
Additional APIs added to the XMLMessage Object
© 2006 Progress Software Corporation50SOA-2: OpenEdge 10.1A Adapters for SonicMQ
XML Support – Sending with a SAX-Writer
SAX-Writer• Create SAX-Writer handle
• Output destination internal longchar
– Example
hSAXWriter = DYNAMIC-FUNCTION
('getSaxWriter':U IN hMsg, ?)
Type Name Parameters\Returns
Function getSaxWriter INPUT Name CHAR
RETURNS HANDLE
Additional APIs added to the XMLMessage Object
© 2006 Progress Software Corporation51SOA-2: OpenEdge 10.1A Adapters for SonicMQ
XML Support – Sending with a SAX-Writer
SAX-Writer• Delete SAX-Writer handle
– ExampleRUN deleteSaxWriter IN hMsg (hSAXWriter).
Type Name Parameters\Returns
Procedure deleteSaxWriter INPUT swhandle AS HANDLE
Additional APIs added to the XMLMessage Object
© 2006 Progress Software Corporation52SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Returns SonicMQ message type
Checking Message Type
Type Name Parameters\Returns
Function getMessageType RETURNS CHAR
Now Includes:
•DataSetMessage
•TempTableMessage
Message Type
© 2006 Progress Software Corporation53SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Example - XML Support: Receiving with SAX-Reader
Sax-Reader
• Input destination internal longchar– Example
CREATE SAX-READER hSAXReader.
RUN setSaxReader IN hMsg (hSAXReader).
hSAXReader:SAX-PARSE().
DELETE OBJECT hSAXReader.
Type Name Parameters\Returns
Procedure setSaxReader INPUT hSaxReader AS HANDLE
Additional APIs added to the XMLMessage Object
© 2006 Progress Software Corporation54SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Example - Deleting Message
RUN deleteMessage IN hMsg. /* Stop receiving messages */ RUN stopReceiveMessages IN hSession.
© 2006 Progress Software Corporation55SOA-2: OpenEdge 10.1A Adapters for SonicMQ
New and Enhanced APIs – By Concepts
Client Message Persistence Fault Tolerant Client Connections Serialized Connection Objects Enhanced XML support Temp Table messages DataSet messages Temporary Destinations Server Based Message Selectors
© 2006 Progress Software Corporation56SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Temp Table Messages
Allow applications to send and receive • Temp-Tables as XML messages to SonicMQ
SonicMQ Adapter • Converts Temp-Tables to/from XML
SonicMQ• Handles as an XML message
New APIs
© 2006 Progress Software Corporation57SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Create Temp-Table Message
Send Temp-Table to XML Message
Create and Send a Temp-Table as an XML Message
Type Name Parameters\Returns
Procedure createTempTableMessage OUTPUT HMessage AS HANDLE
Type Name Parameters\Returns
Procedure setTempTable INPUT hTable AS HANDLE
INPUT SchemaLocation AS CHAR
INPUT writeSchema AS LOGICAL
© 2006 Progress Software Corporation58SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Example - Create and Send a Temp-Table as an XML Message
DEFINE VARIABLE HSession as HANDLE NO-UNDO.DEFINE VARIABLE HMsg as HANDLE NO-UNDO.DEFINE VARIABLE TempTable tcust LIKE customers
NO-UNDO. /* create temp table records .. */RUN createTempTableMessage in HSession
(OUTPUT HMsg). RUN setTempTable IN HMsg (tcust, ?, TRUE).RUN sendToQueue IN Hsession
("SampleQ1", HMsg, ?, ?, ?)..
© 2006 Progress Software Corporation59SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Read XML Message into Temp-Table
Receiving Temp Table Messages
Type Name Parameters\Returns
Function getTempTable INPUT TTname AS CHAR
INPUT SchemaLocation AS CHAR
INPUT FieldTypeMap AS CHAR
RETURNS HANDLE
© 2006 Progress Software Corporation60SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Example – Receiving Temp Tables
DEFINE VARIABLE mtype AS CHAR NO-UNDO.mtype = DYNAMIC-FUNCTION
('getMessageType':u IN hMsg).MESSAGE "MTYPE is " mType VIEW-AS ALERT-BOX.
IF mtype = "TempTableMessage" THEN DO: MESSAGE “A table message" VIEW-AS ALERT-BOX. hTempttItem = DYNAMIC-FUNCTION
('getTempTable':u IN hMsg, ?, ?, ?). httItem:COPY-TEMP-TABLE( hTempttItem ) . /* TempTable actions as needed */ {&OPEN-BROWSERS-IN-QUERY-{&FRAME-NAME}} DELETE OBJECT hTempttItem. END.
© 2006 Progress Software Corporation61SOA-2: OpenEdge 10.1A Adapters for SonicMQ
New and Enhanced APIs – By Concepts
Client Message Persistence Fault Tolerant Client Connections Serialized Connection Objects Enhanced XML support Temp Table messages DataSet messages Temporary Destinations Server Based Message Selectors
© 2006 Progress Software Corporation62SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Send a ProDataSet as an XML Message to SonicMQ
DataSet Messages
Allow applications to send and receive ProDataSets as XML messages to SonicMQ
SonicMQ Adapter • Converts ProDataSet to/from XML
SonicMQ• Handles as an XML message
© 2006 Progress Software Corporation63SOA-2: OpenEdge 10.1A Adapters for SonicMQ
DataSet Messages
Create DataSet Message
Send ProDataSet to XML Message
Type Name Parameters\Returns
Procedure createDataSetMessage OUTPUT HMessage HANDLE
Type Name Parameters\Returns
Procedure setDataSet INPUT HDataSet AS HANDLE
INPUT schemaLocation AS CHAR
INPUT writeSchema AS LOGICAL
© 2006 Progress Software Corporation64SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Example - DataSet Messages
DEFINE VARIABLE HSession as HANDLE NO-UNDO.DEFINE VARIABLE HMsg as HANDLE NO-UNDO.DEFINE VARIABLE HDataSet AS HANDLE NO-UNDO. /* define DataSet etc etc.. */RUN createDataSetMessage in HSession
(OUTPUT HMsg). RUN setDataSet IN HMsg
(HDataSet, ?, TRUE).RUN sendToQueue IN Hsession
("SampleQ1", HMsg, ?, ?, ?).
© 2006 Progress Software Corporation65SOA-2: OpenEdge 10.1A Adapters for SonicMQ
DataSet Messages
Read XML message into ProDataSet
Type Name Parameters\Returns
Function getDataSet INPUT HDataSet
INPUT schemaLocation
INPUT fieldTypeMap
RETURNS HANDLE
Receive an XML Message into a ProDataSet from SonicMQ
© 2006 Progress Software Corporation66SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Example - Receiving a ProDataSet
IF mtype ="DatasetMessage" THEN DO: RUN PurgeDataset. /* returns dynamic dataset */ hTempdsOrder = DYNAMIC-FUNCTION
('getDataSet':u IN hMsg, ?, ?, ?). /* dumps the dynamic one into static dsOrder */ hdsOrder:COPY-DATASET( hTempdsOrder ) . RUN DisplayDataSetDetails. DELETE OBJECT hTempDSOrder.END.
© 2006 Progress Software Corporation67SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Enhanced APIs
Temp-Table and DataSet messages• Reset message to read-only
• Change Mode to write-only
• Delete Temp-Table or DataSet Message too
Type Name Parameters\Returns
Procedure
reset N\A
Type Name Parameters\Returns
Procedure
clearBody N\A
Type Name Parameters\Returns
Procedure deleteMessage N\A
Existing APIs now support
© 2006 Progress Software Corporation68SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Demonstration
Serialized Connection Object Enhanced XML support Temp Table messages DataSet messages
© 2006 Progress Software Corporation69SOA-2: OpenEdge 10.1A Adapters for SonicMQ
New and Enhanced APIs – By Concepts
Client Message Persistence Fault Tolerant Client Connections Serialized Connection Objects Enhanced XML support Temp Table messages DataSet messages Temporary Destinations Server Based Message Selectors
© 2006 Progress Software Corporation70SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Temporary Destinations
Allow applications to create temporary queues and topics Queue
Topic
Type Name Parameters\Returns
Procedure createTemporaryQueue OUTPUT OPtempQname AS CHAR
Type Name Parameters\Returns
Procedure createTemporaryTopic OUTPUT OPtempTname AS CHAR
createTemporaryQueue & createTemporaryTopic
© 2006 Progress Software Corporation71SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Temporary Destinations
Delete when no longer needed Release resources
• Delete message consumer object • Then delete temporary queue or topic
Queue
Topic
Type Name Parameters\Returns
Procedure deleteTemporaryQueue INPUT IPtempQname AS CHAR
Type Name Parameters\Returns
Procedure deleteTemporaryTopic INPUT IPtempTname AS CHAR
deleteTemporaryQueue & deleteTemporaryTopic
© 2006 Progress Software Corporation72SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Example - Temporary Queues and Topics
RUN createTemporaryQueue IN hSession
(OUTPUT cTempQueue).
RUN createTemporaryTopic IN hSession
(OUTPUT cTempTopic).
MESSAGE "The temporary Queue is called " SKIP
cTempQueue SKIP
"The temporary Topic is called " SKIP
cTempTopic VIEW-AS ALERT-BOX.
RUN sendToQueue IN hSession
(cTempQueue, hMsg, ?, ?, ?).
RUN publish IN hSession
(cTempTopic, hMsg, ?, ?, ?).
RUN deleteTemporaryQueue IN hSession
(OUTPUT cTempQueue).
RUN deleteTemporaryTopic IN hSession
(OUTPUT cTempTopic).
© 2006 Progress Software Corporation73SOA-2: OpenEdge 10.1A Adapters for SonicMQ
New and Enhanced APIs – By Concepts
Client Message Persistence Fault Tolerant Client Connections Serialized Connection Objects Enhanced XML support Temp Table messages DataSet messages Temporary Destinations Server Based Message Selectors
© 2006 Progress Software Corporation74SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Server Based Message Selectors
Messages filtered on defined criteria
Prior to 10.1A • Point-to-Point
– Message filter on SonicMQ Broker
• Publish/Subscribe– Message filter on SonicMQ Client
New in 10.1A • Ability to move message filter to SonicMQ Broker
New APIs - Available with all connection modes
© 2006 Progress Software Corporation75SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Server Based Message Selectors
Return current message filter setting
• Default False Using server based message selection
RUN setSelectorAtBroker IN HSession (TRUE).
Type Name Parameters\Returns
Procedure setSelectorAtBroker INPUT enable AS LOGICAL
Function getSelectorAtBroker RETURNS LOGICAL
New APIs - Available with all connection modes
© 2006 Progress Software Corporation76SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Agenda
New Install Now Supporting JMS 1.1 New Architecture New APIs Error Handling
OpenEdge 10.1A Adapters for SonicMQ
© 2006 Progress Software Corporation77SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Error Handling
Types of Errors• Deployment/Administration errors
• Runtime errors– Client errors – before request is made– Client errors – making request– Server errors – while processing request
Available Debugging Tools• SOAP Message Viewers (SOAP Faults)
• Log Files / Logging Levels
© 2006 Progress Software Corporation78SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Where to Look for Errors
SOAP Fault response message• Client can catch the exception and look at it
programmatically• Use SOAP Message Viewer
Log Files• JSE log file• WSA log file: *.wsa.log• AdminServer log file: admserv.log• AppServer log file: *.server.log, *.ns.log• SonicMQ ClientConnect log file: cc.broker*.log,
cc.server*.log• SonicMQ ServerConnect log file: sc.broker*.log,
sc.server*.log
© 2006 Progress Software Corporation79SOA-2: OpenEdge 10.1A Adapters for SonicMQ
In Summary
Adapters for SonicMQ are a component in every OpenEdge install that you can use today
All connections support JMS 1.1 New connections support new APIs
CONSUMER subscribe, receive
JMS 1.1 Messages Destination
PRODUCER publish, send
Broker
MQ Client
APIs
ClientConnect
ServerConnect
© 2006 Progress Software Corporation80SOA-2: OpenEdge 10.1A Adapters for SonicMQ
For More Information, go to…
Codes samples available at • http://psdn.progress.com
• Keyword – Exchange
PSDN
© 2006 Progress Software Corporation81SOA-2: OpenEdge 10.1A Adapters for SonicMQ
For More Information, go to…
Introductory• SOA3: Getting the message, so you need to
integrate, but what do you need to know and do?
Architecture• ARCH-7: Integrate this! SonicMQ and the
OpenEdge Reference Architecture
New in Sonic 7.0 • SOA4: Introducing Sonic SOA Suite v7.0
Relevant SonicMQ Sessions
© 2006 Progress Software Corporation82SOA-2: OpenEdge 10.1A Adapters for SonicMQ
For More Information, go to…
XML• DEV-11: Leveraging ProDataSets in an Open
Environment
• DEV 15: XML in OpenEdge − Past, Present and Future
• INNOV-10: An Introduction to XQuery by Example
Relevant XML Exchange Sessions
© 2006 Progress Software Corporation83SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Updated OpenEdge Documentation
Getting Started• Application & Integration Services• Installation & Configuration Guides• Core Services
Development• Programming for the OpenEdge Adapter for
SonicMQ with the 4GL-JMS API
Application Server• Administration
© 2006 Progress Software Corporation84SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Hands On Training
http://www.progress.com/services/education/index.ssp
© 2006 Progress Software Corporation85SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Questions?
© 2006 Progress Software Corporation86SOA-2: OpenEdge 10.1A Adapters for SonicMQ
Thank you foryour time
© 2006 Progress Software Corporation87SOA-2: OpenEdge 10.1A Adapters for SonicMQ