I am rewriting old legacy system written in PHP/HTML into Java/SpringBoot/Thymeleaf. In the old system, there is table displaying search result. In the column “Sentence” I call this function in order to highlight search keywords inside the sentence string. Example: seach keyword is “Macron” and the sentence queried from database is “Emmanuel Macron meets Angela Merkel on Friday to discuss
Tag: spring-boot
How to return custom response in Spring with several attributes other than the List
I’m trying to get a custom response back from a spring rest controller back to the user, containing a list of all registered users and other keys such as sucess, etc. I tried the following approach but the Json array is completly escaped as a string… I get something like this and wanted something like: Is there any way I
Return success from api as true or false om Spring REST API
I am pretty new to Springboot. How can I configure my Springboot API to return the JSON response below from my login or register endpoints?. How I can return true – successful response? And also for example if there is a code exception into code processing how can I return false as the success JSON response? What I have so
Multi MQTT clients subscribed to the same topic
I have actually a spring boot application with a MQTT client into it that is subscribed to topic. I encounter a problem when i put 2 instances of my application ( 2 containers/pods ) because it creates 2 connections to the publisher ! The problem is that I record things in a database for each message, so I receive the
Backwards compatibility when changing Spring Boot externalized configuration
Is there a recommended way to introduce restructurings/renamings into an externalized configuration while keeping backwards compatibility for consumers still relying on the old configuration structure? For example, given a library used the following configuration structure defined via @ConfigurationProperties in the past: A new version of that library redefines the configuration to something like this: Is there a good way to
Ignore specify slash character in yaml config for spring boot admin application
I want to configure the service label app.kubernetes.io/part-of: myapp for the kubernetes discovery in my spring boot admin application. app.kubernetes.io/part-of is a recommended label, so I think there should be a way to configure it for the service discovery. Unfortunately all special characters are removed in the yaml keys, which I notice in the configprops actuator. My questions: How can
NoSuchMethod in JOOQ 3.14 InsertQuery with Postgresql
I’m trying to use Jooq’s InsertQuery to insert a record into PostgresQL database, but I’m running into following error: The query class I’m using looks like this: The user database table looks like this. It has a unique key on the username column and a primary key on the id column. If I do this using ctx.insertInto… it works fine.
Keycloak: Can not read users realm roles as admin cli when calling the admin rest api
I use keycloak 11 as openid connect provider for my spring boot services. Everything works fine so far. Problem: I have a service that uses a webclient. It is nested in my service and uses client auth with the admin-cli client. That works. When I do a get on /users/userId, I get the user representation. The problem I have now
Spring Boot – having all autowired config variables in one class
I am working on a microservice in Spring Boot, and I have a common configuration class where I store all the config variabes that I got from application.properties file. It looks something like this: Config.java Then whenever I need these variables in other classes, I autowire Config.java class, and simply use it like this: Would having a common configuration class
Error creating bean with name ‘liquibase’ in Spring Boot App
I have difficulties with adding Liquibase to my existing Spring Boot application. I added the necessary dependency in pom.xml. Then I have added an empty changelog-master.xml file Here is the code: http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd”> But when I run the program I got an exception: Error creating bean with name ‘liquibase’ defined in class path resource [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: Invocation of init method failed; nested