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 Elastic Path batch server gets an event message from the ep.batch.catalogsyndication
queue, the batch projection builder starts the corresponding batch jobs. For Elastic Path 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"
}
}
Use specific batch jobs, such as BUILD_ALL_OFFERS
, to fix data, such as corrupt data. When creating initial data, you must use the BUILD_ALL_PROJECTIONS
projection builder to build all of the projections first. If you use another job, such as BUILD_ALL_OFFERS
, the job looks only for data related to offers. If there is no data available, the projection still builds. Without any data, the projection is built with the deleted
flag set to true
.
note
Ensure that the cleanUpDatabase
flag is set to true
to clean projections from the TCATALOGPROJECTIONS
database table 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 batch projection builder builds each projection in the following sequence:
- 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 batch projection builder can build all entity projections together or as separate entities. The entities are built in the following order if built all together:
BUILD_ALL_OPTIONS
BUILD_ALL_ATTRIBUTES
BUILD_ALL_BRANDS
BUILD_ALL_FIELDMETADATA
BUILD_ALL_OFFERS
BUILD_ALL_PROJECTIONS
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.