Creating publications

By creating a publication, you define how data is published as XML or delimited messages from a source table to IBM® MQ so that a subscribing application can retrieve and use those messages.

Before you begin

  • Plan how you want to group publishing queue maps and publications.
  • On the server that contains the source table for the publication, create the control tables for the Q Capture program.
  • Create a publishing queue map. (You can do this task before you create a publication or while you create a publication.)

Restrictions

  • A view cannot be a source for a publication.

About this task

Figure 1 shows how a single publication connects a source table to an MQ send queue.

Figure 1. Single publication. Changes from a source table are published over MQ queues.
This graphic shows a publication

Figure 2 shows how multiple publications can use the same publishing queue map and Q Capture program.

Figure 2. Multiple publications. Changes from source tables are published over MQ queues.
This graphic shows mulitple publications

Procedure

To create publications, use one of the following methods:
Method Description
ASNCLP command-line program Use the CREATE PUB command. For example, the following commands set the environment and create the publication DEPARTMENT0001:
ASNCLP SESSION SET TO Q REPLICATION;
SET SERVER CAPTURE TO DB SAMPLE;
SET CAPTURE SCHEMA SOURCE EP1;
SET RUN SCRIPT LATER;

CREATE PUB USING PUBQMAP
SAMPLE_EP1_TO_SUBSCRIBER
(PUBNAME "DEPARTMENT0001" JK.DEPARTMENT
ALL CHANGED ROWS Y SUPPRESS DELETES Y);
Replication Center Use the Create Publications wizard. To open the wizard, expand the Q Capture schema that identifies the Q Capture program that you want to capture changes for the publication. Right-click the Publications folder and select Create.

You can create one publication or many by using the wizard.

When you create multiple publications at one time, the Replication Center assumes that you want to publish all columns and rows from each source table. At the end of the wizard, before the Replication Center builds the publications, you can modify individual publications so that only a subset of the source columns and rows are published.