Skip to content

Commit

Permalink
Merge pull request #13 from DiSSCo/feature/acc-deploy
Browse files Browse the repository at this point in the history
Small fixes for deploy to acc
  • Loading branch information
samleeflang authored Nov 27, 2024
2 parents 62857f6 + fd9bb24 commit da26240
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.kafka.annotation.EnableKafka;
import org.springframework.kafka.annotation.EnableKafkaRetryTopic;

@EnableKafka
@EnableKafkaRetryTopic
@SpringBootApplication
@ConfigurationPropertiesScan
public class DatacitePublisherApplication {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ public class KafkaConsumerService {
@RetryableTopic(
attempts = "1",
dltStrategy = DltStrategy.FAIL_ON_ERROR)
@KafkaListener(topics = "${kafka.consumer.topic.specimen}",
groupId = "${spring.kafka.consumer.group-id}")
@KafkaListener(topics = "${kafka.consumer.topic.specimen}")
public void getSpecimenMessages(@Payload String message) throws DataCiteApiException, InvalidRequestException {
try {
var event = mapper.readValue(message, DigitalSpecimenEvent.class);
Expand All @@ -49,7 +48,7 @@ public void getSpecimenMessages(@Payload String message) throws DataCiteApiExcep
@RetryableTopic(
attempts = "1",
dltStrategy = DltStrategy.FAIL_ON_ERROR)
@KafkaListener(topics = "${kafka.consumer.topic.media}", groupId = "${spring.kafka.consumer.group-id}")
@KafkaListener(topics = "${kafka.consumer.topic.media}")
public void getMediaMessages(@Payload String message) throws DataCiteApiException, InvalidRequestException {
try {
var event = mapper.readValue(message, MediaObjectEvent.class);
Expand All @@ -64,7 +63,7 @@ public void getMediaMessages(@Payload String message) throws DataCiteApiExceptio
@RetryableTopic(
attempts = "1",
dltStrategy = DltStrategy.FAIL_ON_ERROR)
@KafkaListener(topics = "${kafka.consumer.topic.tombstone}", groupId = "${spring.kafka.consumer.group-id}")
@KafkaListener(topics = "${kafka.consumer.topic.tombstone}")
public void tombstoneDois(@Payload String message) throws DataCiteApiException, InvalidRequestException {
try {
var event = mapper.readValue(message, TombstoneEvent.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@


import lombok.RequiredArgsConstructor;
import org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
Expand All @@ -19,6 +21,8 @@ public class WebSecurityConfig {
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http.authorizeHttpRequests(authorizeHttpRequests -> authorizeHttpRequests
.requestMatchers(EndpointRequest.to(HealthEndpoint.class))
.permitAll()
.anyRequest()
.hasRole("orchestration-admin"));

Expand Down

0 comments on commit da26240

Please sign in to comment.