Batch Syndication Jobs
Developers can initiate batch syndication jobs by sending a batch event message to the ep.batch.catalogsyndication
queue using Java Messaging Service (JMS).
Create Batch Syndication JMS Message
When the catalog syndication batch job in the Batch Server receives an event message from the ep.batch.catalogsyndication
queue, the catalog projection builder starts the corresponding batch jobs. For Batch Server to initiate the batch jobs, developers must create a message and send it to the ep.batch.catalogsyndication
queue in JMS in the following format:
{
"eventType": {
"@class": "CatalogBatchEventType",
"name": "START_JOB"
},
"guid": "BUILD_ALL_PROJECTIONS",
"data": {
"cleanUpDatabase":"true"
}
}
note
Ensure that the cleanUpDatabase
flag is set to true
to clean the entire database before building the batch projection. If the flag is set to false
, only projections for entities that have changed are cleaned. Cleaning up the database ensures that data from the previous build projection is removed.
Build Projection
The catalog projection builder builds each projection in the following sequence:
note
The batch server uses SQL scripts to create infrastructure database tables. Ensure that your profile contains the following configuration property to use batch server on an Oracle database:
<ep.catalog.batch.script.separator>/</ep.catalog.batch.script.separator>
- Runs the
cleanUpDatabase
job. This step is optional - Fetches all entities of the corresponding job type, such as brand, SKU option, or product
- Builds multiple projections from the single domain entity
- Writes the projections to the database
The catalog projection builder can build all entity projections together or as separate entities. If the BUILD_ALL_PROJECTIONS
message is received, the entities are built in the following order:
BUILD_ALL_OPTIONS
BUILD_ALL_ATTRIBUTES
BUILD_ALL_BRANDS
BUILD_ALL_FIELDMETADATA
BUILD_ALL_CATEGORIES
BUILD_ALL_OFFERS
Expired Projections
You can set a disable date and time on products, SKUs and categories in the catalog. These values are syndicated to the TCATALOGPROJECTIONS
database table. When you run a batch job, the job checks the TCATALOGPROJECTIONS
table. It deletes the product from the catalog if the DISABLE_DATE_TIME
is set to the current date and time or is in the past. The job schedules its next run to be on the closest DISABLE_DATE_TIME
or within an hour, whichever comes first.