Can't Construct Symphony Client in 1.1.0-SNAPSHOT.
robmoffat opened this issue · comments
I want to construct the SymphonyClient and pass in the keystore etc. from my Spring environment (in an inversion-of-control way).
However, there seems to be no way of constructing the SymphonyClient without it instantiating a SymphonyClientConfig object, which then throws the following exception:
Caused by: org.symphonyoss.client.exceptions.ProgramFault: The following required properties are undefined:
sessionauth.url,
keyauth.url,
pod.url,
agent.url,
truststore.file (or javax.net.ssl.trustStore),
truststore.password (or javax.net.ssl.trustStorePassword),
user.cert.file (or javax.net.ssl.keyStore),
user.cert.password (or javax.net.ssl.keyStorePassword),
user.email
at org.symphonyoss.client.SymphonyClientConfig.<init>(SymphonyClientConfig.java:73)
at org.symphonyoss.client.impl.SymphonyBasicClient.<init>(SymphonyBasicClient.java:92)
at org.symphonyoss.client.impl.SymphonyBasicClient.<init>(SymphonyBasicClient.java:85)
at com.hsbc.gbm.symphony.symphonyclient.HSBCSymphonyClientFactoryImpl.createClient(HSBCSymphonyClientFactoryImpl.java:60)
Here is the construction code I used to have:
Client httpClient = createHttpClient(clientKeyStore, keystorePass);
SymAuth symAuth = createSymAuth(httpClient);
SymphonyClient symClient = new SymphonyBasicClient();
symClient.init(httpClient, symAuth, email, agentUrl, podUrl);
However, there's no way for me to get to that init() method without the SymphonyClientConfig kicking in and throwing an exception: whatever route I go down, it's going to check for system properties and such.
Seems weird that it doesn't support IoC anymore - is this a bug?
thanks,
Rob
- SymphonyClientConfig default constructor no longer loads parameters.
- Users have the ability to manually set() configuration parameters or load() automatically.
- New constructor (SymphnonyClientConfig(boolean load) was added to automatically load on instantiation.
- SymphonyClient / SymphonyBasicClient was updated so that SymphonyClientConfig is not mandatory.
- New init method was added to support disabling real-time services.
commit dcee15f (fixed the failed test)
Please verify and close.
Looks fixed now, cheers Frank!