Skip to content

Commit

Permalink
AYS-508 | Kinesis Integration & Removed DynamoDB Integration (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
alpemreelmas authored Nov 24, 2024
1 parent 658c407 commit 9795353
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 62 deletions.
8 changes: 1 addition & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,7 @@

<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>dynamodb</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>

<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>dynamodb-enhanced</artifactId>
<artifactId>kinesis</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>
<!-- ===================== -->
Expand Down
48 changes: 0 additions & 48 deletions src/main/java/org/ays/common/config/AysDynamoDBConfiguration.java

This file was deleted.

34 changes: 34 additions & 0 deletions src/main/java/org/ays/common/config/AysKinesisConfiguration.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package org.ays.common.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.kinesis.KinesisClient;

@Configuration
@Profile("kinesis")
public class AysKinesisConfiguration {

@Value("${aws.credentials.access-key-id}")
private String accessKey;

@Value("${aws.credentials.secret-access-key}")
private String secretKey;

@Value("${aws.kinesis.region}")
private String region;

@Bean
public KinesisClient kinesisClient() {
AwsBasicCredentials awsCredentials = AwsBasicCredentials.create(accessKey, secretKey);

return KinesisClient.builder()
.credentialsProvider(StaticCredentialsProvider.create(awsCredentials))
.region(Region.of(region))
.build();
}
}
7 changes: 0 additions & 7 deletions src/main/resources/application-dynamodb.yml

This file was deleted.

6 changes: 6 additions & 0 deletions src/main/resources/application-kinesis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
aws:
kinesis:
region: ${AWS_KINESIS_REGION:}
credentials:
access-key-id: ${AWS_KINESIS_ACCESS_KEY_ID:}
secret-access-key: ${AWS_KINESIS_SECRET_ACCESS_KEY:}

0 comments on commit 9795353

Please sign in to comment.