I’d like to implement UPDATE (method PUT) operation for REST api. From front-end application my controller method expects map of values, for example: I’d like to use map as the request body and not POJO because with help opf map I can declare 3 states for each property: property is absent in the m…
Tag: spring-boot
Spring Boot StackOverFlowError : Null
I have a problem when I want save repository by foreach loop . By Foreach loop user come and save it to another entity User.class public class Attendance { } User.class This is user class of User Entity Error show :: java.lang.StackOverflowError: null Answer Mixing what I saw in your code and what you said in…
Need Help converting JavaObject To Json in Generic Pattern
I wrote a Generic method which works fine converting any Json object to Generic Object. But has an issue while converting the Generic Object type to JSON format with the below code format. Would someone help me or guide me with related code.. I am not sure how to retain an Object from Generic class type as th…
Db insertion row if not exist spring boot
I have a two instances of one spring boot microservice. If two requests are sent at the same time, and the second request can update the row that was created by the first request. How i can prevent this? For example the table contains this columns :id,format,username,groupName and if a row exists (3,”te…
Starting and Stopping an InboundChannelAdapter manually
I’m trying to start an InboundChannelAdapter manually using a @Scheduled function. I think I’m setting up the message payload wrong but I’m not sure what to have it as. Here’s the code: I’m getting this error: The error occurs at the controlBusChannel.send() line and the transfor…
Execute sql native query from two entity using jpa or hibernate
I have 2 tables, salesOrder with column “id”, “customerId”, “textReview(boolean)” and table SalesOrderline with column “salesOrderId”, “productId”. i want to change boolean data in textReview column. I got data from the client in the form is customer…
How to define a bean from a dependency class as @Primary in Spring?
I have a Kafka Consumer and I’m implementing it using the Spring Cloud Stream Source.class binding and InboundChannelAdapter. This Source.class defines 3 MessageChannel beans: output, nullChannel, and errorChannel. My code looks like this: I want to autowire in the output channel so that I can use it to…
How to loop through a list payload and insert into database as individual row items in Springboot?
I am trying to insert items in a list in a database as single values in rows with the name of the sender. I am able to send the payload and insert into a single row with the user detailst. How can I loop through the payload sent and insert all the items into individual rows? I have tried to
ConsumerRecords is always empty in Kafka, Java, but Future isDone method result true
I try to send message to exact Kafka topic and then receive message from it. I have 3 configuration classes for Consumer, Producer and Topic: GlobalConfiguration class stores all my properties. For Kafka: Then I send message in this way I check if message is sent with sendResponse.isDone() and it returns true…
HTTP not present on Schemes Swagger dropdown
I’m using springfox-swagger-ui and for whatever reason, only https scheme is available on the dropdown, even if I reach swagger ui through http. I can’t use https for the moment, so need that scheme enabled but couldn’t find anything on the documentation. Any idea why is this happening? Answ…