Skip to content

Conversation

@wojciechUrbanski
Copy link
Contributor

Fixes #376

TraceID is stored now as a part of message data. It can be received via request header (X-Amzn-Trace-Id) or MessageSystemAttributes (AWSTraceHeader). I have added handling of MessageSystemAttributes to SendMessageDirectives as it was missing.

Wojtek Urbanski added 3 commits October 19, 2020 15:42
* Retrieve message should not return empty string if trace ID is empty
* SendMessageBatch should retrieve trace ID from request headers
* Overall code improvements
* Tests for tracing handling
* Removing unused code
* Renaming test names

import scala.collection.JavaConverters.{iterableAsScalaIterableConverter, mapAsScalaMapConverter, seqAsJavaListConverter}

class TracingTests extends SqsClientServerCommunication with Matchers with OptionValues {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 good idea to finally split this monster class with tests

}

private def extractAwsXRayTracingHeader(request: HttpRequest): Map[String, String] = {
request.headers.find(_.name() == "X-Amzn-Trace-Id").map(header => header.name() -> header.value()).toMap
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be .equalsIgnoreCase as headers are case-insensitive

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed :)


import java.util.Base64

sealed trait MessageSystemAttribute
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be defined in the rest module, as that's the only place where it's used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, moved to rest module

* Moving MessageSystemAttribute to rest as it is used only in this module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Elasticmq doesn't support XRay Tracing Header

3 participants