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_OFFERS",
"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 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.