000014769 - AXM - How to initialize 2 dispatchers using the runtime api (sample code)

Document created by RSA Customer Support Employee on Jun 14, 2016Last modified by RSA Customer Support Employee on Apr 21, 2017
Version 2Show Document
  • View in full screen mode

Article Content

Article Number000014769
Applies ToAXM 6.0 sdk runtime api
IssueAXM - How to initialize 2 dispatchers using the runtime api for failover
Resolution

Information can be found the sdk documentation.  Once you unzip the sdk, the relative path to the information would be found in  http://<pathToSdk>/documentation/ct/api/6.0/runtime/doc/sirrus/connect/ConnectionDescriptor.html                                                                                                                                                                                                             

In order to do so, the following is a summary of what you will need to do:

1) You'll CreateFromServerDispatchers as an array
2) Fill array with the 2 slots for connection descriptors, one for each dispatcher
3) Create the runtime api according to createFromServerDispatchers
4) And insure it matches constructor summary for connection.

See the Constructor Summary section of the sdk documentation for the runtime api, which states:


ConnectionDescriptor()
          Creates a descriptor for a server, but does not initialize the descriptor.
ConnectionDescriptor(String hostNameOrIP, int port)
          Creates a descriptor for a server at the given address and port, with Anonymous SSL turned on.
ConnectionDescriptor(String hostNameOrIP, int port, int sslMode)
          Creates a descriptor for a server at the given address and port using SSL equal CLEAR or SSL_ANON.
ConnectionDescriptor(String hostNameOrIP, int port, int sslMode, int timeout)
          Creates a descriptor for a server at the given address and port using SSL equal CLEAR or SSL_ANON.
ConnectionDescriptor(String host, int port, int ssl, KeyStore caKs, KeyStore ks, String keyAlias, String privatePass)
          For advanced uses only.
ConnectionDescriptor(String host, int port, int ssl, KeyStore caKs, KeyStore ks, String keyAlias, String privatePass, int timeout)
          For advanced uses only.
ConnectionDescriptor(String host, int port, int ssl, String caFile, String caPassword, String ksFile, String ksPassword, String keyAlias, String privatePass, int timeout)
          Creates a descriptor, taking keystore file locations and credentials as arguments.

Here is a sample example for 2 dispatchers, adjust accordingly to your environment

  String dispatchServer1= "10.148.129.224";
  String dispatchServer2 = "10.148.129.225";
  int dispatchServerPort = 5608;
  RuntimeAPI rt = null;

ConnectionDescriptor[] dispatchers = new ConnectionDescriptor[2];

dispatchers[0] = new ConnectionDescriptor(dispatchServer1, dispatchServerPort,
                                          ServerDescriptor.SSL_ANON);

dispatchers[1] = new ServerDescriptor(dispatchServer2, dispatchServerPort,
       ServerDescriptor.SSL_ANON);
 
Try
{
 rt = createFromServerDispatchers(dispatchers,
                                                     60000,
                                                     true,
                                                     null);

}
catch(RuntimeAPIException rex)
{
 System.out.println(rex);
}

Legacy Article IDa42770

Attachments

    Outcomes