Skip to content

Commit

Permalink
Add (more) Spring JMS support (open-telemetry#6308)
Browse files Browse the repository at this point in the history
* Add (more) Spring JMS support

* Remove duplication

* Better advice matcher
  • Loading branch information
trask authored and LironKS committed Dec 4, 2022
1 parent d0527ec commit f4cdeb4
Show file tree
Hide file tree
Showing 21 changed files with 376 additions and 367 deletions.
26 changes: 1 addition & 25 deletions instrumentation/jms-1.1/javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,20 @@ muzzle {

testSets {
create("jms2Test")
create("jms2TestReceiveSpansDisabled") {
extendsFrom("jms2Test")
}
}

tasks {
val testReceiveSpansDisabled by registering(Test::class) {
filter {
includeTestsMatching("SpringListenerJms1SuppressReceiveSpansTest")
}
include("**/SpringListenerJms1SuppressReceiveSpansTest.*")
}

val jms2Test by existing(Test::class) {
jvmArgs("-Dotel.instrumentation.messaging.experimental.receive-telemetry.enabled=true")
}

val jms2TestReceiveSpansDisabled by existing

test {
usesService(gradle.sharedServices.registrations["testcontainersBuildService"].getService())
filter {
excludeTestsMatching("SpringListenerJms1SuppressReceiveSpansTest")
}
jvmArgs("-Dotel.instrumentation.messaging.experimental.receive-telemetry.enabled=true")
}

check {
dependsOn(testReceiveSpansDisabled)
dependsOn(jms2Test)
dependsOn(jms2TestReceiveSpansDisabled)
}
}

Expand All @@ -60,18 +43,11 @@ dependencies {

compileOnly("javax.jms:jms-api:1.1-rev-1")

testImplementation("javax.annotation:javax.annotation-api:1.3.2")
testImplementation("org.springframework.boot:spring-boot-starter-activemq:${versions["org.springframework.boot"]}")
testImplementation("org.springframework.boot:spring-boot-starter-test:${versions["org.springframework.boot"]}") {
exclude("org.junit.vintage", "junit-vintage-engine")
}
testImplementation("org.apache.activemq:activemq-client:5.16.5")

add("jms2TestImplementation", "org.hornetq:hornetq-jms-client:2.4.7.Final")
add("jms2TestImplementation", "org.hornetq:hornetq-jms-server:2.4.7.Final") {
// this doesn't exist in maven central, and doesn't seem to be needed anyways
exclude("org.jboss.naming", "jnpserver")
}

// this is just to avoid a bit more copy-pasting
add("jms2TestReceiveSpansDisabledImplementation", sourceSets["jms2Test"].output)
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
import javax.annotation.Nullable;
import javax.jms.JMSException;

enum JmsMessageAttributesGetter implements MessagingAttributesGetter<MessageWithDestination, Void> {
public enum JmsMessageAttributesGetter
implements MessagingAttributesGetter<MessageWithDestination, Void> {
INSTANCE;

private static final Logger logger = Logger.getLogger(JmsMessageAttributesGetter.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import java.util.Collections;
import javax.jms.JMSException;

enum MessagePropertyGetter implements TextMapGetter<MessageWithDestination> {
public enum MessagePropertyGetter implements TextMapGetter<MessageWithDestination> {
INSTANCE;

@Override
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit f4cdeb4

Please sign in to comment.