File tree 1 file changed +31
-0
lines changed
dd-java-agent/instrumentation/aws-java-sqs-1.0/src/test/groovy
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -614,6 +614,37 @@ class SqsClientV1DataStreamsForkedTest extends SqsClientTest {
614
614
cleanup :
615
615
client. shutdown()
616
616
}
617
+
618
+
619
+ def " Data streams context not extracted from message body when message is not a Json" () {
620
+ setup :
621
+ def client = AmazonSQSClientBuilder . standard()
622
+ .withEndpointConfiguration(endpoint)
623
+ .withCredentials(credentialsProvider)
624
+ .build()
625
+ def queueUrl = client. createQueue(' somequeue' ). queueUrl
626
+ TEST_WRITER . clear()
627
+
628
+ when :
629
+ injectSysConfig(GeneralConfig . DATA_STREAMS_ENABLED , " false" )
630
+ client. sendMessage(queueUrl, ' {"Message": "not a json"' )
631
+ injectSysConfig(GeneralConfig . DATA_STREAMS_ENABLED , " true" )
632
+ def messages = client. receiveMessage(queueUrl). messages
633
+ messages. forEach {}
634
+
635
+ TEST_DATA_STREAMS_WRITER . waitForGroups(1 )
636
+
637
+ then :
638
+ StatsGroup first = TEST_DATA_STREAMS_WRITER . groups. find { it. parentHash == 0 }
639
+
640
+ verifyAll(first) {
641
+ edgeTags == [" direction:in" , " topic:somequeue" , " type:sqs" ]
642
+ edgeTags. size() == 3
643
+ }
644
+
645
+ cleanup :
646
+ client. shutdown()
647
+ }
617
648
}
618
649
619
650
You can’t perform that action at this time.
0 commit comments