I have a project with spring-jms I’m trying work with exchanges. I created 4 listeners and all of them are been bound into exchange named ‘jms.durable.queues’ by default. Even thought I create my own exchanges and binding my queues manually on rabbit console, spring is creating a default exc…
Tag: spring-boot
How to reduce Optionals to throw an error once
I have the following response coming from a rest call and performing some logic based on what is returned. This is what I want. If the overall status code is NOT 200 OR If within the list of SimpleResponse, none of the SimpleResponse objects has a 200 httpCode, throw an error. The example below is incomplete.…
Microservices communication with optional parameters requests
I have a room service which returns detail for rooms when requesting http://localhost:8082/room/search/byRoomChar Now I want to request this @GetMapping from the booking service since this is the application gateway that users are going to interact with using the http://localhost:8081/booking/search/byRoomCha…
Why does root path in my controller maps to index.html in spring boot web application?
I’m testing a controller for a Spring Boot application. I want to map a resource to a path, which should be a part of my API. My controller is pretty specific about path: Here ‘web-interface’ is a property, as specified in application.yml file Expected behavior: path: localhost:8080/admin ma…
Trying to get Spring Boot app to send an error response message when request does not have “Content-type” HTTP request header
I am still really new with Spring Boot, but I have a web application, that is setup to handle either XML requests (when the requests have a “Content-type: application/xml” header, or JSON requests (when the requests have a “Content-type: application/xml” header), and I noticed that if …
How do I get a JwtAuthenticationToken for my HandlerMethodArgumentResolver from the request’s Authorization header?
I have a Spring Boot application that requires a JwtAuthenticationToken passed in a HTTP Authorization header. The header itself provides a bearer token; Spring is doing some magic that I am currently unaware of to convert that bearer token string into a JwtAuthenticationToken. I have some code that extracts …
invalid stream header – when publishing message manually on rabbitmq console
I have an application with spring-jms, spring-boot and rabbitmq-jms. When I try send a message and recieve by application runs successfully. But when I publish message manually on rabbitmq console I got error bellow on application listening: This is my JMS configuration Publishing message Consuming message li…
The dependencies of some of the beans in the application context form a cycle in Spring Batch
I’m working on a simple Spring Batch application, and when I finished configuring it, I found that problem: The dependencies of some of the beans in the application context form a cycle: jobRestController defined in file [/home/yassine/Downloads/demo/target/classes/com/example/demo/JobRestController.cla…
Spring Boot Hibernate Many To One not saving joinColumn result
I’m trying to store images in MySQL using Spring boot, I have a user entity and I want to create a Many To One relationship between my FileUpload entity. I’m using react on the front end and the purpose of this upload service is to have profile pictures that a user can set themselves but I’d…
Cannot resolve org.springframework.boot:spring-boot-autoconfigure:2.6.1 springboot | dubbo
When I used maven to import the jar package of dubbo-spring-boot-start, the following error occurred: Springboot 2.6.1 and the dubbo-spring-boot-starter version is 2.7.3 Here is my pom.xml: What’s the reason? When I add the dubbo-spring-boot-starter jar package, I get an error, but it can run when I dow…