The Salesforce Developers website will undergo maintenance on May 29, 2024 from 3:00 a.m. UTC to 10:00 a.m. UTC. The maintenance process may affect the availability of our documentation. Please plan accordingly.

Step 1: Install Prerequisites

  1. Install prerequisites:
  2. The Java example uses a custom platform event, Order Event, that you must define. You can skip this step if you want to use another event that you defined earlier.
    1. From Setup, in the Quick Find box, enter Platform Events, and then select Platform Events.
    2. On the Platform Events page, click New Platform Event.
    3. Complete the standard fields, and for the description, enter Example event for the Pub/Sub API client.
    4. Save your work.
    5. To add a field, in the Custom Fields & Relationships related list, click New.
    6. Follow the custom field wizard to set up these fields.
      1. Field label: Order_Number__c, field type: Text(18)
      2. Field label: City__c, field type: Text(50)
      3. Field label: Amount__c, field type: Number(16,2)