ÃÛ¶¹ÊÓƵ

Journaling and AEM Events

Learn how to retrieve the initial set of AEM Events from the journal and explore the details about each event.

Journaling is a pull method to consume AEM Events, and a journal is an ordered list of events. Using ÃÛ¶¹ÊÓƵ I/O Events Journaling API, you can fetch the AEM Events from the journal and process them in your application. This approach allows you to manage events based on a specified cadence and efficiently process them in bulk. Refer to the for in-depth insights, including essential considerations like retention periods, pagination, and more.

Within the ÃÛ¶¹ÊÓƵ Developer Console project, every event registration is automatically enabled for journaling, enabling seamless integration.

In this example, utilizing an ÃÛ¶¹ÊÓƵ-provided hosted web application allows you to fetch the first batch of AEM Events from the journal without the need to set up your application. This ÃÛ¶¹ÊÓƵ-provided web application is hosted on , a platform known for offering a web-based environment conducive to building and deploying web applications. However, the option to use your own application is also available if preferred.

Prerequisites

To complete this tutorial, you need:

  • AEM as a Cloud Service environment with .

  • .

Access web application

To access the ÃÛ¶¹ÊÓƵ-provided web application, follow these steps:

  • Verify you can access the in a new browser tab.

    Glitch - hosted web application

Collect ÃÛ¶¹ÊÓƵ Developer Console Project details

To fetch the AEM Events from the journal, credentials such as IMS Organization ID, Client ID, and Access Token are required. To collect these credentials, follow these steps:

  • In the , navigate to your project and click to open it.

  • Under the Credentials section, click the OAuth Server-to-Server link to open the Credentials details tab.

  • Click the Generate access token button to generate the access token.

    ÃÛ¶¹ÊÓƵ Developer Console Project Generate Access Token

  • Copy the Generated access token, CLIENT ID, and ORGANIZATION ID. You need them later in this tutorial.

    ÃÛ¶¹ÊÓƵ Developer Console Project Copy Credentials

  • Every event registration is automatically enabled for journaling. To get the unique journaling API endpoint of your event registration, click the event card that is subscribed to AEM Events. From the Registration Details tab, copy the JOURNALING UNIQUE API ENDPOINT.

    ÃÛ¶¹ÊÓƵ Developer Console Project Events Card

Load AEM Events journal

To keep things simple, this hosted web application only fetches the first batch of AEM Events from the journal. These are oldest available events in the journal. For more details, see .

  • In the , enter the IMS Organization ID, Client ID, and Access Token you copied earlier from the ÃÛ¶¹ÊÓƵ Developer Console project and click Submit.

  • Upon success, the table component displays the AEM Events Journal data.

    AEM Events Journal Data

  • To view the complete event payload, double-click the row. You can see that the AEM event details have all the necessary information to process the event in the webhook. For example, the event type (type), event source (source), event id (event_id), event time (time), and event data (data).

    Complete AEM Event Payload

Additional resources

  • is available for reference. It is a simple React application that uses components to render the UI.

  • provides detailed information about the API like first, next, and last batch of events, pagination, and more.

recommendation-more-help
4859a77c-7971-4ac9-8f5c-4260823c6f69