This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
public class EventHandler{ | |
private final RequestLimitService requestLimitService; | |
private final ExternalServiceClient client; | |
public void handle(){ | |
migrationService.increaseRequestUse(); | |
client.doCall(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.backgroundjob.BackgroundJobLogicService; | |
import com.model.MigrationResultStatus; | |
import com.google.common.base.Preconditions; | |
import lombok.extern.slf4j.Slf4j; | |
import org.apache.commons.csv.CSVFormat; | |
import org.apache.commons.csv.CSVParser; | |
import org.redisson.api.RedissonClient; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.scheduling.annotation.Async; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import entity.IssueReportEntity; | |
import registry.EventHandlerRegistry; | |
import service.IssueReportService; | |
import exceptions.EventHandlingException; | |
import service.TraceService; | |
import lombok.RequiredArgsConstructor; | |
import lombok.extern.slf4j.Slf4j; | |
import org.apache.commons.lang3.StringUtils; | |
import io.awspring.cloud.messaging.listener.Acknowledgment; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import handler.RetryableEventHandler; | |
import lombok.AllArgsConstructor; | |
import lombok.extern.slf4j.Slf4j; | |
import io.awspring.cloud.messaging.listener.Acknowledgment; | |
import io.awspring.cloud.messaging.listener.SqsMessageDeletionPolicy; | |
import io.awspring.cloud.messaging.listener.annotation.SqsListener; | |
import org.springframework.messaging.handler.annotation.Headers; | |
import org.springframework.stereotype.Component; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface EntityRepository extends PagingAndSortingRepository<Entity, Long> | |
{ | |
@Query("{ 'publisher' : ?0}") | |
Stream<Entity> findAllByPublisherAndStream(String publisher); | |
Page<Entity> findAll(Pageable pageable); | |
Long countByEntityCategory(String category); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Job for checking of deleted items | |
* Will be run at 1 am ech day | |
*/ | |
@Scheduled(cron = "0 0 2 * * ?") | |
public void checkJobScheduler() { | |
logger.info("Start checkJobScheduler job"); | |
doJob(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
@EnableWebSecurity | |
public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | |
@Override | |
protected void configure(HttpSecurity http) throws Exception { | |
http | |
.authorizeRequests() | |
.antMatchers("/css/**", "/js/**", "/images/**").permitAll() //Adding this line solved it | |
.antMatchers("/public").permitAll() | |
.antMatchers("/admin**").hasRole("ADMIN") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Here will be declared RabbitMQ listeners for Update Articles Queue | |
*/ | |
@EnableRabbit | |
public class RabbitMQReceiver { | |
private static final Logger logger = Logger.getLogger(RabbitMQReceiver.class); | |
@Autowired | |
private ArticleUpdateService articleUpdateService; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface ResultCallback { | |
void onSuccessEndTask(); | |
void onFailureEndTask(); | |
void pauseAndResendTask(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Logger logger = Logger.getLogger('org.package'); | |
logger.trace('Calling method Y'); | |
logger.debug('Creating new object'); | |
logger.info('Process has finished'); | |
logger.warn("It could'n create this object, the process will try later."); | |
logger.error('Unable to load setting file'); | |
logger.fatal('The app has crashed and its state is unavailable'); |