Empty Body Sent to HTTP Subscribers
See original GitHub issueSending 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"
}
]
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:6
Top Results From Across the Web
req.body is empty one a post request sent from angular http post
I making a post request from my angular application to a node server. I'm using FormData and HttpClient to send the post.
Read more >Fanout to HTTP/S endpoints - AWS Documentation
When you subscribe an endpoint to a topic, you can publish a notification to the topic and Amazon SNS sends an HTTP POST...
Read more >Why my request.body is empty while request.params in not?
Hi guys,. I have this simple express code which prints the request.body. But it's empty. When I print request.query then I get some...
Read more >Post requests from Cloud Function have empty body and the ...
get_json() instead of data=request.form . Introduction. In the last post I talked about creating a PubSub subscription using a cloud function with an...
Read more >HttpResponse.BodySubscribers (Java SE 12 & JDK 12 )
java.net.http.HttpResponse.BodySubscribers ... Returns a body subscriber that forwards all response body to the given Flow.Subscriber , line by line.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Was banging my head on my keyboard for a while on this. Posting for anyone using Express v4+:
in my case I just used
bodyParser.text()
because it was sending a json content with a content type “plain/text”. i also had to parse the json by myself