Skip to content

Example code to Publish messages to a PubSub topic using sample PageView object simulating streaming from mobile devices and web browsers (Clickstream)

Notifications You must be signed in to change notification settings

ricardolui/pubsub-publisher-retail

Repository files navigation

PubSub Publisher example for Retail

This is a pubsub publisher for retail usecase on bigdata.

Set up your environment

Tools

  1. Install Java 8

  2. Install Maven (for windows, mac, linux)

  3. Install Google Cloud SDK

  4. Install an IDE such as Eclipse or IntelliJ (optional)

  5. To test your installation, open a terminal window and type:

    $ java -version
    $ mvn --version
    $ gcloud --version

Google Cloud

  1. Go to https://cloud.google.com/console.****
  2. Enable billing and create a project.
  3. Enable Google PubSub API

Getting Started

How to run the code, currently only project, topic and messages per second are supported variables

mvn compile exec:java \
         -Dexec.mainClass=com.google.ce.demos.dataflow.abandonedcarts.producer.PublisherPubSub \
         -Dexec.args="--project=YOUR_PROJECT \
         --topic=YOUR_TOPIC \
         --messagesPerSecond=MSGS_PER_SECOND \
         --simulateAutoscaling=false

License

This project is licensed under the MIT License

mvn compile exec:java
-Dexec.mainClass=com.google.ce.demos.dataflow.abandonedcarts.producer.PublisherPubSub
-Dexec.args="--project=gricardo-brasil3
--topic=retailer-new-topic
--messagesPerSecond=10
--simulateAutoscaling=false"

About

Example code to Publish messages to a PubSub topic using sample PageView object simulating streaming from mobile devices and web browsers (Clickstream)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published