Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Mar 12, 2024
1 parent 849898d commit 18e7c35
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions aws-kinesis-project/consumer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ $ ./mvnw spring-boot:run -Dspring-boot.run.profiles=local
## Notes:

- Starting 4.0.0 kinesis steam binder works with aws v2 of dynamodb, cloudwatch and kinesis
- The maximum size of a data blob (the data payload before Base64-encoding) is 1 megabyte (MB).


### Useful Links
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public class IpConsumer {

private final ObjectMapper objectMapper;

// As we are using useNativeDecoding = true along with the listenerMode = batch,
// there is no any out-of-the-box conversion happened and a result message contains a payload
// like List<software.amazon.awssdk.services.kinesis.model.Record>. hence manually manipulating
@Bean
public Consumer<Flux<List<Record>>> consumeEvent() {
return recordFlux ->
Expand All @@ -41,8 +44,7 @@ public Consumer<Flux<List<Record>>> consumeEvent() {
try {
ipAddressDTOS =
objectMapper.readValue(
substring,
new TypeReference<List<IpAddressDTO>>() {});
substring, new TypeReference<>() {});
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spring.cloud.aws.endpoint=http://localhost:4566
# events inbound
spring.cloud.stream.bindings.consumeEvent-in-0.destination=my-test-stream
spring.cloud.stream.bindings.consumeEvent-in-0.group=my-test-stream-Consumer-Group-1
#spring.cloud.stream.bindings.consumeEvent-in-0.content-type=text/plain
spring.cloud.stream.bindings.consumeEvent-in-0.content-type=application/json
spring.cloud.stream.bindings.consumeEvent-in-0.consumer.header-mode=none
spring.cloud.stream.bindings.consumeEvent-in-0.consumer.use-native-decoding=true
#defaults to 1, this will process upto 5 messages concurrently
Expand Down
2 changes: 1 addition & 1 deletion aws-s3-project/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.3</version>
<version>3.3.0-M2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.learning.awspring</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ public class TestS3Application {
@ServiceConnection
@RestartScope
PostgreSQLContainer<?> postgresContainer() {
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.1-alpine"))
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.2-alpine"))
.withReuse(true);
}

@Bean
LocalStackContainer localstackContainer(DynamicPropertyRegistry registry) {
LocalStackContainer localStackContainer =
new LocalStackContainer(
DockerImageName.parse("localstack/localstack").withTag("3.1.0"))
DockerImageName.parse("localstack/localstack").withTag("3.2.0"))
.withCopyFileToContainer(
MountableFile.forHostPath(".localstack/"),
"/etc/localstack/init/ready.d/")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
properties = {
"spring.jpa.hibernate.ddl-auto=validate",
"spring.test.database.replace=none",
"spring.datasource.url=jdbc:tc:postgresql:16.1-alpine:///db"
"spring.datasource.url=jdbc:tc:postgresql:16.2-alpine:///db"
})
class SchemaValidationTest {

Expand Down

0 comments on commit 18e7c35

Please sign in to comment.