diff --git a/.drone/Dockerfile b/.drone/Dockerfile deleted file mode 100644 index e864726..0000000 --- a/.drone/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -ARG BASE_IMAGE - -FROM $BASE_IMAGE - -LABEL maintainer="dev@ujar.org" -ARG BUILD_VERSION -ENV APPLICATION_BUILD_VERSION ${BUILD_VERSION} - -WORKDIR /opt/app - -COPY ./target/*.jar /opt/app/app.jar - -ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -Duser.timezone=UTC -jar /opt/app/app.jar"] -EXPOSE 8080 diff --git a/.drone/pipelines.yml b/.drone/pipelines.yml deleted file mode 100644 index ecbcb4e..0000000 --- a/.drone/pipelines.yml +++ /dev/null @@ -1,447 +0,0 @@ -kind : pipeline -name : CodeVerification -type : docker - -trigger : - event : - - push - - tag - -volumes : - - name : m2cache - host : - path : /app/.m2 - -steps : - - - name : code-coverage-gate - image : know-how.download/svc-builder:openjdk-21-slim-bookworm - pull : if-not-exists - volumes : - - name : m2cache - path : /root/.m2 - environment : - RABBITMQ_HOST : rabbitmq - DEPLOYER_USERNAME : - from_secret : DEPLOYER_USERNAME - DEPLOYER_PASSWORD : - from_secret : DEPLOYER_PASSWORD - commands : - - mvn -version - - mvn dependency:resolve -s ../maven-settings.xml -Ddeployer.username=$DEPLOYER_USERNAME -Ddeployer.password=$DEPLOYER_PASSWORD - - mvn clean verify -Dstyle.color=always -Dmaven.javadoc.skip=true -s ../maven-settings.xml -Ddeployer.username=$DEPLOYER_USERNAME -Ddeployer.password=$DEPLOYER_PASSWORD - - - name : static-analysis-gate - depends_on : - - code-coverage-gate - image : know-how.download/svc-builder:openjdk-21-slim-bookworm - pull : if-not-exists - volumes : - - name : m2cache - path : /root/.m2 - environment : - DEPLOYER_USERNAME : - from_secret : DEPLOYER_USERNAME - DEPLOYER_PASSWORD : - from_secret : DEPLOYER_PASSWORD - SONAR_HOST : - from_secret : SONAR_HOST - SONAR_TOKEN : - from_secret : SONAR_TOKEN - commands : - - mvn org.apache.maven.plugins:maven-dependency-plugin:3.5.0:copy-dependencies -Dmdep.prependGroupId=true -Dstyle.color=always -s ../maven-settings.xml -Ddeployer.username=$DEPLOYER_USERNAME -Ddeployer.password=$DEPLOYER_PASSWORD - - mvn sonar:sonar '-Dsonar.java.libraries=target/dependency/*.jar' '-Dsonar.java.test.libraries=target/classes,target/dependency/*.jar' -Dsonar.qualitygate.wait=true -Dsonar.qualitygate.timeout=300 -Dsonar.host.url=$SONAR_HOST -Dsonar.login=$SONAR_TOKEN -Dsonar.projectKey=${DRONE_REPO_OWNER}:${DRONE_REPO_NAME} -Dsonar.projectName=${DRONE_REPO_OWNER}:${DRONE_REPO_NAME} -Dstyle.color=always -Dmaven.javadoc.skip=true --batch-mode -s ../maven-settings.xml -Ddeployer.username=$DEPLOYER_USERNAME -Ddeployer.password=$DEPLOYER_PASSWORD - - pmd check -d src -f text -R https://raw.githubusercontent.com/pmd/pmd/master/pmd-java/src/main/resources/rulesets/java/basic.xml - - mvn com.github.spotbugs:spotbugs-maven-plugin:4.7.3.4:check -s ../maven-settings.xml -Ddeployer.username=$DEPLOYER_USERNAME -Ddeployer.password=$DEPLOYER_PASSWORD -Dspotbugs.xmlOutput=true -Dspotbugs.failOnError=true -Dspotbugs.excludeFilterFile=../spotbugs-exclude.xml -Dspotbugs.includeTests=true -Dstyle.color=always - - - name : notify-slack-on-failure - image : plugins/slack - settings : - webhook : - from_secret : SLACK_WEBHOOK - channel : dev - template : > - :red_circle: :thunder_cloud_and_rain: {{build.link}} ({{build.branch}}) by {{build.author}} - when : - status : - - failure - depends_on : - - code-coverage-gate - - static-analysis-gate - - -services : - - name : rabbitmq - image : rabbitmq:3.12-management-alpine - environment : - RABBITMQ_DEFAULT_USER : svc_testing - RABBITMQ_DEFAULT_PASS : svc_testing - ---- - -kind : pipeline -name : ArtifactsPublishing -type : docker - -trigger : - event : - - push - - tag - ref : - - refs/heads/develop - - refs/heads/prerelease* - - refs/heads/*.*.x - - refs/tags/* - -depends_on : - - CodeVerification - -volumes : - - name : m2cache - host : - path : /app/.m2 - -steps : - - name : publish-snapshot-jar - image : know-how.download/svc-builder:openjdk-21-slim-bookworm - volumes : - - name : m2cache - path : /root/.m2 - environment : - DEPLOYER_USERNAME : - from_secret : DEPLOYER_USERNAME - DEPLOYER_PASSWORD : - from_secret : DEPLOYER_PASSWORD - commands : - - mvn deploy -Dstyle.color=always -DskipTests -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -s ../maven-settings.xml -Ddeployer.username=$DEPLOYER_USERNAME -Ddeployer.password=$DEPLOYER_PASSWORD -DaltDeploymentRepository=kh-contrib-snapshots-repo::https://know-how.nexus/repository/maven-snapshots - when : - branch : - include : - - "develop" - - "prerelease/*" - - "*.*.x" - - - name : publish-release-jar - image : know-how.download/svc-builder:openjdk-21-slim-bookworm - pull : if-not-exists - volumes : - - name : m2cache - path : /root/.m2 - environment : - DEPLOYER_USERNAME : - from_secret : DEPLOYER_USERNAME - DEPLOYER_PASSWORD : - from_secret : DEPLOYER_PASSWORD - commands : - - mvn deploy -Dstyle.color=always -DskipTests -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -s ../maven-settings.xml -Ddeployer.username=$DEPLOYER_USERNAME -Ddeployer.password=$DEPLOYER_PASSWORD -DaltDeploymentRepository=kh-contrib-releases-repo::https://know-how.nexus/repository/maven-releases - when : - ref : - - "refs/tags/*" - - - name : create-github-release - image : plugins/github-release - settings : - api_key : - from_secret : GITHUB_API_KEY - title : ${DRONE_TAG} - note : "**Full Changelog**: https://github.com/${DRONE_REPO}/commits/${DRONE_TAG}" - files : ./target/*.jar - when : - ref : - - "refs/tags/*" - depends_on : - - publish-release-jar - - - name : notify-slack - image : plugins/slack - settings : - webhook : - from_secret : SLACK_WEBHOOK - channel : dev - template : > - {{#success build.status}} - :large_green_circle: :package: *${DRONE_COMMIT_MESSAGE}* - {{build.link}} ({{build.branch}}) by {{build.author}} - {{else}} - :red_circle: :package: {{build.link}} ({{build.branch}}) by {{build.author}} - {{/success}} - when : - status : - - failure - - success - depends_on : - - publish-snapshot-jar - - publish-release-jar ---- - -kind : pipeline -name : DockerImagePublishing -type : docker - -trigger : - event : - - push - - tag - -depends_on : - - ArtifactsPublishing - -volumes : - - name : m2cache - host : - path : /app/.m2 - -steps : - - name : package-jar - image : know-how.download/svc-builder:openjdk-21-slim-bookworm - pull : if-not-exists - volumes : - - name : m2cache - path : /root/.m2 - environment : - DEPLOYER_USERNAME : - from_secret : DEPLOYER_USERNAME - DEPLOYER_PASSWORD : - from_secret : DEPLOYER_PASSWORD - commands : - - mvn package -Dstyle.color=always -DskipTests -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true --batch-mode -s ../maven-settings.xml -Ddeployer.username=$DEPLOYER_USERNAME -Ddeployer.password=$DEPLOYER_PASSWORD - - - name : build-container-with-feature - depends_on : - - package-jar - image : plugins/docker - settings : - dockerfile : ./.drone/Dockerfile - context : ./ - storage_driver : vfs - username : - from_secret : DOCKER_USERNAME - password : - from_secret : DOCKER_PASSWORD - repo : know-how.download/${DRONE_REPO_OWNER}/quickstart-amqp-consuming-hello - registry : know-how.download - force_tag : true - build_args : - - BASE_IMAGE=know-how.download/jre:openjdk-21-slim-bookworm - - BUILD_VERSION=${DRONE_COMMIT} - tags : - - ${DRONE_BRANCH:22}-${CI_BUILD_NUMBER} - when : - branch : - include : - - "feature/containerized-*" - - - name : build-container-release-image - depends_on : - - package-jar - image : plugins/docker - settings : - dockerfile : ./.drone/Dockerfile - context : ./ - storage_driver : vfs - username : - from_secret : DOCKER_USERNAME - password : - from_secret : DOCKER_PASSWORD - repo : know-how.download/${DRONE_REPO_OWNER}/quickstart-amqp-consuming-hello - registry : know-how.download - force_tag : true - build_args : - - BASE_IMAGE=know-how.download/jre:openjdk-21-slim-bookworm - - BUILD_VERSION=${DRONE_COMMIT} - tags : - - ${DRONE_TAG} - - "latest" - when : - ref : - - "refs/tags/*" - ---- - -kind : pipeline -name : PromoteFeatureDeployment -type : docker -trigger : - event : - - promote - target : - - sit - ref : - - "refs/heads/feature/containerized-*" - -steps : - - name : deploy - image : know-how.download/svc-builder:openjdk-21-slim-bookworm - pull : if-not-exists - environment : - HELM_CHARTS_REPOSITORY : - from_secret : HELM_CHARTS_REPOSITORY - commands : - - git clone $${HELM_CHARTS_REPOSITORY} charts && cd charts/${DRONE_REPO_NAME} - - kubectl version --output=yaml - - helm upgrade --install --atomic --wait --timeout 2m ${DRONE_REPO_NAME} ./ --values ./values.yaml --values ./${DRONE_DEPLOY_TO}-values.yaml --set image.tag=${DRONE_BRANCH:22}-${CI_PARENT_BUILD_NUMBER} -n ${DRONE_DEPLOY_TO}-env - - - name : notify-slack - image : plugins/slack - settings : - webhook : - from_secret : SLACK_WEBHOOK - channel : dev - template : > - {{#success build.status}} - :large_green_circle: :ship: *${DRONE_COMMIT_MESSAGE}* - {{build.link}} ({{build.branch}}) by {{build.author}} - {{else}} - :red_circle: :anchor: {{build.link}} ({{build.branch}}) by {{build.author}} - {{/success}} - when : - status : - - failure - - success - depends_on : - - deploy ---- - -kind : pipeline -name : RollbackFeatureDeployment -type : docker -trigger : - event : - - rollback - target : - - sit - ref : - - "refs/heads/feature/containerized-*" - -steps : - - name : rollback - image : know-how.download/svc-builder:openjdk-21-slim-bookworm - pull : if-not-exists - environment : - HELM_CHARTS_REPOSITORY : - from_secret : HELM_CHARTS_REPOSITORY - commands : - - git clone $${HELM_CHARTS_REPOSITORY} charts && cd charts/${DRONE_REPO_NAME} - - helm uninstall --wait --timeout 2m ${DRONE_REPO_NAME} -n ${DRONE_DEPLOY_TO}-env - ---- - -kind : pipeline -name : PromoteDeployment -type : docker -trigger : - event : - - promote - target : - - uat - - production - ref : - - "refs/tags/*" - -steps : - - name : deploy - image : know-how.download/svc-builder:openjdk-21-slim-bookworm - pull : if-not-exists - environment : - HELM_CHARTS_REPOSITORY : - from_secret : HELM_CHARTS_REPOSITORY - commands : - - git clone $${HELM_CHARTS_REPOSITORY} charts && cd charts/${DRONE_REPO_NAME} - - kubectl version --output=yaml - - helm upgrade --install --atomic --wait --timeout 2m ${DRONE_REPO_NAME} ./ --values ./values.yaml --values ./${DRONE_DEPLOY_TO}-values.yaml --set image.tag=${DRONE_TAG} -n ${DRONE_DEPLOY_TO}-env - - - name : notify-slack - image : plugins/slack - settings : - webhook : - from_secret : SLACK_WEBHOOK - channel : dev - template : > - {{#success build.status}} - :large_green_circle: :ship: *${DRONE_COMMIT_MESSAGE}* - {{build.link}} ({{build.branch}}) by {{build.author}} - {{else}} - :red_circle: :anchor: {{build.link}} ({{build.branch}}) by {{build.author}} - {{/success}} - when : - status : - - failure - - success - depends_on : - - deploy - ---- - -kind : pipeline -name : RollbackDeployment -type : docker -trigger : - event : - - rollback - target : - - uat - - production - ref : - - "refs/tags/*" - -steps : - - name : rollback - image : know-how.download/svc-builder:openjdk-21-slim-bookworm - pull : if-not-exists - environment : - HELM_CHARTS_REPOSITORY : - from_secret : HELM_CHARTS_REPOSITORY - commands : - - git clone $${HELM_CHARTS_REPOSITORY} charts && cd charts/${DRONE_REPO_NAME} - - helm uninstall --wait --timeout 2m ${DRONE_REPO_NAME} -n ${DRONE_DEPLOY_TO}-env - ---- - -kind : pipeline -name : ManualRelease -type : docker -trigger : - event : - - custom - branch : - - "develop" - - "*.*.x" - -volumes : - - name : m2cache - host : - path : /app/.m2 - -steps : - - name : create-release-tag - failure : ignore - image : know-how.download/svc-builder:openjdk-21-slim-bookworm - pull : if-not-exists - volumes : - - name : m2cache - path : /root/.m2 - commands : - - echo Prepare new version ${RELEASE_VERSION} - - export NEXT_SNAPSHOT=${SNAPSHOT_VERSION}-SNAPSHOT - - export GIT_AUTHOR_NAME="$${SVC_BUILD_GIT_USERNAME}" - - export GIT_AUTHOR_EMAIL=$${SVC_BUILD_GIT_EMAIL} - - export GIT_COMMITTER_NAME="$${SVC_BUILD_GIT_USERNAME}" - - export GIT_COMMITTER_EMAIL=$${SVC_BUILD_GIT_EMAIL} - - git remote set-url --push origin ${DRONE_GIT_SSH_URL} - - git checkout -b v${RELEASE_VERSION} - - mvn versions:set -DremoveSnapshot - - mvn versions:set -DnewVersion=${RELEASE_VERSION} - - mvn versions:update-parent - - >- - git commit -a -m "feat: bump version to $${RELEASE_VERSION}" - - git tag ${RELEASE_VERSION} && git push origin ${RELEASE_VERSION} - - echo "✅ Release tag ${RELEASE_VERSION} was created." - - sleep 10 - - git tag -d ${RELEASE_VERSION} && git checkout ${DRONE_COMMIT_BRANCH} && git branch -D v${RELEASE_VERSION} - - mvn versions:set -DnewVersion=$${NEXT_SNAPSHOT} - - mvn versions:update-parent -DallowSnapshots=true - - >- - git commit -a -m "feat: create new $${NEXT_SNAPSHOT}" - - git push origin ${DRONE_COMMIT_BRANCH} - - echo "✅ Started $${NEXT_SNAPSHOT}." - - echo "🚀 Good job, new version ${RELEASE_VERSION} was released successfully." diff --git a/.github/workflows/check-commit-message.yml b/.github/workflows/check-commit-message.yml index 0647443..96396e9 100644 --- a/.github/workflows/check-commit-message.yml +++ b/.github/workflows/check-commit-message.yml @@ -9,7 +9,7 @@ on : - synchronize push : branches : - - "develop" + - "dev" - "feature/*" - "bugfix/*" - "improvement/*" @@ -28,7 +28,7 @@ jobs : with : pattern : '^(feat|fix|docs|style|refactor|perf|test|chore|build)(.+?)?: .+' flags : 'gm' - error : 'Your commit title did not follow semantic versioning. Please see https://github.com/uJarOrg/.github/blob/develop/SEMANTIC_COMMITS.md' + error : 'Your commit title did not follow semantic versioning. Please see https://github.com/IQKV/.github/blob/dev/SEMANTIC_COMMITS.md' - name : Check Line Length uses : gsactions/commit-message-checker@v2 with : diff --git a/.husky/pre-commit b/.husky/pre-commit index 1bffa43..c1344cb 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -2,7 +2,7 @@ current_branch=$(git rev-parse --abbrev-ref HEAD) -main_branch="(main|master|develop)" +main_branch="(main|master|dev|develop)" if [[ $current_branch =~ $main_branch ]]; then echo -e "\033[1;31m[ERROR] Please don't commit directly to $current_branch.\033[0m"; exit 1 diff --git a/README.md b/README.md index 95d26d0..be4a769 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Minimal Spring Boot based sample AMQP consumer app. - Clone source code to the local machine: ``` -git clone https://github.com/uJarOrg/quickstart-amqp-consuming-hello.git +git clone https://github.com/KnowHowSpringBoot/quickstart-amqp-consuming-hello.git cd quickstart-amqp-consuming-hello ``` diff --git a/SEMANTIC_COMMITS.md b/SEMANTIC_COMMITS.md deleted file mode 100644 index bc1b47c..0000000 --- a/SEMANTIC_COMMITS.md +++ /dev/null @@ -1,35 +0,0 @@ -# Semantic Commit Messages - -See how a minor change to your commit message style can make you a better programmer. - -Format: `(): ` - -`` is optional - -## Example - -``` -feat: add hat wobble -^--^ ^------------^ -| | -| +-> Summary in present tense. -| -+-------> Type: chore, docs, feat, fix, refactor, style, or test. -``` - -More Examples: - -- `feat`: (new feature for the user, not a new feature for build script) -- `fix`: (bug fix for the user, not a fix to a build script) -- `docs`: (changes to the documentation) -- `style`: (formatting, missing semi colons, etc; no production code change) -- `refactor`: (refactoring production code, eg. renaming a variable) -- `test`: (adding missing tests, refactoring tests; no production code change) -- `chore`: (updating grunt tasks etc; no production code change) - -References: - -- https://www.conventionalcommits.org/ -- https://seesparkbox.com/foundry/semantic_commit_messages -- http://karma-runner.github.io/1.0/dev/git-commit-msg.html - diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 1e837c7..8368b10 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -1,4 +1,4 @@ -# This configuration is intended for development purpose +# This configuration is intended for dev purpose version : '3.8' services : rabbitmq : diff --git a/package.json b/package.json index d2c131e..65cc4e3 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "quickstart-amqp-consuming-hello", + "name": "know-how-spring-boot-quickstart-amqp-consuming-hello", "version": "23.0.0", "description": "Provide an optional Git commit hooks.", "private": true, diff --git a/pom.xml b/pom.xml index 5cce35c..defc1db 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - org.ujar + dev.knowhowto.sb quickstart-amqp-consuming-hello 23.0.0-SNAPSHOT jar @@ -18,12 +18,12 @@ - uJar Bootcamp - https://www.ujar.org + KnowHowSpringBoot Bootcamp + https://knowhowto.dev - 1 + dimdnk Dima Denysenko coding@dimdnk.com @@ -33,7 +33,7 @@ - org.ujar.boot + dev.knowhowto.boot boot-parent-pom 23.0.0-SNAPSHOT @@ -46,16 +46,16 @@ **/*Config*.java,**/*Properties.java,**/*Test.java,**/Test*.java false false - org.ujar.amqpconsuminghello.AmqpConsumingHelloApplication + dev.knowhowto.amqpconsuminghello.AmqpConsumingHelloApplication - org.ujar.boot + dev.knowhowto.boot boot-starter-amqp - org.ujar.boot + dev.knowhowto.boot boot-starter-observability diff --git a/src/main/docker/prometheus/prometheus.yml b/src/main/docker/prometheus/prometheus.yml index 462f09f..2696564 100644 --- a/src/main/docker/prometheus/prometheus.yml +++ b/src/main/docker/prometheus/prometheus.yml @@ -1,4 +1,4 @@ -# Sample global config for monitoring uJar applications +# Sample global config for monitoring KnowHowSpringBoot applications global : scrape_interval : 15s # By default, scrape targets every 15 seconds. evaluation_interval : 15s # By default, scrape targets every 15 seconds. @@ -7,7 +7,7 @@ global : # Attach these labels to any time series or alerts when communicating with # external systems (federation, remote storage, Alertmanager). external_labels : - monitor : 'ujar' + monitor : 'knowhowto' # A scrape configuration containing exactly one endpoint to scrape: # Here it's Prometheus itself. diff --git a/src/main/java/org/ujar/amqpconsuminghello/AmqpConsumingHelloApplication.java b/src/main/java/dev/knowhowto/amqpconsuminghello/AmqpConsumingHelloApplication.java similarity index 92% rename from src/main/java/org/ujar/amqpconsuminghello/AmqpConsumingHelloApplication.java rename to src/main/java/dev/knowhowto/amqpconsuminghello/AmqpConsumingHelloApplication.java index ceaa092..34c5f59 100644 --- a/src/main/java/org/ujar/amqpconsuminghello/AmqpConsumingHelloApplication.java +++ b/src/main/java/dev/knowhowto/amqpconsuminghello/AmqpConsumingHelloApplication.java @@ -1,4 +1,4 @@ -package org.ujar.amqpconsuminghello; +package dev.knowhowto.amqpconsuminghello; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/src/main/java/org/ujar/amqpconsuminghello/config/AmqpConfiguration.java b/src/main/java/dev/knowhowto/amqpconsuminghello/config/AmqpConfiguration.java similarity index 96% rename from src/main/java/org/ujar/amqpconsuminghello/config/AmqpConfiguration.java rename to src/main/java/dev/knowhowto/amqpconsuminghello/config/AmqpConfiguration.java index fe25039..f504938 100644 --- a/src/main/java/org/ujar/amqpconsuminghello/config/AmqpConfiguration.java +++ b/src/main/java/dev/knowhowto/amqpconsuminghello/config/AmqpConfiguration.java @@ -1,4 +1,4 @@ -package org.ujar.amqpconsuminghello.config; +package dev.knowhowto.amqpconsuminghello.config; import lombok.RequiredArgsConstructor; import org.springframework.amqp.core.AmqpAdmin; diff --git a/src/main/java/org/ujar/amqpconsuminghello/config/AmqpConsumingConfig.java b/src/main/java/dev/knowhowto/amqpconsuminghello/config/AmqpConsumingConfig.java similarity index 91% rename from src/main/java/org/ujar/amqpconsuminghello/config/AmqpConsumingConfig.java rename to src/main/java/dev/knowhowto/amqpconsuminghello/config/AmqpConsumingConfig.java index 71c08a4..86e4dd2 100644 --- a/src/main/java/org/ujar/amqpconsuminghello/config/AmqpConsumingConfig.java +++ b/src/main/java/dev/knowhowto/amqpconsuminghello/config/AmqpConsumingConfig.java @@ -1,5 +1,6 @@ -package org.ujar.amqpconsuminghello.config; +package dev.knowhowto.amqpconsuminghello.config; +import dev.knowhowto.amqpconsuminghello.consumer.GreetingMessageConsumer; import lombok.RequiredArgsConstructor; import org.springframework.amqp.core.AcknowledgeMode; import org.springframework.amqp.rabbit.connection.ConnectionFactory; @@ -7,7 +8,6 @@ import org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.ujar.amqpconsuminghello.consumer.GreetingMessageConsumer; @Configuration @RequiredArgsConstructor diff --git a/src/main/java/org/ujar/amqpconsuminghello/config/AmqpQueuesProperties.java b/src/main/java/dev/knowhowto/amqpconsuminghello/config/AmqpQueuesProperties.java similarity index 77% rename from src/main/java/org/ujar/amqpconsuminghello/config/AmqpQueuesProperties.java rename to src/main/java/dev/knowhowto/amqpconsuminghello/config/AmqpQueuesProperties.java index 39ed148..fdcc6b6 100644 --- a/src/main/java/org/ujar/amqpconsuminghello/config/AmqpQueuesProperties.java +++ b/src/main/java/dev/knowhowto/amqpconsuminghello/config/AmqpQueuesProperties.java @@ -1,10 +1,10 @@ -package org.ujar.amqpconsuminghello.config; +package dev.knowhowto.amqpconsuminghello.config; import jakarta.validation.constraints.NotNull; import org.springframework.boot.context.properties.ConfigurationProperties; -@ConfigurationProperties(prefix = "ujar.amqp.queues") +@ConfigurationProperties(prefix = "knowhowto.amqp.queues") public record AmqpQueuesProperties(@NotNull String greeterExchange, @NotNull String greeterQueue) { public String getGreeterExchange() { diff --git a/src/main/java/org/ujar/amqpconsuminghello/config/ApplicationConfig.java b/src/main/java/dev/knowhowto/amqpconsuminghello/config/ApplicationConfig.java similarity index 87% rename from src/main/java/org/ujar/amqpconsuminghello/config/ApplicationConfig.java rename to src/main/java/dev/knowhowto/amqpconsuminghello/config/ApplicationConfig.java index f0e32ba..dccbb62 100644 --- a/src/main/java/org/ujar/amqpconsuminghello/config/ApplicationConfig.java +++ b/src/main/java/dev/knowhowto/amqpconsuminghello/config/ApplicationConfig.java @@ -1,4 +1,4 @@ -package org.ujar.amqpconsuminghello.config; +package dev.knowhowto.amqpconsuminghello.config; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Configuration; diff --git a/src/main/java/org/ujar/amqpconsuminghello/config/WebSecurityConfig.java b/src/main/java/dev/knowhowto/amqpconsuminghello/config/WebSecurityConfig.java similarity index 92% rename from src/main/java/org/ujar/amqpconsuminghello/config/WebSecurityConfig.java rename to src/main/java/dev/knowhowto/amqpconsuminghello/config/WebSecurityConfig.java index f583db9..80cbfe7 100644 --- a/src/main/java/org/ujar/amqpconsuminghello/config/WebSecurityConfig.java +++ b/src/main/java/dev/knowhowto/amqpconsuminghello/config/WebSecurityConfig.java @@ -1,4 +1,4 @@ -package org.ujar.amqpconsuminghello.config; +package dev.knowhowto.amqpconsuminghello.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/src/main/java/org/ujar/amqpconsuminghello/consumer/GreetingMessageConsumer.java b/src/main/java/dev/knowhowto/amqpconsuminghello/consumer/GreetingMessageConsumer.java similarity index 85% rename from src/main/java/org/ujar/amqpconsuminghello/consumer/GreetingMessageConsumer.java rename to src/main/java/dev/knowhowto/amqpconsuminghello/consumer/GreetingMessageConsumer.java index f465845..7339ec6 100644 --- a/src/main/java/org/ujar/amqpconsuminghello/consumer/GreetingMessageConsumer.java +++ b/src/main/java/dev/knowhowto/amqpconsuminghello/consumer/GreetingMessageConsumer.java @@ -1,12 +1,12 @@ -package org.ujar.amqpconsuminghello.consumer; +package dev.knowhowto.amqpconsuminghello.consumer; import java.util.concurrent.CountDownLatch; +import dev.knowhowto.amqpconsuminghello.model.Greeting; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; -import org.ujar.amqpconsuminghello.model.Greeting; @Component @RequiredArgsConstructor diff --git a/src/main/java/org/ujar/amqpconsuminghello/model/Greeting.java b/src/main/java/dev/knowhowto/amqpconsuminghello/model/Greeting.java similarity index 79% rename from src/main/java/org/ujar/amqpconsuminghello/model/Greeting.java rename to src/main/java/dev/knowhowto/amqpconsuminghello/model/Greeting.java index a2325d6..cfb3221 100644 --- a/src/main/java/org/ujar/amqpconsuminghello/model/Greeting.java +++ b/src/main/java/dev/knowhowto/amqpconsuminghello/model/Greeting.java @@ -1,4 +1,4 @@ -package org.ujar.amqpconsuminghello.model; +package dev.knowhowto.amqpconsuminghello.model; import java.io.Serial; import java.io.Serializable; diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index 4ea67c7..672a82c 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -9,7 +9,7 @@ management : endpoints : enabled-by-default : true -ujar : +knowhowto : amqp : queues : greeter-exchange : greeter-exchange diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 252af66..0061ad5 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -22,10 +22,6 @@ spring : port : ${RABBITMQ_PORT:5672} username : ${RABBITMQ_USERNAME:svc_testing} password : ${RABBITMQ_PASSWORD:svc_testing} - amqp : - deserialization : - trust : - all : true devtools : add-properties : false restart : @@ -109,7 +105,7 @@ embedded : enabled : false reuse-container : true -ujar : +knowhowto : build : description : '@project.description@' relative-path : ${SERVER_SERVLET_CONTEXT_PATH:/} diff --git a/src/test/java/org/ujar/amqpconsuminghello/AmqpConsumingHelloApplicationIT.java b/src/test/java/dev/knowhowto/amqpconsuminghello/AmqpConsumingHelloApplicationIT.java similarity index 90% rename from src/test/java/org/ujar/amqpconsuminghello/AmqpConsumingHelloApplicationIT.java rename to src/test/java/dev/knowhowto/amqpconsuminghello/AmqpConsumingHelloApplicationIT.java index b92ee90..60a4b57 100644 --- a/src/test/java/org/ujar/amqpconsuminghello/AmqpConsumingHelloApplicationIT.java +++ b/src/test/java/dev/knowhowto/amqpconsuminghello/AmqpConsumingHelloApplicationIT.java @@ -1,4 +1,4 @@ -package org.ujar.amqpconsuminghello; +package dev.knowhowto.amqpconsuminghello; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/ujar/amqpconsuminghello/consumer/GreetingMessageConsumerIT.java b/src/test/java/dev/knowhowto/amqpconsuminghello/consumer/GreetingMessageConsumerIT.java similarity index 85% rename from src/test/java/org/ujar/amqpconsuminghello/consumer/GreetingMessageConsumerIT.java rename to src/test/java/dev/knowhowto/amqpconsuminghello/consumer/GreetingMessageConsumerIT.java index d076335..21804a1 100644 --- a/src/test/java/org/ujar/amqpconsuminghello/consumer/GreetingMessageConsumerIT.java +++ b/src/test/java/dev/knowhowto/amqpconsuminghello/consumer/GreetingMessageConsumerIT.java @@ -1,4 +1,4 @@ -package org.ujar.amqpconsuminghello.consumer; +package dev.knowhowto.amqpconsuminghello.consumer; import static org.assertj.core.api.Assertions.assertThat; @@ -6,12 +6,12 @@ import java.util.concurrent.TimeUnit; +import dev.knowhowto.amqpconsuminghello.model.Greeting; +import dev.knowhowto.amqpconsuminghello.producer.GreetingMessageProducer; import org.hamcrest.MatcherAssert; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.ujar.amqpconsuminghello.model.Greeting; -import org.ujar.amqpconsuminghello.producer.GreetingMessageProducer; @SpringBootTest class GreetingMessageConsumerIT { diff --git a/src/test/java/org/ujar/amqpconsuminghello/producer/GreetingMessageProducer.java b/src/test/java/dev/knowhowto/amqpconsuminghello/producer/GreetingMessageProducer.java similarity index 76% rename from src/test/java/org/ujar/amqpconsuminghello/producer/GreetingMessageProducer.java rename to src/test/java/dev/knowhowto/amqpconsuminghello/producer/GreetingMessageProducer.java index 11a715d..94c36f7 100644 --- a/src/test/java/org/ujar/amqpconsuminghello/producer/GreetingMessageProducer.java +++ b/src/test/java/dev/knowhowto/amqpconsuminghello/producer/GreetingMessageProducer.java @@ -1,11 +1,11 @@ -package org.ujar.amqpconsuminghello.producer; +package dev.knowhowto.amqpconsuminghello.producer; +import dev.knowhowto.amqpconsuminghello.config.AmqpQueuesProperties; +import dev.knowhowto.amqpconsuminghello.model.Greeting; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.stereotype.Component; -import org.ujar.amqpconsuminghello.config.AmqpQueuesProperties; -import org.ujar.amqpconsuminghello.model.Greeting; @Component @Slf4j diff --git a/src/test/resources/application.yml b/src/test/resources/application.yml index 5af1478..9eca0fd 100644 --- a/src/test/resources/application.yml +++ b/src/test/resources/application.yml @@ -18,7 +18,7 @@ embedded : enabled : true reuse-container : true -ujar : +knowhowto : build : description : '@project.description@' relative-path : '/'