--
You received this message because you are subscribed to the Google Groups "Google Cloud Pub/Sub Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-pubsub-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-pubsub-discuss/6b5df3e5-88d5-440f-848c-9e00fefa9336%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
gcloud beta emulators pubsub start
gcloud beta emulators pubsub env-init
def publish(request):
ps = pubsub.Client()
topic = ps.topic(PUBSUB_TOPIC)
topic.publish('Example payload'.encode('utf-8'))
print("sent message")
return Response({'detail': 'ok'})
On running this code I do not get any credential error like before but there is no response from the pubsub emulator. There is no response from the subscriber either.
Also, how do I register topics and subscribers on the emulator?
Thanks,
Kush
In the same tutorial you are following you created a subscription with an endpoint URL. Likewise, when you configure the environment variable and specified the port that you want the emulator to run on (e.g '8590'), you need to then setup a subscriber to have the endpoint of the emulator (e.g 'localhost:8590').You do this by setting the endpoint of a subscriber using 'subscription = topic.subscription(subscription_name, push_endpoint='http://localhost:8590')' in your code, as shown in the documentation.
--
You received this message because you are subscribed to the Google Groups "Google Cloud Pub/Sub Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-pubsub-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-pubsub-discuss/39761936-c881-4206-bfa8-76b12c8b15ac%40googlegroups.com.
gcloud beta pubsub topics create my-topic
[pubsub] INFO: [ManagedChannelImpl@783e6358] Created with target localhost:8085
export PUBSUB_EMULATOR_HOST=localhost:8085
$ python main.py
@APP.route('/pubsub/push', methods=['POST'])
def pubsub_push():
...
$ gcloud beta pubsub subscriptions create my-sub \
> --topic my-topic \
> --push-endpoint \
> http://localhost:8081/pubsub/push?token=123.987 \
> --ack-deadline 30
ERROR: Failed to create subscription [projects/my-project/subscriptions/my-sub]: Invalid push endpoint given (endpoint=http://localhost:8081/pubsub/push?token=123.987). Refer to https://cloud.google.com/pubsub/subscriber#create for more information.
--
You received this message because you are subscribed to the Google Groups "Google Cloud Pub/Sub Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-pubsub-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-pubsub-discuss/ab758cdf-f407-42ad-a14c-185947bd7c07%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Muath,I don't believe you can, but the question is best addressed to the android dev notifications team and community. Pub/Sub is just the platform; the developer notification feature and its detailed capabilities are not defined by Pub/Sub.I'd be very curious to know why you'd want your notifications in an emulator rather than the Pub/Sub service. Could you tell us more?
On Mon, Feb 5, 2018 at 10:19 AM muath aljafari <muath....@gmail.com> wrote:
how can I configure Real-time Developer Notifications https://developer.android.com/google/play/billing/realtime_developer_notifications.html to push to a local topic in the emulator, do could you suggest any alternative please.--
On Friday, April 28, 2017 at 10:48:32 PM UTC+3, Jordan (Cloud Platform Support) wrote:In the same tutorial you are following you created a subscription with an endpoint URL. Likewise, when you configure the environment variable and specified the port that you want the emulator to run on (e.g '8590'), you need to then setup a subscriber to have the endpoint of the emulator (e.g 'localhost:8590').You do this by setting the endpoint of a subscriber using 'subscription = topic.subscription(subscription_name, push_endpoint='http://localhost:8590')' in your code, as shown in the documentation.
You received this message because you are subscribed to the Google Groups "Google Cloud Pub/Sub Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-pubsub-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-pubsub-discuss/ab758cdf-f407-42ad-a14c-185947bd7c07%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.