Download presentation
Presentation is loading. Please wait.
Published byAugust Blair Modified over 9 years ago
1
IBM Software Group / Information Management 09/07/2005 © 2005 IBM Corporation IDS and Websphere MQ Integration Jerry Keesee, Director of the Informix lab Keshava Murthy, IDS Architect
2
IBM Software Group / Information Management © 2004 IBM Corporation 2 09/07/2005 Agenda Websphere MQ IDS Support for MQ MQ Functions 2-phase commit support Platforms Q & A Websphere MQ IDS Support for MQ MQ Functions 2-phase commit support Platforms Q & A
3
IBM Software Group / Information Management © 2004 IBM Corporation 3 09/07/2005 Webspher MQ
4
IBM Software Group / Information Management © 2004 IBM Corporation 4 09/07/2005 Websphere MQ Scenario Websphere MQ Q1… Q2… Informix Dynamic Server Application Transaction Manager
5
IBM Software Group / Information Management © 2004 IBM Corporation 5 09/07/2005 IDS and MQ Overview Use SQL callable Routines exchange data with MQ INSERT into tasktab values(MQREAD(“Myservice”)); SELECT MQSEND(“UService”, order || “:“ || address) FROM tab where cno = 12345; Functionality available when you install IDS. IDS and MQ interaction is transactionally protected This Feature uses IDS transaction manager to support XACompliant Resource Managers. This feature is available starting in10.00.UC3
6
IBM Software Group / Information Management © 2004 IBM Corporation 6 09/07/2005 Websphere MQ Scenario Websphere MQ Q1… Q2… Application MQ Functions Informix Dynamic Server Application
7
IBM Software Group / Information Management © 2004 IBM Corporation 7 09/07/2005 MQ Series Scenario Websphere MQ Q1… Q2… Informix Dynamic Server MQ-DB2 database module Z/OS DB2 on Z/OS Direct interaction using MQ Functions App-1 App-2 MQ Functions App-3 Transaction Manager App-4
8
IBM Software Group / Information Management © 2004 IBM Corporation 8 09/07/2005 IDS database server IDS client Orders_queue Inventory_queue backorder_queue IDS XA Transaction manager Infrastructure MQ Queue MQ Queue Manager MQ Message Broker MQ Functions Acme_queue_manager MQIMQI MQSeries UDR and XA support UDRs [xa_open, xa_commit, xa_rollback, etc] Websphere MQ IDS MQ Integration
9
IBM Software Group / Information Management © 2004 IBM Corporation 9 09/07/2005 Direct IDS to Websphere MQ interaction SEND, RECEIVE, READ, PUBLISH, SUBSCRIBE Operations Supports character and clob types. Data from other data types have to be converted to these types. Access MQSeries Queue as a table READ and RECEIVE tables READ – non destructive browsing INSERT into these MQ tables will send the row to the QUEUE READ/RECEIVE from the table will retrieve msgs from the QUEUE Direct IDS to Websphere MQ interaction SEND, RECEIVE, READ, PUBLISH, SUBSCRIBE Operations Supports character and clob types. Data from other data types have to be converted to these types. Access MQSeries Queue as a table READ and RECEIVE tables READ – non destructive browsing INSERT into these MQ tables will send the row to the QUEUE READ/RECEIVE from the table will retrieve msgs from the QUEUE IDS MQ Functions
10
IBM Software Group / Information Management © 2004 IBM Corporation 10 09/07/2005 Usage begin work; -- read message with corrid execute function mqread('IDS.SAMPLE.SERVICE', 'IDS.SAMPLE.POLICY', 'QA_MQ_ID_1'); -- receive message with corrid execute function mqreceive('IDS.SAMPLE.SERVICE', 'IDS.SAMPLE.POLICY', 'QA_MQ_ID_1'); commit work; begin work; -- receives 10 orders from the ORDER queue INSERT INTO ordertab SELECT FIRST 10 MQRECEIVE(‘MY.ORDER’) from systables; rollback work; -- insert rows begin work; SELECT MQSEND(‘NEW.ORDER’, order || ‘:’ || address FROM tab WHERE cno = 12345; Commit work; MQ Service MQ Policy Correlation ID Transactional Boundary ROLLBACK
11
IBM Software Group / Information Management © 2004 IBM Corporation 11 09/07/2005 Creates a local table that’s mapped to a websphere MQ Queue Provides a way to browse messages in the queue without deleting the messages in the Queue. begin work; execute function MQCreateVTIREAD(“myreadtable“, “service”, “policy”, 4096); commit work; Select first 10 * from myreadtable; Insert into myreadtable values(“IBM:81.98;Volume:1020”); MQCreateVtiRead Table Name Max message size
12
IBM Software Group / Information Management © 2004 IBM Corporation 12 09/07/2005 Creates a local table that’s mapped to a websphere MQ Queue Provides a way get messages from the Queue. Messages are deleting from the queue once you read it (and the transaction is committed. begin work; execute function MQCreateVTIReceive(“myreceivetab“, “service”, “policy”, 4096); commit work; -- insert rows begin work; insert into mqvtitable(msg) values ("IBM:81.23;Volume:10100"); Commit work; MQCreateVtiReceive
13
IBM Software Group / Information Management © 2004 IBM Corporation 13 09/07/2005 MQCreateVtiReceive create table myreceivetab ( msg lvarchar(maxMessage), correlid varchar(24), topic varchar(40), qname varchar(48), msgid varchar(12), msgformat varchar(8)); using "informix".mq (SERVICE = service_name, POLICY = policy_name, ACCESS = "RECEIVE");
14
IBM Software Group / Information Management © 2004 IBM Corporation 14 09/07/2005 MQ Functions –The following are the list of the MQ Functions. MQRead() MQReceive() MQSend() MQPublish() MQSubscribe() MQUnSubscribe() MQReadClob() MQReceiveClob() MQSendClob() MQTRACE() MQVERSION() MQCREATEVTIREAD() MQCREATEVTIRECEIVE() –Except MQTRACE(), MQVERSION(), MQCREATEVTIREAD() and MQCREATEVTIRECEIVE() all other functions needs be invoked with in the transaction ( explicit or implicit)
15
IBM Software Group / Information Management © 2004 IBM Corporation 15 09/07/2005 MQ Parameters: MQREAD service_name – should be a service in “informix”.mqiservice table (256 bytes max) Default: IDS.DEFAULT.SERVICE policy_name – should be a policy in “informix”.mqipolicy table (48 bytes max) Default: IDS.DEFAULT.POLICY correl_id -- correlation identifier for the message to be read/received/sent. (24 bytes max)
16
IBM Software Group / Information Management © 2004 IBM Corporation 16 09/07/2005 IDS database server IDS client Orders_queue Inventory_queue backorder_queue IDS XA Transaction manager Infrastructure MQ Queue MQ Queue Manager MQ Message Broker MQ Data Blade Acme_queue_manager MQIMQI MQSeries UDR and XA support UDRs [xa_open, xa_commit, xa_rollback, etc] Websphere MQ MQ Integration
17
IBM Software Group / Information Management © 2004 IBM Corporation 17 09/07/2005 Description(Cont.) –MQ Functions is part of IDS distribution –Installed under $INFORMIXDIR/extend directory –Install using blade manager. –Configure an MQ VP –VPCLASS mq,noyield,num=1 # in your $ONCONFIG file. –In 10.00.xC3, MQ Functions are supported on the following platforms. Solaris 32bit HPUX 32bit AIX 32bit Windows 32bit –Please provide feedback on Platform Requirement. –Using MQ Functions require WebSphere MQ Server installation on the same machine where IDS running.
18
IBM Software Group / Information Management © 2004 IBM Corporation 18 09/07/2005 Description(Cont.) –MQ QueueManager and MQ Queues needs to be configured. –following tables will be created during blade registration “informix”.mqiservice “informix”.mqipolicy “informix”.mqipubsub –User needs to insert appropriate values for into this tables to use the SERVICE, POLICY parameters of the MQ functions.
19
IBM Software Group / Information Management © 2004 IBM Corporation 19 09/07/2005 CREATE TABLE "informix".mqiservice (servicename LVARCHAR(256), queuemanager VARCHAR(48) NOT NULL, queuename VARCHAR(48) NOT NULL, defaultformat VARCHAR(8) default ’ ’, ccsid VARCHAR(6) default ’ ’, PRIMARY KEY (servicename) ); servicename is the service name used in the MQ functions. queuemanager is the queue manager service provider. queuename is the queue name to send the message to or receive the message from. defaultformat defines the default format. ccsid is the coded character set identifier of the destination application. IDS MQ Tables
20
IBM Software Group / Information Management © 2004 IBM Corporation 20 09/07/2005 "informix".mqiservice Has long list of message attributes [like retry count, expiry date, etc] Default Policy is “IDS.DEFAULT.POLICY” Use this or create custom policy based on this. Read Websphere MQ Manuals to understand the Meaning of each of these fields in the messages. "informix".pubsub Used to specify service names, end points for publish and subscribe functions. IDS MQ tables
21
IBM Software Group / Information Management © 2004 IBM Corporation 21 09/07/2005 IDS MQ Tables CREATE TABLE "informix".mqipubsub (pubsubname LVARCHAR(256) NOT NULL UNIQUE, servicebroker LVARCHAR(256), receiver LVARCHAR(256) default ’ ’, psstream LVARCHAR(256) default ’ ’, pubsubtype VARCHAR(20) CHECK (pubsubtype IN (’Publisher’, ’Subscriber’)), FOREIGN KEY (servicebroker) REFERENCES "informix".mqiservice(servicename)); pubsubname is the name of the publish/subscribe service. servicebroker is the service name of the publish/subscribe service. receiver is the queue on which to receive messages after subscription. psstream is the stream coordinating the publish/subscribe service. pubsubtype is the service type.
22
IBM Software Group / Information Management © 2004 IBM Corporation 22 09/07/2005 2-phase commit with IDS and the MQ Functions Standard commit, rollback operations can be done on MQ operations. IDS manages the transaction and implement 2-phase commit protocol. MQ participates in the IDS transaction whenever MQ UDR is invoked. MQ will be a resource manager. IDS can manage distributed queries and MQ in the same transaction.
23
IBM Software Group / Information Management © 2004 IBM Corporation 23 09/07/2005 http://www.ibm.com/software/data/informix http://publib.boulder.ibm.com/infocenter/ids9help
24
IBM Software Group / Information Management © 2004 IBM Corporation 24 09/07/2005 http://www.ibm.com/software/data/informix
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.