Hard-coding Client Identifiers
In some cases, you have a compelling reason to hard-code a client identifier into your application or to accept the client identifier as a command-line argument:
1. If your Broker client is designed to be disconnected and reconnected over multiple sessions and needs to preserve the client identifier, you might want to hard-code the client identifier.
2. If your application cooperates with other applications that need to know your client identifier, you can choose to hard-code the client identifier into each of the cooperating applications. If the applications are connected to different Brokers in a multi-Broker environment, you must hard-code the fully-qualified client identifier by adding the name of the Broker to which the client is connected to the client identifier, as shown in the table below.
Unqualified and fully qualified client identifiers
Client | Unqualified Client ID | Client's Broker Name | Fully Qualified Client ID |
Joe | 1000 | Denver | //Denver/1000 |
Mary | 1001 | Denver | //Denver/1001 |
Chuck | 1000 | Chicago | //Chicago/1000 |