-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data Engine Proxy Config not using Connections #1732
Comments
Hi @mandy-chessell -- to be sure I fix correctly, is there an example of another service you can point me at that separates these bits out along these lines? 🙏 |
@cmgrote |
No worries on that -- just want to fix it the first time rather than iterate, to make sure we can include it in the 1.1 release 😄 |
I think I got lucky in that my implementation wasn't far off, just that I wasn't putting the properties in the correct object(s)... Just to double-check, the new configuration would look something like this? {
"class": "DataEngineProxyConfig",
"dataEngineProxyConnection": {
"class": "Connection",
"connectorType": {
"class": "ConnectorType",
"connectorProviderClassName": "org.odpi.egeria.connectors.ibm.datastage.dataengineconnector.DataStageConnectorProvider"
},
"endpoint": {
"class": "Endpoint",
"address": "myhost.somewhere.com:9445",
"protocol": "https"
},
"userId": "igcuser",
"clearPassword": "password"
},
"pollIntervalInSeconds": 60
} (The only thing specific to the Data Engine Proxy is the Two follow-up questions, assuming that looks better now:
|
The "class" entry is added by Jackson in the client if you have the Jackson annotations specifying that it should include a class attribute and the real Java class that should be used to deserialize it in the server. The OCF beans are set up to expect the class attribute since this is necessary to correctly deserialize a subclass of the object specified on the interface. They use the simple class name (like "Connection"). This is the annotation that defines the class name of the subtype.
and this is the annotation in Connection to ensure that if you pass a virtual connection as a connection, this subtype is correctly deserialized.
The other queston is how are you initializing the connector. It needs to be through the ConnectorBroker. If the Connection object is set up correctly then the ConnectorBroker will load the right connector provider and request that it creates the connector instance. This way the proxy server is kept independent of the connector implementation. |
I always was initializing the connector via the ConnectorBroker -- just that I wasn't leveraging the properties of the Connection object itself that I really should have (ie. putting the server address, username, password information there rather than in my own custom Map of properties): // ...
Connection dataEngineProxy = dataEngineProxyConfig.getDataEngineProxyConnection();
if (dataEngineProxy != null) {
try {
ConnectorBroker connectorBroker = new ConnectorBroker();
dataEngineProxyConnector = (DataEngineConnectorBase) connectorBroker.getConnector(dataEngineProxy);
// ... |
How do I persist the credential information ( |
What is stripping them out of the connection ? The only part that is hidden is the secured properties. |
🤷♂️ Something between the Connection I send in via admin services config and when that hands over to the Connector::initialize() method (via ConnectorBroker::getConnector())... Will try to dig deeper later tonight / tmw morning... |
The admin services should just store the connection object when the server is configured. - this is easy to check by querying the configuration document. When the server is started, the relevant parts of the configuration document (including the connection object) should be passed to the initialization routine for the data engine proxy services. This initialization routine then passes the connection object to the connector broker on the getConnection method. The admin services do not call the connector broker. |
Hmm, I think it is my config service as it is generating a new Connection object via the I'm a bit confused again whether I need to actually be using the I'm assuming I cannot just pass the Connection object I outlined in a comment further up, because I need to give it some UUIDs to make it a unique Connection instance, which is what Should I try to self-contain as much as possible, and put in a PR to see if I'm at least moving in the right direction? |
You should not be using the connector configuration factory - this class was for creating the default connection objects for the OMRS and OMASs. It needs to be removed because it is creating code dependencies on these connectors irrespective of whether the deployment environment is using them or not. See #1607. The data engine proxy would definately need the url and server name of the metadata server where the Data Engine OMAS is running in order to create the client. It would probably not need its own URL for its own processing. However we use this value to deploy the configuration document from the server platform where the configuration is done to the platform where the proxy server will run. The connection object needs to be created by the caller of the admin service that sets up the data engine proxy's configuration document. The data engine proxy code should not be creating the connection object. We only do that in the admin code for default connectors that are part of our implementation. The data engine proxy should have not idea what type of data engine it is dealing with - there is no obvious default data engine. |
Excellent! Dropping out of that 👍
Agreed, I have the URL and server name of the Data Engine OMAS. Need to wrap my head around that last sentence, though...
I think there's some devil in the detail on this one... Here's my current call-path:
So I'm creating and storing a generic Connection object as part of step (1). Step (3) reads this back as part of the DataEngineProxyConfig (which contains both that generic Connection object and (separately) the Data Engine OMAS information). Only at step (4) is the Connection object being passed along to the broker to instantiate a Connector -- the only idea that the Data Engine Proxy itself has of the type of connection is that it adheres to the The two bits that I'm still not sure about:
|
Signed-off-by: Christopher Grote <chris@thegrotes.net>
Step 2 - The enable method does not seem to do anything useful - from the code I see it extracts it from the config store and then saves it back into the config store. By saving the config into the configuration document, as in the setDataEngineProxyConfig(), the configuration is available for server restart. The 'instance' admin service reads the configuration document for the server and starts up the requested services. This includes passing the data engine proxy config to the initialization service for the data engine proxy server. The DataEngineProxy server seems to be missing the DELETE configuration call. Some services also have a GET configuration so that the administrator can retrieve just the specific config for the governance service. Using the DataEngineProxyConfig for the REST calls and for the store is fine. The alternative is to have separate REST calls for the 3 pieces of information. If in a future release you want to extend it with other config parameters then you add another admin call. You do not need to manage the localServerURL - it is stored in the main config document and managed by the admin services. If you want to know more about the deployment service, it is demonstrated in the egeria-server-start lab notebook. |
One other point - there is a lot of missing javadoc in the data engine proxy server config code in master - is this addressed in the latest pull request. |
Not yet, but I’ll push another commit later today to fix the JavaDoc gaps, method gaps and remove unnecessary methods. Thanks for all the guidance! |
Signed-off-by: Christopher Grote <chris@thegrotes.net>
Should be resolved now by referenced PRs that have been merged -- closing (I would suggest new issues with the specific gaps if there's anything left that I missed!) |
I was reviewing the documentation for the governance servers and noticed this in the data engine proxy server descriptions ...
Governance server config should consist of connection objects for the connectors it supports and any properties that control its behaviour. The connectors should abstract the technology that it is integrated with.
So the data engine proxy config should have a Connection object for the data engine connector that includes the connector provider class name in the Connector Type of the Connection, the security properties in the Connection's properties and the endpoint information in the Endpoint of the Connection.
The Connection object is turned into a connector when the governance server calls the ConnectorBroker. The governance server does not need to know about the contents of the Connection object.
The text was updated successfully, but these errors were encountered: