spring-amqp-utils

Provides some utility-methods to simplify the use of Spring Amqp

Лицензия

Лицензия

Категории

Категории

IDE Инструменты разработки
Группа

Группа

com.avides.spring
Идентификатор

Идентификатор

spring-amqp-utils
Последняя версия

Последняя версия

1.0.1.RELEASE
Дата

Дата

Тип

Тип

jar
Описание

Описание

spring-amqp-utils
Provides some utility-methods to simplify the use of Spring Amqp
Ссылка на сайт

Ссылка на сайт

https://github.com/avides/spring-amqp-utils
Организация-разработчик

Организация-разработчик

AVIDES Media AG
Система контроля версий

Система контроля версий

https://github.com/avides/spring-amqp-utils

Скачать spring-amqp-utils

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.avides.spring/spring-amqp-utils/ -->
<dependency>
    <groupId>com.avides.spring</groupId>
    <artifactId>spring-amqp-utils</artifactId>
    <version>1.0.1.RELEASE</version>
</dependency>
// https://jarcasting.com/artifacts/com.avides.spring/spring-amqp-utils/
implementation 'com.avides.spring:spring-amqp-utils:1.0.1.RELEASE'
// https://jarcasting.com/artifacts/com.avides.spring/spring-amqp-utils/
implementation ("com.avides.spring:spring-amqp-utils:1.0.1.RELEASE")
'com.avides.spring:spring-amqp-utils:jar:1.0.1.RELEASE'
<dependency org="com.avides.spring" name="spring-amqp-utils" rev="1.0.1.RELEASE">
  <artifact name="spring-amqp-utils" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.avides.spring', module='spring-amqp-utils', version='1.0.1.RELEASE')
)
libraryDependencies += "com.avides.spring" % "spring-amqp-utils" % "1.0.1.RELEASE"
[com.avides.spring/spring-amqp-utils "1.0.1.RELEASE"]

Зависимости

provided (1)

Идентификатор библиотеки Тип Версия
org.springframework.amqp : spring-amqp jar 2.0.0.RELEASE

test (2)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
org.assertj : assertj-core jar 3.8.0

Модули Проекта

Данный проект не имеет модулей.

spring-amqp-utils

Maven Central Codacy Badge Coverage Status Build Status

Maven

<dependency>
    <groupId>com.avides.spring</groupId>
    <artifactId>spring-amqp-utils</artifactId>
    <version>1.0.1.RELEASE</version>
</dependency>

Available methods

AmpqUtils.buildDurableQueueWithDlx(String queueName, AmqpAdmin adminThatShouldDeclare)
AmpqUtils.buildDurableQueueWithDlx(String queueName, AmqpAdmin adminThatShouldDeclare, AmqpAdmin... furtherAdminsThatShouldDeclare)

AmpqUtils.buildDurableQueueWithDlxArguments(String queueName, AmqpAdmin adminThatShouldDeclare)
AmpqUtils.buildDurableQueueWithDlxArguments(String queueName, AmqpAdmin adminThatShouldDeclare, AmqpAdmin... furtherAdminsThatShouldDeclare)

AmpqUtils.buildDurableDlxQueueFor(Queue queue)
AmpqUtils.buildDurableDlxQueueFor(String queueName, AmqpAdmin adminThatShouldDeclare)
AmpqUtils.buildDurableDlxQueueFor(String queueName, AmqpAdmin adminThatShouldDeclare, AmqpAdmin... furtherAdminsThatShouldDeclare)

AmpqUtils.buildNonDurableQueueWithDlx(String queueName, AmqpAdmin adminThatShouldDeclare)
AmpqUtils.buildNonDurableQueueWithDlx(String queueName, AmqpAdmin adminThatShouldDeclare, AmqpAdmin... furtherAdminsThatShouldDeclare)

AmpqUtils.buildNonDurableQueueWithDlxArguments(String queueName, AmqpAdmin adminThatShouldDeclare)
AmpqUtils.buildNonDurableQueueWithDlxArguments(String queueName, AmqpAdmin adminThatShouldDeclare, AmqpAdmin... furtherAdminsThatShouldDeclare)

AmpqUtils.buildNonDurableDlxQueueFor(Queue queue)
AmpqUtils.buildNonDurableDlxQueueFor(String queueName, AmqpAdmin adminThatShouldDeclare)
AmpqUtils.buildNonDurableDlxQueueFor(String queueName, AmqpAdmin adminThatShouldDeclare, AmqpAdmin... furtherAdminsThatShouldDeclare)

AmqpUtils.buildDlxQueueFor(Queue queue)

Examples

Possibility 1
@Configuration
@EnableRabbit
public class RabbitConfiguration
{
    @Bean
    public Exchange exchange()
    {
        return new TopicExchange("exchange.name");
    }

    @Bean
    public Queue queue(AmqpAdmin amqpAdmin)
    {
        return AmqpUtils.buildDurableQueueWithDlx("queue.name", amqpAdmin);
    }
    
    @Bean
    public Binding binding(AmqpAdmin amqpAdmin)
    {
        return bind(queue(amqpAdmin)).to(exchange()).with("routing.key").noargs();
    }
}
Possibility 2

If you want to have access to the DLX-Queue-Bean

@Configuration
@EnableRabbit
public class RabbitConfiguration
{
    @Bean
    public Exchange exchange()
    {
        return new TopicExchange("exchange.name");
    }

    @Bean
    public Queue queue(AmqpAdmin amqpAdmin)
    {
        return AmqpUtils.buildDurableQueueWithDlxArguments("queue.name", amqpAdmin);
    }
    
    @Bean
    public Queue dlxQueue(AmqpAdmin amqpAdmin)
    {
        return AmqpUtils.buildDlxQueueFor(queue(amqpAdmin));
    }
    
    @Bean
    public Binding binding(AmqpAdmin amqpAdmin)
    {
        return bind(queue(amqpAdmin)).to(exchange()).with("routing.key").noargs();
    }
}
Possibility 3

The same as possibility 2, but referncing the Queue and the DLX-Queue via the queue-name

@Configuration
@EnableRabbit
public class RabbitConfiguration
{
    @Bean
    public Exchange exchange()
    {
        return new TopicExchange("exchange.name");
    }

    @Bean
    public Queue queue(AmqpAdmin amqpAdmin)
    {
        return AmqpUtils.buildDurableQueueWithDlxArguments("queue.name", amqpAdmin);
    }
    
    @Bean
    public Queue dlxQueue(AmqpAdmin amqpAdmin)
    {
        return AmqpUtils.buildDurableDlxQueueFor("queue.name", amqpAdmin);
    }
    
    @Bean
    public Binding binding(AmqpAdmin amqpAdmin)
    {
        return bind(queue(amqpAdmin)).to(exchange()).with("routing.key").noargs();
    }
}

In all given examples, it is also possible to give more than one RabbitAdmin/AmqpAdmin that should declare the queues. Also all examples can be made with non-durable-queues (use the AmqpUtils.buildNonDurable...-methods)

com.avides.spring

AVIDES Media AG

E-Commerce Solutions

Версии библиотеки

Версия
1.0.1.RELEASE
1.0.0.RELEASE