question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Application logs in pub-sub sample have empty payload {}

See original GitHub issue

I was trying out the pub-sub sample.

Expected Behavior

In response to dapr publish --topic A --payload '{ "message": "This is a test" }', the pub-sub sample logs should be something like [0m?[94;1m== APP == Topic A: { id: '5780e2ca-f526-4839-92e5-a0a30aff829a', source: 'react-form', type: 'com.dapr.event.sent', specversion: '0.3',data: { message: 'this is a test' } } (as per docs)

Actual Behavior

What I see is the following: APP == A: {}

Steps to Reproduce the Problem

  • git clone https://github.com/dapr/samples
  • cd node-subscriber
  • npm install
  • dapr run --app-id node-subscriber --app-port 3000 node app.js
  • dapr publish --topic A --payload ‘{ “message”: “This is a test” }’

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
abhirockzzcommented, Oct 25, 2019

Yes it’s fixed! This is what I see in the logs

== APP == A:  {
== APP ==   id: 'fd69cbae-3f59-46d0-8704-80e09c513615',
== APP ==   source: 'node-subscriber',
== APP ==   type: 'com.dapr.event.sent',
== APP ==   specversion: '0.3',
== APP ==   datacontenttype: 'application/json',
== APP ==   data: { message: 'This is a test' }
== APP == }
0reactions
youngbuparkcommented, Oct 25, 2019

@abhirockzz Great! Thanks for the reporting. This sample was broken by the change right after we announced v0.1.0 Dapr. We tag the version to sample to avoid this situation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Payload unwrapping for Pub/Sub push subscriptions
With payload unwrapping, the message data is delivered directly as the HTTP body. Without payload unwrapping, Pub/Sub delivers a JSON object that contains ......
Read more >
Pub/Sub triggers | Cloud Functions for Firebase - Google
Google Cloud's Pub/Sub is a globally distributed message bus that automatically scales as you need it. You can trigger a function whenever a...
Read more >
Pub/sub API reference
Dapr assumes that a JSON-encoded payload response without status field or an empty payload responses with HTTP 2xx is a SUCCESS . message...
Read more >
Best Practices for Monitoring GCP Audit Logs
Learn how to monitor your Google Cloud audit logs for better visibility into GCP security with Datadog.
Read more >
Using Cloud Pub/Sub as an endpoint for your app
To use Cloud Pub/Sub with your app, you need to create a Google Cloud Platform project ... Fill out the other fields as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found