Skip to content
Advertisement

Tag: spring

How to implement a synchronous job queue in Spring?

I’m trying to find out how to implement a job queue using Spring. I’ve got a server up and running that I plan to have users submit POST requests to. This will take in some data and will then queue jobs to process this data. The processing of this data is an expensive process that can sometimes take 5 to

How to use explicit links with Thymeleaf?

I wanted to make and link to external site in Spring+Thymeleaf web application and inserted link like this: <a th:href=”@{https://example.com}”>Link</a> However by clicking the link it tries to point internal location http://localhost/service/https://example.com not external website https://example.com like it supposed to. Site gives just an error “status”:500,”error”:”Internal Server Error”,”message”:”The request was rejected because the URL was not normalized.” What’s wrong and

Spring Mockito @BeforeAll mocking logic works on 1 test only

I have a problem with understanding why the logic mocked inside @BeforeAll works, but only for the first test. They work fine separately, copying the identical logic to both tests will produce the same result – 1 passed, 1 failed. What happens: in AboutUsService.update() on the first line appears the mistake at pageRepository.getByName(ABOUT_US_PAGE).orElseThrow(null); For the first test, the calling of

Spring Boot Batch – Stop and Start a multithreaded step with CompositeItemWriter

I am trying to stop and start a multithreaded step through Scheduler. But I am getting exception as If I understand correctly we wont be able to restart an multithreaded step. But I am not restarting. I stop the job by stepExecution.setTerminateOnly() through ChunkListener() and trying to start this by jobLauncher.run() in a scheduler. Here is my codes; StopListener.java This

Spring pageable sort on other entity’s nullable attribute

I came across the following problem… I have three entities: and method using Specification for fetching information about Contracts: and now, my application gives the possibility to sort Contract entities by Department name, so there comes Pageable object with sort parameter set to employee.department.name. And the problem arises when Employee object has department parameter set to null… E.g., if all

Advertisement