---
schema_version: "1"
id: e7bb45b70833fff355e5197188b50c69690490294490a548e7e6f546b0bb80f8
title: Java Quick Start for Publishing and Subscribing to Events
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/event-bus/pub-sub-api/guides/qs-java-quick-start.md
canonical_url: https://developer.salesforce.com/docs/platform/pub-sub-api/guide/qs-java-quick-start.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: fcf7e7016d89eb40513155ca80e355a1389c6608c9a4de5272427c9f7bb7a090
products:
  - Pub/Sub API
  - Event Bus Docs
---
# Java Quick Start for Publishing and Subscribing to Events

In this quick start, you learn how to build a Pub/Sub API client in Java. The steps walk you through building the package, configuring the client, and running the client to publish and subscribe to events.

**note:** The quick start provides enough instructions and code snippets to build your own client. The examples are for learning purposes only. They aren’t intended for production use and haven’t undergone thorough functional and performance testing. Use them as a starting point.

**In this section:**

- [Step 1: Define a Platform Event](https://developer.salesforce.com/docs/platform/pub-sub-api/guide/qs-java-prereqs.md)
- [Step 2: Clone and Build the Client](https://developer.salesforce.com/docs/platform/pub-sub-api/guide/qs-java-build-client.md)
- [Step 3: Configure Client Parameters](https://developer.salesforce.com/docs/platform/pub-sub-api/guide/qs-java-parameters.md)
- [Step 4: Publish and Subscribe to Platform Events](https://developer.salesforce.com/docs/platform/pub-sub-api/guide/qs-java-publish-subscribe.md)
- [Step 5: Subscribe to Change Events](https://developer.salesforce.com/docs/platform/pub-sub-api/guide/qs-java-change-events.md)
