Step 2: Start the Managed Subscription

Start a managed subscription by using the ManagedSubscribe.java class, which calls the ManagedSubscribe RPC method (beta).

  1. Set up the Pub/Sub API Java client by following the steps in Step 2: Build the Client in the main Java quick start.
  2. Configure the client parameters, such as your Salesforce org login URL and credentials, and the topic of /event/Order_Event__e in arguments.yaml by following the steps in Step 3: Configure Client Parameters in the main Java quick start.
  3. In arguments.yaml, specify the managed subscription developer name or ID. In this case, you use the developer name MANAGED_SUB_DEVELOPER_NAME=My_Managed_Subscription.
  4. To run the ManagedSubscribe RPC example, enter ./run.sh genericpubsub.ManagedSubscribe.

Because no events are published yet, the client doesn’t receive any events yet. In the next step, you publish some events.