{"id":16177887,"url":"https://github.com/hifly81/quarkus-voting","last_synced_at":"2026-04-28T16:05:29.044Z","repository":{"id":68321729,"uuid":"210859529","full_name":"hifly81/quarkus-voting","owner":"hifly81","description":"An application to create polls. It is developed with quarkus, smallrye messaging and kafka","archived":false,"fork":false,"pushed_at":"2020-07-04T18:56:11.000Z","size":80,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T02:27:47.842Z","etag":null,"topics":["amq-streams","grafana-dashboard","image-debezium","infinispan","kafka","kubernetes","openshift","poll","postgres","quarkus","reactive","service-quarkus","smallrye","voting-service","zookeeper"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hifly81.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-25T14:02:23.000Z","updated_at":"2020-05-15T08:38:28.000Z","dependencies_parsed_at":"2023-02-22T23:01:24.428Z","dependency_job_id":null,"html_url":"https://github.com/hifly81/quarkus-voting","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hifly81%2Fquarkus-voting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hifly81%2Fquarkus-voting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hifly81%2Fquarkus-voting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hifly81%2Fquarkus-voting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hifly81","download_url":"https://codeload.github.com/hifly81/quarkus-voting/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246803676,"owners_count":20836610,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amq-streams","grafana-dashboard","image-debezium","infinispan","kafka","kubernetes","openshift","poll","postgres","quarkus","reactive","service-quarkus","smallrye","voting-service","zookeeper"],"created_at":"2024-10-10T05:11:04.984Z","updated_at":"2026-04-28T16:05:23.991Z","avatar_url":"https://github.com/hifly81.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Quarkus App for Polls\n=============================\n\n### Launch on OpenShift\n\nImages are downloaded from docker hub\n\nImages:\n - Postgres (image debezium/postgres) on port 5432\n - AMQ Streams (Zookeeper on port 2181 and Kafka on port 9092)\n - Voting Service on port 8080\n\nIn order to create the demo on your openshift environment, you need:\n - ocp user with cluster-admin role\n - oc client installed on your machine\n - AMQ Streams 1.x for ocp downloaded from Red Hat\u003cbr\u003e\n https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?downloadType=distributions\u0026product=jboss.amq.streams\n\nFollow these instructions to create the demo:\n\nLogin to ocp, create a new project, create e new service account runasanyuid (postgres must run as root):\n```bash\noc login \u003cocp_master_url\u003e --token=\u003cocp_user_token\u003e\noc new-project quarkus-voting\noc create serviceaccount runasanyuid\noc adm policy add-scc-to-user anyuid -z runasanyuid -n quarkus-voting\n```\n\nCreate postgres, then create voting database:\n```bash\noc new-app debezium/postgres\noc patch dc/postgres --patch '{\"spec\":{\"template\":{\"spec\":{\"serviceAccountName\": \"runasanyuid\"}}}}'\noc exec $(oc get pods | grep postgres | cut -d \" \" -f1) -- bash -c 'psql -h localhost -p 5432 -U postgres -c \"CREATE DATABASE voting;\"'\n```\n\n#### Install AMQ Streams on OpenShift 3.11\n\nInstall AMQ Streams cluster operator and a kafka cluster with 3 brokers (ephemeral and with prometheus metrics).\u003cbr\u003e\nThis step requires that you've downloaded and unpacked the AMQ Streams zip archive for ocp \u003cbr\u003e\n(for more info about the installation, https://access.redhat.com/documentation/en-us/red_hat_amq/7.2/html-single/using_amq_streams_on_openshift_container_platform/index)\n\n\n```bash\n#replace the template namespace with quarkus-voting\nsed -i 's/namespace: .*/namespace: quarkus-voting/' install/cluster-operator/*RoleBinding*.yaml\noc apply -f install/cluster-operator/020-RoleBinding-strimzi-cluster-operator.yaml -n quarkus-voting\noc apply -f install/cluster-operator/031-RoleBinding-strimzi-cluster-operator-entity-operator-delegation.yaml -n quarkus-voting\noc apply -f install/cluster-operator/032-RoleBinding-strimzi-cluster-operator-topic-operator-delegation.yaml -n quarkus-voting\noc apply -f install/cluster-operator -n quarkus-voting\noc apply -f examples/metrics/kafka-metrics.yaml\n```\n\n#### Install AMQ Streams on OpenShift 4.x\n\na) In the OpenShift 4 web console, click Operators \u003e OperatorHub.\u003cbr\u003e\nb) Search or browse for the AMQ Streams Operator, in the Streaming \u0026 Messaging category. \u003cbr\u003e\nc) Click the AMQ Streams tile and then, in the sidebar on the right, click Install.\u003cbr\u003e\nd) On the Create Operator Subscription screen, choose from the following installation and update options:\u003cbr\u003e\n   Installation Mode: Choose to install the AMQ Streams Operator to a specific (project) namespace \u003cbr\u003e\ne) Click Subscribe; the AMQ Streams Operator is installed to your OpenShift cluster.\u003cbr\u003e\n\n\nVerify that the amq-streams-cluster-operator is Running:\u003cbr\u003e\n\n```bash\noc get pods\nNAME                                                   READY     STATUS    RESTARTS   AGE\namq-streams-cluster-operator-v1.4.0-55f4b48cc6-mhckl   1/1       Running   0          56s\n```\n\nThen apply the kafka CRD:\n```bash\noc apply -f examples/metrics/kafka-metrics.yaml\n```\n\n#### Install voting microservice\n\n```bash\ncd voting/\n./mvnw clean package -Dquarkus.container-image.build=true -Dquarkus.kubernetes.deploy=true\n```\n\n#### Install prometheus and grafana\n\n```bash\nwget https://raw.githubusercontent.com/strimzi/strimzi-kafka-operator/0.10.0/metrics/examples/prometheus/kubernetes.yaml\nmv kubernetes.yaml prometheus.yaml\noc apply -f prometheus.yaml -n quarkus-voting\noc adm policy add-cluster-role-to-user prometheus -z prometheus-server\nwget https://raw.githubusercontent.com/strimzi/strimzi-kafka-operator/0.10.0/metrics/examples/grafana/kubernetes.yaml\nmv kubernetes.yaml grafana.yaml\noc apply -f grafana.yaml -n quarkus-voting\noc expose svc/grafana\n```\n\nDownload and import grafana dashboard for kafka and zookeeper, dashboard can be downloaded at:\u003cbr\u003e\nwget https://raw.githubusercontent.com/strimzi/strimzi-kafka-operator/master/metrics/examples/grafana/strimzi-kafka.json\u003cbr\u003e\nwget https://raw.githubusercontent.com/strimzi/strimzi-kafka-operator/master/metrics/examples/grafana/strimzi-zookeeper.json\n\nFollow the instruction to import the kafka and zookeeper grafana dashboards:\u003cbr\u003e\nhttps://strimzi.io/docs/latest/#grafana_dashboard\n\nImport the custom grafana dashboard for showing poll results:\n```bash\ngrafana/grafana-unconference.json\n```\n\nResults will be available at:\n\n```bash\nhttp://\u003cyour-host\u003e/poll/results\n```\n\nand on a grafana dashboard\n\n\n### Launch on local env - linux and mac\n\nLaunch the bootstrap script to create the docker containers.\u003cbr\u003e\nImages are downloaded from docker hub.\n\nImages:\n - Postgres (image debezium/postgres) on local port 5432\n - Zookeeper (image debezium/zookeeper) on local port 2181\n - Kafka (image debezium/kafka) on local port 9092\n - Jaeger (image jaegertracing/all-in-one) on local port 16686\n\nIf you want to run the voting application in dev mode use the script:\n\n```bash\n./scripts/deploy-docker-no-voting.sh\n```\n\nand then run the voting application with:\n\n```bash\ncd voting/\n./mvnw clean compile quarkus:dev (debug port 5005)\n```\n\nTo test the application run:\n```bash\ncd voting/\nmvn clean compile test\n```\n\n\n### Endpoints\n\nTest them with swagger, available at:\n```bash\nhttp://\u003cyour-host\u003e/swagger-ui\nhttp://\u003cyour-host\u003e/openapi\n```\n\n\n### Jaeger\n\nSee tracing at:\u003cbr\u003e\n```bash\nhttp://\u003cyour-host\u003e:16686\n```\n\n\n### Compile and Create Images\n\nLaunch the script to compile and create the native images:\n\n```bash\n./scripts/build-native-image.sh\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhifly81%2Fquarkus-voting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhifly81%2Fquarkus-voting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhifly81%2Fquarkus-voting/lists"}