# 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](/docs/platform/pub-sub-api/guide/qs-java-build-client.md) in the main Java quick start.
2. Configure the required client parameters, such as your Salesforce org login URL and credentials, in `arguments.yaml` by following the steps in [Step 3: Configure Client Parameters](/docs/platform/pub-sub-api/guide/qs-java-parameters.md) in the main Java quick start.
3. In `arguments.yaml`, specify the managed subscription ID. In this case, you use the ID  `MANAGED_SUB_ID=18xKj000000000BIAQ`.
4. To run the `ManagedSubscribe` RPC example, enter `./run.sh genericpubsub.ManagedSubscribe`.

:::important
When you create a ManagedEventSubscription record, there can be a delay before the new configuration takes effect in Pub/Sub API. If the subscription returns an error saying that the managed subscription configuration isn’t found, wait several minutes and then restart it.
:::

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