Skip to content

Commit

Permalink
Merge pull request #219 from th2-net/separate-executor
Browse files Browse the repository at this point in the history
MessagesWorker > use separate executor for storeMessageBatch/storeGro…
  • Loading branch information
OptimumCode authored Aug 11, 2023
2 parents ffb28f7 + 042f0e7 commit 81a8365
Show file tree
Hide file tree
Showing 91 changed files with 7,678 additions and 6,365 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,4 @@ A test event can have a reference to its parent, thus forming a hierarchical str

Events in a batch can have a reference only to the parent of the batch or other test events from the same batch. Events outside the batch should not reference events within the batch.

Test events have mandatory parameters that are verified when storing an event. These are: id, name (for non-batch events), start timestamp.
Test events have mandatory parameters that are verified when storing an event. These are: id, name (for non-batch events), start timestamp.
320 changes: 156 additions & 164 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,183 +1,175 @@
plugins {
id "io.github.gradle-nexus.publish-plugin" version"1.0.0"
id "org.owasp.dependencycheck" version "8.2.1"
id 'signing'
id "io.github.gradle-nexus.publish-plugin" version "1.0.0"
id "org.owasp.dependencycheck" version "8.2.1"
id 'signing'
}

ext {
sharedDir = file("${project.rootDir}/shared")
sharedDir = file("${project.rootDir}/shared")
}

allprojects {
version = release_version
group = 'com.exactpro.th2'

dependencyCheck {
formats=['SARIF', 'JSON', 'HTML']
failBuildOnCVSS=5
suppressionFile="suppressions.xml"
analyzers {
assemblyEnabled = false
nugetconfEnabled = false
nodeEnabled = false
}
}
version = release_version
group = 'com.exactpro.th2'

dependencyCheck {
formats = ['SARIF', 'JSON', 'HTML']
failBuildOnCVSS = 5
suppressionFile = "${rootDir}/suppressions.xml"
analyzers {
assemblyEnabled = false
nugetconfEnabled = false
nodeEnabled = false
}
}

}

subprojects {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'org.owasp.dependencycheck'

repositories {
mavenCentral()
maven {
name 'Sonatype_snapshots'
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
}

maven {
name 'Sonatype_releases'
url 'https://s01.oss.sonatype.org/content/repositories/releases/'
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
}
}


defaultTasks 'build'

sourceCompatibility = JavaVersion.VERSION_11 //Java version compatibility to use when compiling Java source.
targetCompatibility = JavaVersion.VERSION_11 //Java version to generate classes for.
compileJava.options.debugOptions.debugLevel = 'source,lines,vars' // Include debug information

jar {
manifest {
attributes(
'Created-By': "${System.getProperty('java.version')} (${System.getProperty('java.vendor')})",
'Specification-Title': '',
'Specification-Vendor': 'Exactpro Systems LLC',
'Implementation-Title': project.archivesBaseName,
'Implementation-Vendor': 'Exactpro Systems LLC',
'Implementation-Vendor-Id': 'com.exactpro',
'Implementation-Version': project.version,
'Implementation-Version-Date': getDate()
)
}
}

java {
withJavadocJar()
withSourcesJar()
}

// conditionals for publications
tasks.withType(PublishToMavenRepository) {
onlyIf {
(repository == publishing.repositories.nexusRepository &&
project.hasProperty('nexus_user') &&
project.hasProperty('nexus_password') &&
project.hasProperty('nexus_url')) ||
(repository == publishing.repositories.sonatype &&
project.hasProperty('sonatypeUsername') &&
project.hasProperty('sonatypePassword')) ||
(repository == publishing.repositories.localRepo)
}
}
tasks.withType(Sign) {
onlyIf { project.hasProperty('signingKey') &&
project.hasProperty('signingPassword')
}
}
// disable running task 'initializeSonatypeStagingRepository' on a gitlab
tasks.whenTaskAdded {task ->
if(task.name.equals('initializeSonatypeStagingRepository') &&
!(project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword'))
) {
task.enabled = false
}
}

publishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
pom {
name = project.name
packaging = 'jar'
description = rootProject.description
url = vcs_url
scm {
url = vcs_url
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'developer'
name = 'developer'
email = '[email protected]'
}
}
scm {
url = vcs_url
}
}
}
}
repositories {
maven {
name = 'localRepo'
url = sharedDir
}
//Nexus repo to publish from gitlab
maven {
name = 'nexusRepository'
credentials {
username = project.findProperty('nexus_user')
password = project.findProperty('nexus_password')
}
url = project.findProperty('nexus_url')
}
}
}

signing {
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'org.owasp.dependencycheck'

repositories {
mavenCentral()
maven {
name 'Sonatype_snapshots'
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
}

maven {
name 'Sonatype_releases'
url 'https://s01.oss.sonatype.org/content/repositories/releases/'
}
configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
}
}


defaultTasks 'build'

sourceCompatibility = JavaVersion.VERSION_11 //Java version compatibility to use when compiling Java source.
targetCompatibility = JavaVersion.VERSION_11 //Java version to generate classes for.
compileJava.options.debugOptions.debugLevel = 'source,lines,vars' // Include debug information

jar {
manifest {
attributes(
'Created-By': "${System.getProperty('java.version')} (${System.getProperty('java.vendor')})",
'Specification-Title': '',
'Specification-Vendor': 'Exactpro Systems LLC',
'Implementation-Title': project.archivesBaseName,
'Implementation-Vendor': 'Exactpro Systems LLC',
'Implementation-Vendor-Id': 'com.exactpro',
'Implementation-Version': project.version,
'Implementation-Version-Date': getDate()
)
}
}

java {
withJavadocJar()
withSourcesJar()
}

// conditionals for publications
tasks.withType(PublishToMavenRepository).configureEach {
onlyIf {
(repository == publishing.repositories.nexusRepository &&
project.hasProperty('nexus_user') &&
project.hasProperty('nexus_password') &&
project.hasProperty('nexus_url')) ||
(repository == publishing.repositories.sonatype &&
project.hasProperty('sonatypeUsername') &&
project.hasProperty('sonatypePassword'))
}
}
tasks.withType(Sign).configureEach {
onlyIf {
project.hasProperty('signingKey') &&
project.hasProperty('signingPassword')
}
}
// disable running task 'initializeSonatypeStagingRepository' on a gitlab
tasks.configureEach { task ->
if (task.name == 'initializeSonatypeStagingRepository' &&
!(project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword'))
) {
task.enabled = false
}
}

publishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
pom {
name = project.name
packaging = 'jar'
description = rootProject.description
url = vcs_url
scm {
url = vcs_url
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'developer'
name = 'developer'
email = '[email protected]'
}
}
scm {
url = vcs_url
}
}
}
}
repositories {
//Nexus repo to publish from gitlab
maven {
name = 'nexusRepository'
credentials {
username = project.findProperty('nexus_user')
password = project.findProperty('nexus_password')
}
url = project.findProperty('nexus_url')
}
}
}

signing {
String signingKey = findProperty("signingKey")
String signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}

}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}

tasks.create("listProjects") {
doLast {
subprojects.forEach { println(it.name) }
}
tasks.register("listProjects") {
doLast {
subprojects.forEach { println(it.name) }
}
}

clean {
delete sharedDir
}
static def getDate() {
def date = new Date()
def formattedDate = date.format('yyyyMMdd-HH:mm:ss.SSS')
return formattedDate
def date = new Date()
def formattedDate = date.format('yyyyMMdd-HH:mm:ss.SSS')
return formattedDate
}
Loading

0 comments on commit 81a8365

Please sign in to comment.