Skip to content

SNS->SQS->JMS causes error "JMSException: Binary is not a supported JMS property type" #3549

@falken

Description

@falken

Expected behaviour

  1. A message is sent from a nodejs application to an SNS topic with _datadog context propagation header set.
  2. A messages is placed on an SQS queue based on a subscription to the SNS topic
  3. A JMS consumer consumes and processes the message

Actual behaviour
1 & 2 function properly
Step 3 fails with an error "JMSException: Binary is not a supported JMS property type" thrown by this code in the aws library
https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/4cb91355cb92d9361a2179233c9db89383b1299e/src/main/java/com/amazon/sqs/javamessaging/message/SQSMessage.java#L1057

The issue appears to be that when a message is sent to an SNS topic the DataType is set to "Binary"

https://github.com/DataDog/dd-trace-js/blob/da4b19df5e5b7f85f56873372869d677d60d389e/packages/datadog-plugin-aws-sdk/src/services/sns.js#L76C26-L76C26

Which causes the error in the previous code link.

In the SQS version of the code it uses a DataType of "String":

It looks like it's using Binary because of some sort of Message Attribute filtering issue
DataDog/serverless-plugin-datadog#232 (comment)

Steps to reproduce

Environment
Linux AWS ECS Fargate

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions