Skip to main content
Version: 7.6.x

Event Messages

Event messages notify syndication consumers that new projections are available. The event message contains information for the syndication consumer to determine the changes in the projection. For more information about projections, see the Syndication Projection section. There are two types of event messages:

  • Domain event: An event generated when a catalog domain object is updated
  • Category event: A message with the built projection’s Global Unique Identifier (GUID)

For more information about adding event message types, see the Adding New Event Type section.

Domain Event Messages​

Domain event messages are the messages that Self-Managed Commerce Manager sends to integration server using Java Messaging Service (JMS) about the catalog updates, which are the domain event messages. You can create, update, or delete any of the following to trigger an event:

  • SKUs
  • Brands
  • Attributes
  • Products
  • Categories
  • Field metadata
  • Price

The domain event message contains the following information:

  • class: The type of message, such as DomainEventType
  • name: The event type, such as SKU_OPTION_CREATED
  • guid: The code for the entity, such as product code

The projection builder receives the event message in the following format:

{
"eventType":{
"@class":"DomainEventType",
"name":"<EVENT_TYPE>"
},
"guid":"<ENTITY_CODE>",
"data":{}
}

When you update data, Self-Managed Commerce Manager sends a VirtualTopic.ep.domain message to JMS. The following events trigger the projection builder to run an appropriate action:

  • Create, update, or delete the following entities:
    • SKU_OPTION
    • BRAND
    • CART_ITEM_MODIFIER_GROUP
    • ATTRIBUTE
    • PRODUCT
    • CATEGORY
    • Create or delete links in a CATEGORY
    • BASE-AMOUNT
    • Update or delete a PRICE_LIST_ASSIGNMENT

Catalog Event Messages​

A catalog event message contains the following information:

  • class: The type of message, such as CatalogEventType
  • name: The event type, such as OPTIONS_UPDATED
  • guid: The aggregate of all updated codes to sent in one list
  • modifiedDateTime: The time stamp of the projection build
  • store: The code to identify the store
  • type: The projection type, such as option or brand

When the projection builder completes building the updates, Self-Managed Commerce Manager sends a message to the VitrutalTopic.ep.catalog topic to notify the Content Management System (CMS).

The following projection event types initiate a VirtualTopic.ep.catalog message:

  • OPTIONS_UPDATED
  • BRANDS_UPDATED
  • FIELD_METADATA_UPDATED
  • ATTRIBUTES_UPDATED
  • OFFERS_UPDATED
  • CATEGORIES_UPDATED
  • PRICE_UPDATED

For CMS to consume projections, a catalog event message is sent to notify updates. The message is sent to the catalog events channel. The following is an example of a catalog event message:

{
"eventType": {
"@class": "CatalogEventType",
"name": "OPTIONS_UPDATED"
},
"guid": "AGGREGATE",
"data": {
"type": "option",
"store": "MyStore",
"modifiedDateTime": "2018-01-01T14:47:00+00:00",
"codes": [
"COLOUR",
"SHAPE"
]
}
}

note

The GUID is listed as AGGREGATE, so the integration server sends events, consisting of all updates, in a single catalog event message.

The CMS consumes a catalog event message and uses the Syndication API to fetch projections.