Skip to content

Commit

Permalink
update version
Browse files Browse the repository at this point in the history
  • Loading branch information
Romanow committed Jul 16, 2024
1 parent 60b8b2f commit b8b3da1
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 29 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build project
on:
push:
branches:
- master
jobs:
build:
name: Build and Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
distribution: "corretto"
java-version: "17"
cache: "gradle"

- name: Validate
uses: pre-commit/[email protected]

- name: Build project
run: ./gradlew clean build
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
.gradle/
out/
bin/
build/
build/
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: check-merge-conflict
- id: check-case-conflict

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
hooks:
- id: remove-crlf
- id: remove-tabs
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ $ docker compose up -d
> Max Disk Usage
> The System will perform scans on the disk to determine if the disk is beyond a configured limit. These are configured
> through max-disk-usage in percentage. Once that limit is reached any message will be blocked. (unless the protocol
> doesn't support flow control on which case there will be an exception thrown and the connection for those clients dropped).
> doesn't support flow control on which case there will be an exception thrown and the connection for those clients
> dropped).
## Start Java application

Expand All @@ -38,16 +39,16 @@ $ ./gradlew bootRun --args='--messaging.message="Hello, World!" --messaging.queu
```
Simple Java application for JMS messaging in Artemis
--broker-url set broker url (default [tcp://127.0.0.1:61616])
--broker-username set broker url (default [admin])
--broker-password set broker password (default [admin])
--messaging.queue-name set queue name (default 'my-queue')
--messaging.message set message text (default 'hello, world + timestamp')
--broker-url set broker url (default [tcp://127.0.0.1:61616])
--broker-username set broker url (default [admin])
--broker-password set broker password (default [admin])
--messaging.queue-name set queue name (default 'my-queue')
--messaging.message set message text (default 'hello, world + timestamp')
--messaging.properties.<key>=<value> set properties
--help print help message
--help print help message
```

## Consume from Artemis UI

Для получения сообщений из очереди через [Artemis UI](http://localhost:8161/console) -> `Queue` -> `my-queue`
-> `opeartions` -> `browse()`.
-> `opeartions` -> `browse()`.
10 changes: 3 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id "java"
id "idea"
id "org.springframework.boot" version "2.6.0"
id "io.spring.dependency-management" version "1.0.11.RELEASE"
id "org.springframework.boot" version "3.2.1"
id "io.spring.dependency-management" version "1.1.0"
}

idea {
Expand All @@ -13,7 +13,7 @@ idea {
}

ext {
mapstructVersion = "1.4.2.Final"
mapstructVersion = "1.5.9.Final"
jetbrainsAnnotationsVersion = "22.0.0"
}

Expand All @@ -38,7 +38,3 @@ test {
springBoot {
buildInfo()
}

bootJar {
archiveFileName = "${project.name}.jar"
}
13 changes: 8 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
version: "3"
services:
artemis:
image: vromero/activemq-artemis:2.16.0
image: apache/activemq-artemis:2.35.0
environment:
ARTEMIS_MIN_MEMORY: 1024M
ARTEMIS_MAX_MEMORY: 2048M
ARTEMIS_USERNAME: admin
ARTEMIS_PASSWORD: admin
ports:
- "8161:8161"
- "61616:61616"
healthcheck:
test: [ "CMD-SHELL", "/app/artemis/bin/artemis check queue --name TEST --produce 10 --browse 10 --consume 10 --url tcp://localhost:61616 --user $$ARTEMIS_USERNAME --password $$ARTEMIS_PASSWORD" ]
interval: 10s
timeout: 10s
retries: 5
volumes:
- artemis:/var/lib/artemis
- ./artemis/:/var/lib/artemis/etc-override/
- ./docker/:/var/lib/artemis/etc-override/

volumes:
artemis:
artemis:
2 changes: 1 addition & 1 deletion artemis/broker-00.xml → docker/broker-00.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
<core xmlns="urn:activemq:core" xsi:schemaLocation="urn:activemq:core ">
<max-disk-usage>100</max-disk-usage>
</core>
</configuration>
</configuration>
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = "artemis-jms"
rootProject.name = "artemis-jms"
4 changes: 1 addition & 3 deletions src/main/java/ru/romanow/jpa/JmsApplication.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ru.romanow.jpa;

import jakarta.jms.TextMessage;
import lombok.Data;
import lombok.SneakyThrows;
import org.apache.activemq.artemis.jms.client.ActiveMQQueue;
Expand All @@ -12,10 +13,8 @@
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.SimpleCommandLinePropertySource;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.jms.core.JmsTemplate;

import javax.jms.TextMessage;
import java.util.Map;

import static java.time.LocalDateTime.now;
Expand Down Expand Up @@ -91,4 +90,3 @@ public static class MessagingProperties {
private Map<String, String> properties;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
"description": "Message."
}
]
}
}
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ server:
enabled: true

messaging:
queue-name: my-queue
queue-name: my-queue

0 comments on commit b8b3da1

Please sign in to comment.