12 Ekim 2023 Perşembe

RabbitMQ Client Kullanımı

Örnek
Şu satırı dahil ederiz
<dependency>
<groupId>org.testcontainers</groupId> <artifactId>testcontainers</artifactId> <version>${testcontainers.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.testcontainers</groupId> <artifactId>rabbitmq</artifactId> <version>${testcontainers.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>com.rabbitmq.jms</groupId> <artifactId>rabbitmq-jms</artifactId> <version>3.1.0</version> </dependency>
Şöyle yaparız
import com.rabbitmq.jms.admin.RMQConnectionFactory;
import org.testcontainers.containers.RabbitMQContainer;
import jakarta.jms.ConnectionFactory;


RabbitMQContainer rabbitMQContainer = new RabbitMQContainer("rabbitmq:3.8");
rabbitMQContainer.start();

RMQConnectionFactory f = new RMQConnectionFactory();
f.setUri(rabbitMQContainer.getAmqpUrl());
...
rabbitMQContainer.stop();

Bean Validation @GroupSequence Anotasyonu

Örnek Elimizde şöyle bir kod olsun public class SampleRequest {   @NotNull   LocalDate startDate;   @NotNull   LocalDate endDate;   @AssertT...