Fix #4082: Do not start slack event publisher if there is no config (#4083)

This commit is contained in:
Sriharsha Chintalapani 2022-04-12 17:25:23 -07:00 committed by GitHub
parent 3f67f78479
commit 06cc35d048
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 12 deletions

View File

@ -352,6 +352,7 @@
<version>${antlr.version}</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>antlr4</goal>
</goals>

View File

@ -219,8 +219,11 @@ public class CatalogApplication extends Application<CatalogApplicationConfig> {
if (catalogApplicationConfig.getSlackEventPublishers() != null) {
for (SlackPublisherConfiguration slackPublisherConfiguration :
catalogApplicationConfig.getSlackEventPublishers()) {
SlackWebhookEventPublisher slackPublisher = new SlackWebhookEventPublisher(slackPublisherConfiguration);
EventPubSub.addEventHandler(slackPublisher);
if (slackPublisherConfiguration.getWebhookUrl() != null
&& !slackPublisherConfiguration.getWebhookUrl().isEmpty()) {
SlackWebhookEventPublisher slackPublisher = new SlackWebhookEventPublisher(slackPublisherConfiguration);
EventPubSub.addEventHandler(slackPublisher);
}
}
}
}

View File

@ -100,6 +100,8 @@ public class ElasticSearchEventPublisher extends AbstractEventPublisher {
LOG.warn("Ignoring Entity Type {}", entityType);
}
if (updateRequest != null) {
LOG.debug("Sending request to ElasticSearch");
LOG.debug(updateRequest.toString());
client.update(updateRequest, RequestOptions.DEFAULT);
}
} catch (ElasticsearchException e) {

View File

@ -157,8 +157,8 @@ airflowConfiguration:
slackEventPublishers:
- name: "slack events"
webhookUrl: "slackIncomingWebhook URL"
openMetadataUrl: http://${SERVER_HOST:-localhost}:${SERVER_PORT:-8585}
webhookUrl: ${SLACK_WEBHOOK_URL:-""}
openMetadataUrl: ${OPENMETADATA_SERVER_URL}
filters:
- eventType: "entityCreated"
entities:

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (ingestion)" project-jdk-type="Python SDK" />
<component name="PythonCompatibilityInspectionAdvertiser">
<option name="version" value="3" />
</component>
</project>

View File

@ -35,7 +35,7 @@ default_args = {
config = """
{
"source": {
"type": "sample-data",
"type": "sample_data",
"serviceName": "sample_data",
"serviceConnection": {
"config": {