Publish commands to shopping cart Google pub/sub topic.

Overview

shopping-cart-pub-java-akka-serverless

This project is an Akka Serverless service that is used to publish shopping cart commands to a Google pub/sub topic. This service accepts commands sent via gRPC or HTTP/REST.

Designing

While designing your service it is useful to read designing services

Developing

This project has a bare-bones skeleton service ready to go, but in order to adapt and extend it it may be useful to read up on developing services and in particular the Java section

Building

You can use Maven to build your project, which will also take care of generating code based on the .proto definitions:

mvn compile

Running Locally

In order to run your application locally, you must run the Akka Serverless proxy. The included docker-compose file contains the configuration required to run the proxy for a locally running application. It also contains the configuration to start a local Google Pub/Sub emulator that the Akka Serverless proxy will connect to. To start the proxy, run the following command from this directory:

docker-compose up

On Linux this requires Docker 20.10 or later (https://github.com/moby/moby/pull/40007), or for a USER_FUNCTION_HOST environment variable to be set manually.

docker-compose -f docker-compose.yml -f docker-compose.linux.yml up

To start the application locally, the exec-maven-plugin is used. Use the following command:

mvn compile exec:exec

With both the proxy and your application running, any defined endpoints should be available at http://localhost:9000. In addition to the defined gRPC interface, each method has a corresponding HTTP endpoint. Unless configured otherwise (see Transcoding HTTP), this endpoint accepts POST requests at the path /[package].[entity name]/[method]. For example, using curl:

> curl -XPOST -H "Content-Type: application/json" localhost:9000/io.example.CounterService/GetCurrentCounter -d '{"counterId": "foo"}'
The command handler for `GetCurrentCounter` is not implemented, yet

For example, using grpcurl:

> grpcurl -plaintext -d '{"counterId": "foo"}' localhost:9000 io.example.CounterService/GetCurrentCounter 
ERROR:
  Code: Unknown
  Message: The command handler for `GetCurrentCounter` is not implemented, yet

Note: The failure is to be expected if you have not yet provided an implementation of GetCurrentCounter in your entity.

Deploying

To deploy your service, install the akkasls CLI as documented in Setting up a local development environment and configure a Docker Registry to upload your docker image to.

You will need to update the dockerImage property in the pom.xml and refer to Configuring registries for more information on how to make your docker image available to Akka Serverless.

Finally you can or use the Akka Serverless Console to create a project and then deploy your service into the project either by using mvn deploy, through the akkasls CLI or via the web interface. When using mvn deploy, Maven will also conveniently package and publish your docker image prior to deployment.

You might also like...

Make the Velocity proxy run commands based on backend input.

Command Sync Server This plugin allows the Velocity proxy to run commands based on backend input. Purpose The purpose of this is to allow easy access

May 23, 2022

CobaltStrike and Google Auth twice

CobaltStrike and Google Auth twice

GoogleAuth 基于cobaltStrike的谷歌二次验证 语言:Java 目的:实现在多人联合中的安全验证 原文:https://my.oschina.net/u/4587690/blog/5161930 开发原因:很简单,原文没有源代码。也没有jar包,不能“拿来吧你”。所以就自己写算了。

Dec 20, 2022

Sceneform React Native AR Component using ARCore and Google Filament as 3D engine. This the Sceneform Maintained Component for React Native

Sceneform React Native AR Component using ARCore and Google Filament as 3D engine. This the Sceneform Maintained Component for React Native

Discord Server Join us on Discord if you need a hand or just want to talk about Sceneform and AR. Features Remote and local assets Augmented Faces Clo

Dec 17, 2022

Share food-Android- - Food donation coded in native android with firebase, google maps api and php server xampp

Share food-Android- - Food donation coded in native android with firebase, google maps api and php server xampp

share_food-Android- Instructions: 1. Create a firebase account and link it with the project via google-services.json. 2. This project also uses a XAMP

Dec 28, 2021

Google App Engine Standard Environment Source Code for Java 8 and Java11

 Google App Engine Standard Environment Source Code for Java 8 and Java11

Google App Engine Standard Environment Source Code for Java 8 and Java11. This is a repository that contains the Java Source Code for Google App Engin

Jan 2, 2023

An app that mixes emojis using Google Emoji Kitchen API.

An app that mixes emojis using Google Emoji Kitchen API.

EmojiMixer An app that mixes emojis using Google Emoji Kitchen API mainly inspired from emojimix. The project is just broken since I'm not active anym

Aug 24, 2022

Google Gmail Extension

 Google Gmail Extension

Google Gmail Extension Extension Name: Google Gmail Description: A Non-Visible component that helps you to send mail from your App Inventor App using

Jan 20, 2022

Some recent questions asked in interviews of companies like Google, TCS, Amazon etc.

Some recent questions asked in interviews of companies like Google, TCS, Amazon etc.

Nov 21, 2022

Hate, hate, hate, for Google and its crashtastic Pixel 6 Pro.

OpenCamera hack for Pixel 6 Pro The Pixel 6 Pro is an expensive phone. There seem to be a significant number of people whose P6Ps crash -- hard -- try

Nov 11, 2022
Owner
Hugh McKee
Hugh McKee
JDA Commands is an extension for JDA to make commands easier and clearer to develop.

JDA Commands JDA Commands is an extension for JDA to make commands easier and clearer to develop. With the API you can easily create commands for the

Dominik 12 Oct 14, 2022
Java controlled pub command execution

OPIUM - Operate pub interface under machine. This package allows operating pub command with Java object only and return console context. Perquisites C

Project Will Pub 1 Jan 23, 2022
Shopping Example Application

MSA, Event Sourcing, Domain Driven Design example application written using Test-Driven Development - TDD and Inversion of Control and Dependency Injection with Quarkus written in Java

Ахунов Азат Ахматович 11 Sep 12, 2022
A high availability shopping(ecommerce) system using SpringBoot, Spring Cloud, Eureka Server, Spring Cloud Gateway, resillience4j, Kafka, Redis and MySQL.

High-availability-shopping-system A high availability shopping(ecommerce) system using SpringBoot, Spring Cloud, Eureka Server, Spring Cloud Gateway,

LeiH 1 Oct 26, 2022
The goal of this topic is learning OOP principles in Java and modifying elements in 2D arrays.

Homework #11 Table of Contents General Info Technologies Used Project Status Contact General Information Homework contains two topics: Generating rand

Mykhailo 1 Feb 2, 2022
Bank Statement Analyzer Application that currently runs in terminal with the commands: javac Application.java java Application [file-name].csv GUI coming soon...

Bank Statement Analyzer Application that currently runs in terminal with the commands: javac Application.java java Application [file-name].csv GUI coming soon...

Hayden Hanson 0 May 21, 2022
Multifunctional bot with moderation, information and utilities commands.

Module Multifunctional bot with moderation, information and utilities commands. Invite, Server. Technologies Java Spring JDA JDA-Chewtils PostgreSQL L

Headcrab 0 Dec 2, 2022
QuickShop is a shop plugin that allows players to easily sell/buy any items from a chest without any commands.

QuickShop is a shop plugin that allows players to easily sell/buy any items from a chest without any commands. In fact, none of the commands that QuickShop provides are ever needed by a player.

Ghost_chu 24 Dec 30, 2022
Z2Laser - a simple Java-based tool to convert Z movements in your G-Code files to Laser on or off commands

Z2Laser - a simple Java-based tool to convert Z movements in your G-Code files to Laser on or off commands

EOA-electronics 1 Feb 20, 2022
A Java Discord Bot Base that supports Slash Commands!

Nyjava Nyjava is a discord bot base that supports ?? Discord Slash Commands! ?? I'll see where I go with this, I might update it, I might not. Time wi

Alexandros 8 Nov 19, 2022