Change DynamoDbLocalRunning default port to 4568

To be able to run Kinesalite and Dynalite npm services locally in
parallel, we need to provide unique ports for them.
Therefore a default `4567` is left for the Kinesalite, meanwhile the
`DynamoDbLocalRunning` is expecting a 4568 now
This commit is contained in:
Artem Bilan
2018-07-02 13:30:39 -04:00
parent 662416cd7b
commit 19b21579dc
7 changed files with 21 additions and 8 deletions

View File

@@ -497,9 +497,10 @@ this.amazonDynamoDB = AmazonDynamoDBAsyncClientBuilder.standard()
````
Where you should specify the port on which you have ran the Dynalite service.
Also you can use for your testing purpose a copy of `org.springframework.integration.aws.DynamoDbLocalRunning` in the `/test` directory of this project.
Also you can use for your testing purpose a copy of `org.springframework.integration.aws.DynamoDbLocalRunning` in the `/test` directory of this project.
The default port is expected as `4568`, because the `4567` is reserved for the `KinesisLocalRunning` against local Kinesalite npm service.
Starting with _version 2.0_, the ``DynamoDbMetaDataStore` can be configured with the `timeToLive` option to enable the [DynamoDB TTL][] feature.
Starting with _version 2.0_, the `DynamoDbMetaDataStore` can be configured with the `timeToLive` option to enable the [DynamoDB TTL][] feature.
The `TTL` attribute is added to each item with the value based on the sum of current time and provided `timeToLive` in seconds.
If the provided `timeToLive` value is non-positive, the TTL functionality is disable on the table.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017 the original author or authors.
* Copyright 2017-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -47,6 +47,8 @@ import com.amazonaws.services.dynamodbv2.AmazonDynamoDBAsyncClientBuilder;
*/
public final class DynamoDbLocalRunning extends TestWatcher {
public static final int DEFAULT_PORT = 4568;
private static Log logger = LogFactory.getLog(DynamoDbLocalRunning.class);
// Static so that we only test once on failure: speeds up test suite
@@ -92,6 +94,10 @@ public final class DynamoDbLocalRunning extends TestWatcher {
}
public static DynamoDbLocalRunning isRunning() {
return isRunning(DEFAULT_PORT);
}
public static DynamoDbLocalRunning isRunning(int port) {
return new DynamoDbLocalRunning(port);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017 the original author or authors.
* Copyright 2017-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -48,6 +48,8 @@ import com.amazonaws.services.kinesis.AmazonKinesisAsyncClientBuilder;
*/
public final class KinesisLocalRunning extends TestWatcher {
public static final int DEFAULT_PORT = 4567;
private static Log logger = LogFactory.getLog(KinesisLocalRunning.class);
// Static so that we only test once on failure: speeds up test suite
@@ -109,6 +111,10 @@ public final class KinesisLocalRunning extends TestWatcher {
};
}
public static KinesisLocalRunning isRunning() {
return isRunning(DEFAULT_PORT);
}
public static KinesisLocalRunning isRunning(int port) {
return new KinesisLocalRunning(port);
}

View File

@@ -65,7 +65,7 @@ import org.springframework.test.context.junit4.SpringRunner;
public class KinesisIntegrationTests {
@ClassRule
public static final KinesisLocalRunning KINESIS_LOCAL_RUNNING = KinesisLocalRunning.isRunning(4567);
public static final KinesisLocalRunning KINESIS_LOCAL_RUNNING = KinesisLocalRunning.isRunning();
private static final String TEST_STREAM = "TestStream";

View File

@@ -53,7 +53,7 @@ import com.amazonaws.waiters.WaiterParameters;
public class DynamoDbLockRegistryLeaderInitiatorTests {
@ClassRule
public static final DynamoDbLocalRunning DYNAMO_DB_RUNNING = DynamoDbLocalRunning.isRunning(4567);
public static final DynamoDbLocalRunning DYNAMO_DB_RUNNING = DynamoDbLocalRunning.isRunning();
private static AmazonDynamoDBAsync dynamoDB;

View File

@@ -59,7 +59,7 @@ import com.amazonaws.waiters.WaiterParameters;
public class DynamoDbLockRegistryTests {
@ClassRule
public static final DynamoDbLocalRunning DYNAMO_DB_RUNNING = DynamoDbLocalRunning.isRunning(4567);
public static final DynamoDbLocalRunning DYNAMO_DB_RUNNING = DynamoDbLocalRunning.isRunning();
private final AsyncTaskExecutor taskExecutor = new SimpleAsyncTaskExecutor();

View File

@@ -47,7 +47,7 @@ import com.amazonaws.waiters.WaiterParameters;
public class DynamoDbMetadataStoreTests {
@ClassRule
public static final DynamoDbLocalRunning DYNAMO_DB_RUNNING = DynamoDbLocalRunning.isRunning(4567);
public static final DynamoDbLocalRunning DYNAMO_DB_RUNNING = DynamoDbLocalRunning.isRunning();
private static final String TEST_TABLE = "testMetadataStore";