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"
}
]
}
Sending messages to
httpsubscribers do not work. APOSTrequest is made to the endpoint, but no data is sent in the body. However, thecontent-lengthheader is set the expected value as if a message was sent. I got the same result for two different http servers:netcatandserver.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./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" } ] }