MB + MQ development technology instance

Source: Internet
Author: User

Http://blog.sina.com.cn/s/blog_4c94720d010091t5.html

Http://blog.sina.com.cn/s/blog_4c94720d010091qt.html ~ Type = v5_one & label = rela_prevarticle

Http://blog.sina.com.cn/s/blog_4c94720d010092ic.html ~ Type = v5_one & label = rela_nextarticle

MB + MQ Development Technology example (1) define message set (00:29:43) label: It classification: MB + MQ Development Technology

1. Create a message set project, enter messageset, and messageitemset ]. Click Next.

2. Select the message data type to be processed as XML document ]. Click Finish.

3. Open the messageset. mset file and select xml1 as the default line format ].

4. Right-click the message definition to create a new message definition file.

5. Enter the message definition file messagename ]. Click Finish.

6. Open the messagename. mxsd file, create a complex type named xmltype, and create two local elements named ID and name under xmltype ].

7. Add the message "root" and select "xmltype" as the type ]. The final file is as follows:

This completes and can be referenced when a message flow project is created.
MB + MQ development technology instance (2) esql mode of MQ operation database (10:15:43) label: mbmq Development Instance category: MB + MQ Development Technology

1. Create a message flow project, enter the project name dbinsert, and click Next.

2. Select the messageitemset project in project dependency. Click Finish.

3. Right-click the stream to create a new message stream file.

4. Enter the message stream name dbinsertflow ].

5. Open the dbinsertflow .. msgflow file and create the following nodes in the workspace.

Type
Node name
Queue name

Mqinput
Data input node
DB. Input

Mqoutput
Failed Node 1
Failure1

Mqoutput
Failed Node 2
Failure2

Database
Database
/

6. Open the data input node attribute page and set the message domain: MRM, message set: messageset, Message Type: root, and Message format xml1.

7. Open the database property page and enter the data source Lori ].

8. Press the [database] node to open the esql editing page. Enter esql code:

Create database module dbinsertflow _ Database

Create Function main () returns Boolean

Begin

Declare db_source character 'lil'; -- Data Source Name

Declare db_schema character 'admin'; -- database Login Name

Declare db_table character 'test'; -- table name

Insert into database. {db_source}. {db_schema}. {db_table}

(ID, name)

Values

(Cast (root. MRM. ID as character), cast (root. MRM. Name as character ));

-- Root. MRM is the reference method. ID is the ID corresponding to XML

-- Root. MRM: reference method. Name: name corresponding to XML

End;

End module;

9. After development, start deployment. Switch to the proxy management perspective. Right-click server to create an archive file.

10. Enter the archive file name dbinsert ].

11. Add dbinsert and messageitemset to be deployed. Click Finish to archive the resources.

12. Right-click dbinsert and select deployment file. In the displayed form, select [Default] and click Finish.

The deployment is complete. Start the test.

13. Create three new queues in MQ Resource Manager: DB. Input and failure1 and failure2 ]. Right-click "DB. Input" and choose "put Test message" from the shortcut menu ].

14. Put the message data: 1test1.

15. Open DB2 and the test table in the [Lori] tablespace. We can see that our test data has been successfully saved to the database.

At this point, the instance is complete.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.