Skip to content

Romanow/artemis-jms

Repository files navigation

Simple JMS application

Start Artemis in Docker

$ docker compose up -d

Из-за проблемы AMQ212054 Destination address is blocked используется донастройка конфигурации Artemis: меняется параметр max-disk-usage = 100.

Описание из документации:

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).

Start Java application

$ ./gradlew clean build
$ ./gradlew bootRun

По-умолчанию приложение создает очередь my-queue и раз в 5 секунд отправляет туда сообщения вида: Hello queue world " + now().format(ISO_LOCAL_DATE_TIME)

Для задания настроек нужно в скрипт запуска передать параметры через --args='...':

$ ./gradlew bootRun --args='--messaging.message="Hello, World!" --messaging.queue-name="default-queue" --broker-url=tcp://artemis:61616'

Все доступные настройки:

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')
--messaging.properties.<key>=<value>   set properties
--help         						   print help message

Consume from Artemis UI

Для получения сообщений из очереди через Artemis UI -> Queue -> my-queue -> opeartions -> browse().

About

Example for using JMS with Spring Boot

Topics

Resources

Stars

Watchers

Forks

Languages