Skip to content

Empty Body Sent to HTTP Subscribers #45

Description

@sgtoj

Sending messages to http subscribers do not work. A POST request is made to the endpoint, but no data is sent in the body. However, the content-length header is set the expected value as if a message was sent. I got the same result for two different http servers: netcat and server.js (nodejs express wrapper). Additionally, I confirmed messages sent to the same topic but different types of subscribers (i.e. file protocol) does work as expected.

command sent

aws sns --endpoint-url http://localhost:9911 publish --topic-arn arn:aws:sns:us-east-1:1465414804035:test-topic --message "test"

verbose logging of received msg from sns

POST /message HTTP/1.1
MessageExchangeId: 9a874dc5-3dc5-477f-90d2-4c4dd6e77c35
x-amz-sns-message-id: 9a874dc5-3dc5-477f-90d2-4c4dd6e77c35
x-amz-sns-message-type: Notification
x-amz-sns-subscription-arn: 6df4ed2b-a650-4f7c-910a-1a89c7cae5a6
x-amz-sns-topic-arn: arn:aws:sns:us-east-1:1465414804035:test-topic
User-Agent: Jakarta Commons-HttpClient/3.1
Host: subscriber:8010
Content-Length: 91

# no body data?

environment setup

./docker-compose.yml

version: "3.4"
services:
  sns:
    image: s12v/sns
    environment:
    - SUBSCRIBER_HTTP=subscriber:8010
    ports:
    - 9911:9911
    volumes:
    - ./sns:/etc/sns
  subscriber:
    image: subfuzion/netcat
    ports:
    - 8010:8010
    command: "-vl 8010"

./sns/db.json

{
    "version": 1,
    "timestamp": 1465414804110,
    "subscriptions": [
        {
            "arn": "6df4ed2b-a650-4f7c-910a-1a89c7cae5a6",
            "topicArn": "arn:aws:sns:us-east-1:1465414804035:test-topic",
            "endpoint": "http:{{env:SUBSCRIBER_HTTP}}/message",
            "owner": "",
            "protocol": "http"
        }
    ],
    "topics": [
        {
            "arn": "arn:aws:sns:us-east-1:1465414804035:test-topic",
            "name": "tms-session-api-events"
        }
    ]
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions