forked from conductor-oss/conductor-community
-
Notifications
You must be signed in to change notification settings - Fork 0
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
CxODEV-459 Conductor: Add support for publishing wf/task events to RabbitMQ #1
Open
darkobuvac
wants to merge
13
commits into
main
Choose a base branch
from
feature/rabbitmq-wf-status-listener
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2066923
add new message publisher moduler
darkobuvac dfd9043
add rabbit mq properties class
darkobuvac 6e2b4a4
add configuration class and register amqp connection class as bean
darkobuvac 8a5ceaa
rabbitmq service with implementation
darkobuvac 21303db
register rabbitmq service
darkobuvac 9e03dfc
wf status listener implementation
darkobuvac e957ed4
register wf status listener conditionally
darkobuvac 4590f39
add task status publihser as task status listener implementation
darkobuvac c9e002c
register task publisher conditionally
darkobuvac 6892da5
enable wf listener through configuration and change condition for reg…
darkobuvac c865e37
include module rabbitmq publisher and add default appliction properties
darkobuvac 1b537bb
remove proxy bean methods
darkobuvac fc53210
rename property
darkobuvac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
plugins { | ||
id 'groovy' | ||
} | ||
dependencies { | ||
|
||
implementation "com.netflix.conductor:conductor-common:${revConductor}" | ||
implementation "com.netflix.conductor:conductor-core:${revConductor}" | ||
implementation "com.netflix.conductor:conductor-amqp:${revConductor}" | ||
|
||
implementation "com.rabbitmq:amqp-client:${revAmqpClient}" | ||
|
||
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 "com.netflix.conductor:conductor-server:${revConductor}" | ||
testImplementation 'org.springframework.boot:spring-boot-starter-web' | ||
testImplementation project(':conductor-test-util').sourceSets.test.output | ||
} |
261 changes: 261 additions & 0 deletions
261
message-publisher/rabbitmq-message-publisher/dependencies.lock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,261 @@ | ||
{ | ||
"annotationProcessor": { | ||
"org.springframework.boot:spring-boot-configuration-processor": { | ||
"locked": "2.7.16" | ||
} | ||
}, | ||
"compileClasspath": { | ||
"com.netflix.conductor:conductor-amqp": { | ||
"project": true | ||
}, | ||
"com.netflix.conductor:conductor-common": { | ||
"locked": "3.15.0" | ||
}, | ||
"com.netflix.conductor:conductor-core": { | ||
"locked": "3.15.0" | ||
}, | ||
"org.apache.logging.log4j:log4j-api": { | ||
"locked": "2.17.2" | ||
}, | ||
"org.apache.logging.log4j:log4j-core": { | ||
"locked": "2.17.2" | ||
}, | ||
"org.apache.logging.log4j:log4j-jul": { | ||
"locked": "2.17.2" | ||
}, | ||
"org.apache.logging.log4j:log4j-slf4j-impl": { | ||
"locked": "2.17.2" | ||
}, | ||
"org.apache.logging.log4j:log4j-web": { | ||
"locked": "2.17.2" | ||
}, | ||
"org.springframework.boot:spring-boot-starter": { | ||
"locked": "2.7.16" | ||
}, | ||
"org.springframework.boot:spring-boot-starter-web": { | ||
"locked": "2.7.16" | ||
} | ||
}, | ||
"runtimeClasspath": { | ||
"com.google.guava:guava": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "32.1.2-jre" | ||
}, | ||
"com.netflix.conductor:conductor-amqp": { | ||
"project": true | ||
}, | ||
"com.netflix.conductor:conductor-common": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "3.15.0" | ||
}, | ||
"com.netflix.conductor:conductor-core": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "3.15.0" | ||
}, | ||
"com.rabbitmq:amqp-client": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "5.14.3" | ||
}, | ||
"io.reactivex:rxjava": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "1.3.8" | ||
}, | ||
"org.apache.commons:commons-lang3": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "3.12.0" | ||
}, | ||
"org.apache.logging.log4j:log4j-api": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "2.17.2" | ||
}, | ||
"org.apache.logging.log4j:log4j-core": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "2.17.2" | ||
}, | ||
"org.apache.logging.log4j:log4j-jul": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "2.17.2" | ||
}, | ||
"org.apache.logging.log4j:log4j-slf4j-impl": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "2.17.2" | ||
}, | ||
"org.apache.logging.log4j:log4j-web": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "2.17.2" | ||
} | ||
}, | ||
"testCompileClasspath": { | ||
"com.netflix.conductor:conductor-amqp": { | ||
"project": true | ||
}, | ||
"com.netflix.conductor:conductor-common": { | ||
"locked": "3.15.0" | ||
}, | ||
"com.netflix.conductor:conductor-core": { | ||
"locked": "3.15.0" | ||
}, | ||
"com.netflix.conductor:conductor-server": { | ||
"locked": "3.15.0" | ||
}, | ||
"junit:junit": { | ||
"locked": "4.13.2" | ||
}, | ||
"org.apache.logging.log4j:log4j-api": { | ||
"locked": "2.17.2" | ||
}, | ||
"org.apache.logging.log4j:log4j-core": { | ||
"locked": "2.17.2" | ||
}, | ||
"org.apache.logging.log4j:log4j-jul": { | ||
"locked": "2.17.2" | ||
}, | ||
"org.apache.logging.log4j:log4j-slf4j-impl": { | ||
"locked": "2.17.2" | ||
}, | ||
"org.apache.logging.log4j:log4j-web": { | ||
"locked": "2.17.2" | ||
}, | ||
"org.codehaus.groovy:groovy-all": { | ||
"locked": "3.0.19" | ||
}, | ||
"org.junit.vintage:junit-vintage-engine": { | ||
"locked": "5.8.2" | ||
}, | ||
"org.spockframework:spock-core": { | ||
"locked": "2.3-groovy-3.0" | ||
}, | ||
"org.spockframework:spock-spring": { | ||
"locked": "2.3-groovy-3.0" | ||
}, | ||
"org.springframework.boot:spring-boot-starter-log4j2": { | ||
"locked": "2.7.16" | ||
}, | ||
"org.springframework.boot:spring-boot-starter-test": { | ||
"locked": "2.7.16" | ||
}, | ||
"org.springframework.boot:spring-boot-starter-web": { | ||
"locked": "2.7.16" | ||
} | ||
}, | ||
"testRuntimeClasspath": { | ||
"com.google.guava:guava": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "32.1.2-jre" | ||
}, | ||
"com.netflix.conductor:conductor-amqp": { | ||
"project": true | ||
}, | ||
"com.netflix.conductor:conductor-common": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "3.15.0" | ||
}, | ||
"com.netflix.conductor:conductor-core": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "3.15.0" | ||
}, | ||
"com.netflix.conductor:conductor-server": { | ||
"locked": "3.15.0" | ||
}, | ||
"com.rabbitmq:amqp-client": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "5.14.3" | ||
}, | ||
"io.reactivex:rxjava": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "1.3.8" | ||
}, | ||
"junit:junit": { | ||
"locked": "4.13.2" | ||
}, | ||
"org.apache.commons:commons-lang3": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "3.12.0" | ||
}, | ||
"org.apache.logging.log4j:log4j-api": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "2.17.2" | ||
}, | ||
"org.apache.logging.log4j:log4j-core": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "2.17.2" | ||
}, | ||
"org.apache.logging.log4j:log4j-jul": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "2.17.2" | ||
}, | ||
"org.apache.logging.log4j:log4j-slf4j-impl": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "2.17.2" | ||
}, | ||
"org.apache.logging.log4j:log4j-web": { | ||
"firstLevelTransitive": [ | ||
"com.netflix.conductor:conductor-amqp" | ||
], | ||
"locked": "2.17.2" | ||
}, | ||
"org.codehaus.groovy:groovy-all": { | ||
"locked": "3.0.19" | ||
}, | ||
"org.junit.vintage:junit-vintage-engine": { | ||
"locked": "5.8.2" | ||
}, | ||
"org.spockframework:spock-core": { | ||
"locked": "2.3-groovy-3.0" | ||
}, | ||
"org.spockframework:spock-spring": { | ||
"locked": "2.3-groovy-3.0" | ||
}, | ||
"org.springframework.boot:spring-boot-starter-log4j2": { | ||
"locked": "2.7.16" | ||
}, | ||
"org.springframework.boot:spring-boot-starter-test": { | ||
"locked": "2.7.16" | ||
}, | ||
"org.springframework.boot:spring-boot-starter-web": { | ||
"locked": "2.7.16" | ||
} | ||
} | ||
} |
79 changes: 79 additions & 0 deletions
79
...-publisher/src/main/java/com/netflix/conductor/rabbitmq/config/RabbitMQConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
* <p> | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* 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.rabbitmq.config; | ||
|
||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import com.netflix.conductor.contribs.queue.amqp.AMQPConnection; | ||
import com.netflix.conductor.contribs.queue.amqp.config.AMQPRetryPattern; | ||
import com.netflix.conductor.rabbitmq.listener.TaskStatusPublisherRabbitMQ; | ||
import com.netflix.conductor.rabbitmq.listener.WorkflowStatusPublisherRabbitMQ; | ||
import com.netflix.conductor.rabbitmq.services.RabbitMQService; | ||
import com.netflix.conductor.rabbitmq.services.RabbitMQServiceImpl; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.rabbitmq.client.Address; | ||
import com.rabbitmq.client.ConnectionFactory; | ||
|
||
@Configuration | ||
@EnableConfigurationProperties(RabbitMQProperties.class) | ||
@ConditionalOnProperty(name = "conductor.message-publisher.type", havingValue = "rabbitmq") | ||
public class RabbitMQConfiguration { | ||
|
||
@Bean | ||
public AMQPConnection amqpConnection(RabbitMQProperties rabbitMQProperties) { | ||
ConnectionFactory connectionFactory = new ConnectionFactory(); | ||
|
||
connectionFactory.setHost(rabbitMQProperties.getHosts()); | ||
connectionFactory.setPort(rabbitMQProperties.getPort()); | ||
connectionFactory.setUsername(rabbitMQProperties.getUsername()); | ||
connectionFactory.setPassword(rabbitMQProperties.getPassword()); | ||
|
||
Address[] addresses = | ||
new Address[] { | ||
new Address(rabbitMQProperties.getHosts(), rabbitMQProperties.getPort()) | ||
}; | ||
|
||
AMQPRetryPattern retryPattern = new AMQPRetryPattern(); | ||
|
||
return AMQPConnection.getInstance(connectionFactory, addresses, retryPattern); | ||
} | ||
|
||
@Bean | ||
public RabbitMQService rabbitMQService( | ||
AMQPConnection amqpConnection, ObjectMapper objectMapper) { | ||
return new RabbitMQServiceImpl(amqpConnection, objectMapper); | ||
} | ||
|
||
@ConditionalOnProperty( | ||
name = "conductor.workflow-status-listener.type", | ||
havingValue = "rabbitmq", | ||
matchIfMissing = false) | ||
@Bean | ||
public WorkflowStatusPublisherRabbitMQ workflowStatusListenerRabbitMQ( | ||
RabbitMQService rabbitMQService, RabbitMQProperties rabbitMQProperties) { | ||
return new WorkflowStatusPublisherRabbitMQ(rabbitMQService, rabbitMQProperties); | ||
} | ||
|
||
@ConditionalOnProperty( | ||
name = "conductor.task-status-listener.type", | ||
havingValue = "rabbitmq", | ||
matchIfMissing = false) | ||
@Bean | ||
public TaskStatusPublisherRabbitMQ taskStatusPublisherRabbitMQ( | ||
RabbitMQService rabbitMQService, RabbitMQProperties rabbitMQProperties) { | ||
return new TaskStatusPublisherRabbitMQ(rabbitMQService, rabbitMQProperties); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style: Looking around, I see that "non-code" comments should have a space between
#
and the sentence (not unlike our own .NET Coding Conventions)