Broker 10.5 | webMethods Broker Documentation | webMethods Broker Client Java API Programmer's Guide | Subscribing to and Receiving Events | Receiving Events in the Get-Events Model | Subscription Identifiers | Generating Subscription Identifiers
 
Generating Subscription Identifiers
You application can generate subscription identifiers itself or it can call one of the following webMethods Broker API methods to generate a subscription identifier.
The BrokerClient.makeSubId method creates a subscription identifier for a specified client. The first time it is called for a particular BrokerClient, it will return a value of 1. The second time it is called for the same BrokerClient, it will return a value of 2, and so on. The subscription identifiers are not guaranteed to be unique if your application disconnects and reconnects the BrokerClient, as described in Disconnecting and Reconnecting.
You can use the BrokerClient.makeSubId method to create unique subscription identifiers for Broker clients that you intend to disconnect and reconnect. This method contacts the Broker and looks up all the existing subscription identifiers in use by your application. It then assigns a subscription identifier that is guaranteed to be unique for all Broker clients that you might use. Another important feature is that after calling this method once, all subsequent calls to BrokerClient.makeSubId will return unique subscription identifiers.