Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Aug 30, 2024
1 parent e9e84a5 commit e02163d
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ FROM gitpod/workspace-full:latest
USER gitpod

RUN bash -c ". /home/gitpod/.sdkman/bin/sdkman-init.sh \
&& sdk install java 21.0.2-tem \
&& sdk default java 21.0.2-tem"
&& sdk install java 21.0.4-tem \
&& sdk default java 21.0.4-tem"
2 changes: 1 addition & 1 deletion aws-sns-project/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.8'
services:

localstack:
image: localstack/localstack:3.6.0
image: localstack/localstack:3.7.0
ports:
- "4566:4566"
environment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

@SpringBootApplication
@EnableConfigurationProperties({ApplicationProperties.class})
public class Application {
public class SNSApplication {

public static void main(String[] args) {
SpringApplication.run(Application.class, args);
SpringApplication.run(SNSApplication.class, args);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@Component
@RequiredArgsConstructor
@Slf4j
public class Initializer implements CommandLineRunner {
class Initializer implements CommandLineRunner {

private final ApplicationProperties properties;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

@Configuration(proxyBeanMethods = false)
@OpenAPIDefinition(info = @Info(title = "aws-sns-project", version = "v1"), servers = @Server(url = "/"))
public class SwaggerConfig {}
class SwaggerConfig {}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import software.amazon.awssdk.services.sns.SnsClient;

@Configuration
@Configuration(proxyBeanMethods = false)
@RequiredArgsConstructor
public class WebMvcConfig implements WebMvcConfigurer {
class WebMvcConfig implements WebMvcConfigurer {

private final ApplicationProperties properties;
private final SnsClient snsClient;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
package com.learning.awssns.utils;

public final class AppConstants {
public static final String PROFILE_PROD = "prod";
public static final String PROFILE_NOT_PROD = "!" + PROFILE_PROD;
public static final String PROFILE_LOCAL = "local";
public static final String PROFILE_TEST = "test";
public static final String PROFILE_NOT_TEST = "!" + PROFILE_TEST;
public static final String DEFAULT_PAGE_NUMBER = "0";
public static final String DEFAULT_PAGE_SIZE = "10";
public static final String DEFAULT_SORT_BY = "id";
public static final String DEFAULT_SORT_DIRECTION = "asc";
}
2 changes: 1 addition & 1 deletion aws-sns-project/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
spring.application.name=aws-sns-project
server.port=8080
server.shutdown=graceful
spring.main.allow-bean-definition-overriding=true

spring.jmx.enabled=false
spring.mvc.problemdetails.enabled=true
spring.threads.virtual.enabled=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
import com.learning.awssns.common.ContainersConfig;
import org.springframework.boot.SpringApplication;

public class TestApplication {
public class TestSNSApplication {

public static void main(String[] args) {
System.setProperty("spring.profiles.active", "local");
SpringApplication.from(Application::main).with(ContainersConfig.class).run(args);
SpringApplication.from(SNSApplication::main)
.with(ContainersConfig.class)
.run(args);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ public class ContainersConfig {
@ServiceConnection
LocalStackContainer localstackContainer(DynamicPropertyRegistry registry) {
return new LocalStackContainer(
DockerImageName.parse("localstack/localstack").withTag("3.6.0"));
DockerImageName.parse("localstack/localstack").withTag("3.7.0"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ public Executor getAsyncExecutor() {
@Override
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
return (throwable, method, params) -> {
log.error("Exception message - " + throwable.getMessage());
log.error("Method name - " + method.getName());
log.error("Exception message - {}", throwable.getMessage());
log.error("Method name - {}", method.getName());
for (Object param : params) {
log.error("Parameter value - " + param);
log.error("Parameter value - {}", param);
}
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.learning.awspring.utils;

public final class AppConstants {
public static final String PROFILE_LOCAL = "local";

public static final String PROFILE_PROD = "prod";
public static final String PROFILE_NOT_PROD = "!" + PROFILE_PROD;
public static final String PROFILE_TEST = "test";
public static final String PROFILE_IT = "integration-test";
// Name of the queue. Developers are free to choose their queue name. (
// "http://localhost:4566/000000000000/spring-boot-amazon-sqs")
public static final String QUEUE = "spring-boot-amazon-sqs";
Expand Down
2 changes: 1 addition & 1 deletion aws-sqs-project/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
logging:
file:
name: logs/aws-sqs-project.log
name: logs/${spring.application.name}.log
level:
com:
amazonaws:
Expand Down

0 comments on commit e02163d

Please sign in to comment.