Search in sources :

Example 1 with ConstantBackoffAlgorithm

use of com.meltwater.rxrabbit.util.ConstantBackoffAlgorithm in project rxrabbit by meltwater.

the class RxRabbitMultiNodeTest method setupSpec.

@BeforeClass
public static void setupSpec() throws Exception {
    dockerContainers.build();
    Map<String, String> clientProps = new HashMap<>();
    clientProps.put("app_id", RxRabbitTests.class.getName());
    connectionSettings = new ConnectionSettings().withClientProperties(clientProps).withHeartbeatSecs(1).withConnectionTimeoutMillis(500).withShutdownTimeoutMillis(5_000);
    publishSettings = new PublisherSettings().withPublisherConfirms(true).withPublishTimeoutSecs(20).withNumChannels(1).withBackoffAlgorithm(new ConstantBackoffAlgorithm(100)).withRetryCount(4).withCloseTimeoutMillis(5_000);
    int prefetchCount = 10;
    consumeSettings = new ConsumerSettings().withPreFetchCount(prefetchCount).withNumChannels(1).withRetryCount(-1).withBackoffAlgorithm(new ConstantBackoffAlgorithm(100)).withCloseTimeoutMillis(5_000);
}
Also used : HashMap(java.util.HashMap) ConstantBackoffAlgorithm(com.meltwater.rxrabbit.util.ConstantBackoffAlgorithm) BeforeClass(org.junit.BeforeClass)

Example 2 with ConstantBackoffAlgorithm

use of com.meltwater.rxrabbit.util.ConstantBackoffAlgorithm in project rxrabbit by meltwater.

the class RxRabbitTests method setupSpec.

@BeforeClass
public static void setupSpec() throws Exception {
    dockerContainers.resetAll(false);
    Map<String, String> clientProps = new HashMap<>();
    clientProps.put("app_id", RxRabbitTests.class.getName());
    connectionSettings = new ConnectionSettings().withClientProperties(clientProps).withHeartbeatSecs(1).withConnectionTimeoutMillis(500).withShutdownTimeoutMillis(5_000);
    publishSettings = new PublisherSettings().withPublisherConfirms(true).withPublishTimeoutSecs(20).withNumChannels(1).withRetryCount(4).withBackoffAlgorithm(new ConstantBackoffAlgorithm(100)).withCloseTimeoutMillis(5_000);
    consumeSettings = new ConsumerSettings().withPreFetchCount(prefetchCount).withNumChannels(1).withRetryCount(-1).withBackoffAlgorithm(new ConstantBackoffAlgorithm(100)).withCloseTimeoutMillis(5_000);
}
Also used : HashMap(java.util.HashMap) ConstantBackoffAlgorithm(com.meltwater.rxrabbit.util.ConstantBackoffAlgorithm) BeforeClass(org.junit.BeforeClass)

Aggregations

ConstantBackoffAlgorithm (com.meltwater.rxrabbit.util.ConstantBackoffAlgorithm)2 HashMap (java.util.HashMap)2 BeforeClass (org.junit.BeforeClass)2