Code Monkey home page Code Monkey logo

pubsub-springboot-std's Introduction

Getting started on Google Cloud Platform for Java®

##This is a demo for STANDARD AppEngine and google pubsub Build Status

mvn clean install

You now need to replace YOUR_PROJECT_ID in the following files:

application.properties (appengine.projectId=YOUR_PROJECT_ID)

application-web.xml

======================

The idea, is that an appengine can send and receive messages asynchronously using GCloud pub sub.

This can then be used as a basis for microservices using multiple appengines, each with their own datastore.

To test it out: ensure you have a projectID set up in gcloud. ( To see this, type the following in your terminal )

> gcloud config list

run

> mvn gcloud:deploy

This will push the code remotely to https://.appspot.com

The project uses Swagger as the endpoint so you can open your browser at:

https://yourprojectId.appspot.com/swagger-ui.html

You can create topics and subscriptions with ease, and list them.

Once a subscription is created, then register it via /register/callback on the swagger ui.

Then click the /send/{topic}/{message} GET

So

  1. Open the pub-sub-controller (from the above link)

  2. POST /topic, and you can make this :

{
  "topicPrefix": “customTopic"
}

Hi try it out (then call GET /topic to see it’s there).

  1. open POST /register/callback

with:

{
  "callback": "https://myprojectId.appspot.com/messages/async",
  "subscriberKey": “myFirstSubscriber",
  "topicKey": “customTopic"
}

Hit try it out. This will register the subscriber for the topic = LesTopic, and call the endpoint.

  1. Finally
GET /send/{topic}/{message}

where topic = customTopic
message = HappyBirthday

Hit try it out.

The callback /messages/async will receive the message “HappyBirthday” via the pubsub cloud, and you can see this in your appengine logs !

Licensing

Java is a registered trademark of Oracle Corporation and/or its affiliates.

pubsub-springboot-std's People

Contributors

willedwards avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.