Skip to content

Commit

Permalink
ISICO-15301: module change as per manan's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sarmuru2 committed Oct 16, 2023
1 parent 2125fad commit be9a7d9
Show file tree
Hide file tree
Showing 21 changed files with 399 additions and 46 deletions.
15 changes: 15 additions & 0 deletions common/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# common project which contains base/framework/common classes across projects

Utility project which has rest notification related properties and utility to send rest requests

## Published Artifacts

Group: `com.netflix.conductor`

| Published Artifact | Description |
|---------------------------|------------------------------------------|
| conductor-communit-common | Utility classes to publish rest requests |


## Configuration

21 changes: 21 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
plugins {
id 'groovy'
}
dependencies {

implementation "com.netflix.conductor:conductor-annotations:${revConductor}"

implementation group: 'javax.inject', name: 'javax.inject', version: '1'
implementation "org.apache.commons:commons-lang3:"
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.14'

compileOnly 'org.springframework.boot:spring-boot-starter'
compileOnly 'org.springframework.boot:spring-boot-starter-web'

testImplementation "org.codehaus.groovy:groovy-all:${revGroovy}"
testImplementation "org.spockframework:spock-core:${revSpock}"
testImplementation "org.spockframework:spock-spring:${revSpock}"

testImplementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation project(':conductor-test-util').sourceSets.test.output
}
123 changes: 123 additions & 0 deletions common/dependencies.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"annotationProcessor": {
"org.springframework.boot:spring-boot-configuration-processor": {
"locked": "2.6.7"
}
},
"compileClasspath": {
"org.apache.logging.log4j:log4j-api": {
"locked": "2.17.1"
},
"org.apache.logging.log4j:log4j-core": {
"locked": "2.17.1"
},
"org.apache.logging.log4j:log4j-jul": {
"locked": "2.17.1"
},
"org.apache.logging.log4j:log4j-slf4j-impl": {
"locked": "2.17.1"
},
"org.apache.logging.log4j:log4j-web": {
"locked": "2.17.1"
},
"org.springframework.boot:spring-boot-starter": {
"locked": "2.6.7"
},
"org.springframework.boot:spring-boot-starter-web": {
"locked": "2.6.7"
}
},
"runtimeClasspath": {
"org.apache.logging.log4j:log4j-api": {
"locked": "2.17.1"
},
"org.apache.logging.log4j:log4j-core": {
"locked": "2.17.1"
},
"org.apache.logging.log4j:log4j-jul": {
"locked": "2.17.1"
},
"org.apache.logging.log4j:log4j-slf4j-impl": {
"locked": "2.17.1"
},
"org.apache.logging.log4j:log4j-web": {
"locked": "2.17.1"
}
},
"testCompileClasspath": {
"org.apache.logging.log4j:log4j-api": {
"locked": "2.17.1"
},
"org.apache.logging.log4j:log4j-core": {
"locked": "2.17.1"
},
"org.apache.logging.log4j:log4j-jul": {
"locked": "2.17.1"
},
"org.apache.logging.log4j:log4j-slf4j-impl": {
"locked": "2.17.1"
},
"org.apache.logging.log4j:log4j-web": {
"locked": "2.17.1"
},
"org.codehaus.groovy:groovy-all": {
"locked": "3.0.9"
},
"org.junit.vintage:junit-vintage-engine": {
"locked": "5.8.2"
},
"org.spockframework:spock-core": {
"locked": "2.1-groovy-3.0"
},
"org.spockframework:spock-spring": {
"locked": "2.1-groovy-3.0"
},
"org.springframework.boot:spring-boot-starter-log4j2": {
"locked": "2.6.7"
},
"org.springframework.boot:spring-boot-starter-test": {
"locked": "2.6.7"
},
"org.springframework.boot:spring-boot-starter-web": {
"locked": "2.6.7"
}
},
"testRuntimeClasspath": {
"org.apache.logging.log4j:log4j-api": {
"locked": "2.17.1"
},
"org.apache.logging.log4j:log4j-core": {
"locked": "2.17.1"
},
"org.apache.logging.log4j:log4j-jul": {
"locked": "2.17.1"
},
"org.apache.logging.log4j:log4j-slf4j-impl": {
"locked": "2.17.1"
},
"org.apache.logging.log4j:log4j-web": {
"locked": "2.17.1"
},
"org.codehaus.groovy:groovy-all": {
"locked": "3.0.9"
},
"org.junit.vintage:junit-vintage-engine": {
"locked": "5.8.2"
},
"org.spockframework:spock-core": {
"locked": "2.1-groovy-3.0"
},
"org.spockframework:spock-spring": {
"locked": "2.1-groovy-3.0"
},
"org.springframework.boot:spring-boot-starter-log4j2": {
"locked": "2.6.7"
},
"org.springframework.boot:spring-boot-starter-test": {
"locked": "2.6.7"
},
"org.springframework.boot:spring-boot-starter-web": {
"locked": "2.6.7"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package com.netflix.conductor.contribs.publisher;
package com.netflix.conductor.common.rest;

import java.util.List;

import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties("conductor.webhook.notification")
public class ConductorWebhookNotificationProperties {
@ConfigurationProperties("conductor.rest.notification")
public class ConductorRestNotificationProperties {

private String url;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package com.netflix.conductor.contribs.publisher;
package com.netflix.conductor.common.rest;

import java.io.IOException;
import java.io.InterruptedIOException;
Expand Down Expand Up @@ -38,17 +38,17 @@

public class RestClientManager {
private static final Logger logger = LoggerFactory.getLogger(RestClientManager.class);
private ConductorWebhookNotificationProperties config;
private ConductorRestNotificationProperties config;
private CloseableHttpClient client;
private String notifType;
private String notifId;

enum NotificationType {
public enum NotificationType {
TASK,
WORKFLOW
};

public RestClientManager(ConductorWebhookNotificationProperties config) {
public RestClientManager(ConductorRestNotificationProperties config) {
logger.info("created RestClientManager" + System.currentTimeMillis());
this.config = config;
this.client = prepareClient();
Expand Down Expand Up @@ -177,7 +177,7 @@ private CloseableHttpClient prepareClient() {
.build();
}

void postNotification(
public void postNotification(
RestClientManager.NotificationType notifType,
String data,
String domainGroupMoId,
Expand Down
2 changes: 1 addition & 1 deletion community-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ dependencies {
//implementation project(':task:conductor-kafka')

implementation project(':conductor-workflow-event-listener')
implementation project(':conductor-webhook')
implementation project(':common')

implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-validation'
Expand Down
7 changes: 4 additions & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ include 'index'
include 'test-util'
include 'lock'
include 'workflow-event-listener'
include 'webhook'
include 'common'
include 'task-event-listener'

include 'persistence:common-persistence'
include 'persistence:mysql-persistence'
Expand All @@ -43,13 +44,13 @@ include 'community-server'
rootProject.children.stream()
.filter(p -> p.name.equals("persistence") || p.name.equals("index") ||
p.name.equals("external-payload-storage") || p.name.equals("event-queue") ||
p.name.equals("lock") || p.name.equals("task"))
p.name.equals("lock") || p.name.equals("task") || p.name.equals("common") || p.name.equals("task-event-listener"))
.forEach(it -> it.children
.forEach(c -> c.name = "conductor-" + c.name))

rootProject.children.stream()
.filter(p -> !p.name.equals("persistence") && !p.name.equals("index") &&
!p.name.equals("external-payload-storage") && !p.name.equals("event-queue") &&
!p.name.equals("lock") && !p.name.equals("task"))
!p.name.equals("lock") && !p.name.equals("task") && !p.name.equals("common") && !p.name.equals("task-event-listener"))
.forEach(it -> it.name = "conductor-" + it.name)

File renamed without changes.
1 change: 1 addition & 0 deletions webhook/build.gradle → task-event-listener/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dependencies {
implementation "com.cisco.conductor:conductor-core:${revConductorCustom}"
implementation "com.cisco.conductor:conductor-common:${revConductorCustom}"

implementation project(':common')

implementation "com.netflix.conductor:conductor-annotations:${revConductor}"
implementation group: 'javax.inject', name: 'javax.inject', version: '1'
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package com.netflix.conductor.contribs.publisher;
package com.netflix.conductor.contribs.listener.task;

import java.util.LinkedHashMap;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package com.netflix.conductor.contribs.publisher;
package com.netflix.conductor.contribs.listener.task;

import java.io.IOException;
import java.util.List;
Expand All @@ -19,6 +19,7 @@
import javax.inject.Inject;
import javax.inject.Singleton;

import com.netflix.conductor.common.rest.RestClientManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package com.netflix.conductor.contribs.publisher;
package com.netflix.conductor.contribs.listener.task;

import com.netflix.conductor.common.rest.ConductorRestNotificationProperties;
import com.netflix.conductor.common.rest.RestClientManager;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
Expand All @@ -20,15 +22,15 @@
import com.netflix.conductor.core.listener.TaskStatusListener;

@Configuration
@EnableConfigurationProperties(ConductorWebhookNotificationProperties.class)
@EnableConfigurationProperties(ConductorRestNotificationProperties.class)
@ConditionalOnProperty(name = "conductor.task-status-listener.type", havingValue = "task_publisher")
public class TaskStatusPublisherConfiguration {

@Bean
public TaskStatusListener getTaskStatusListener(
RestClientManager rcm,
ExecutionDAOFacade executionDAOFacade,
ConductorWebhookNotificationProperties config) {
ConductorRestNotificationProperties config) {

return new TaskStatusPublisher(rcm, executionDAOFacade, config.getSubscribedTaskStatuses());
}
Expand Down
Loading

0 comments on commit be9a7d9

Please sign in to comment.