Postman - Request took too long to give an answer - spring-boot

I am working a Java exercise at IntelliJ Idea using Spring Boot, Maven, MySQL Workbench 8.0 and Postman. I have connected Spring Boot framework with localhost in MySQL. I use github.com platform to post my code there and to refresh it time after time. Now I have a problem with sending request at Postman. The request took too long to give an answer. I tried too many times to fix this problem, but it didn't workout. Sincerely, I don't understand what is happening? Can somebody help me with this? Meanwhile I am posting here the github.com account and there you can see the solution that I have done to it. Below you can find the data of database connection and the data of exercise.
https://github.com/kevingjika/ecommerce-app,
root#127.0.0.1:3306,
jdbc:mysql://127.0.0.1:3306/?user=root,
ecommerce backend application

Related

Spring API + Vue JS Web Application slows down extremely in production

I built a basic web application to learn about Spring Boot and Vue.js.
When running the applications on localhost, everything runs smoothly, i.e. every request needs well under 1 sec.
Now I deployed the application on heroku to put it into production, but the performance slowed down tremendously. Every action that requires an API call takes quite exactly 5-7 seconds.
Of course a slow down is to be expected when using a free hosting provider. However, this is extreme.
Now the region set in Heroku for the Spring API is Europe, the database for the application is in SG and I sit in the PHilippines, which I assume could explain some of the lag.
When following the logs in heroku, the API call shows up about 6 seconds after I send it, with the response coming right after (<1sec).
Which leads to my question:
How will I be able to find the bottleneck here and what can I do to fix this?
Here is the link for the API (the api contains only demo data, so please don't mind the exposed passwords...)
https://brownbag-api.herokuapp.com/api/pos/all
The issue was the delay between the Spring Boot API and the MySQL database.
Moving to a database on the same dyno as the Spring boot API fixed the issue.

How to Connect Ionic Mobile App to Backend API Using Spring?

Does anyone know how to connect the ionic mobile app to backend api using spring and sqlserver as its database? If you have some references or examples, then it would help me a lot.
Here are few tutorial that might be useful to you.
(These are not using sql server, doesn't matter much)
https://developer.okta.com/blog/2017/05/17/develop-a-mobile-app-with-ionic-and-spring-boot
https://blog.ionicframework.com/creating-an-ionic-app-with-mysql-and-backand/
You need to have first the documentation of your backend or to know the methods of the backend with URL. you can find many videos and tutorial on google. it depends about what you need (Authentification, getting data, streaming.... ).

Keycloak, get the users' information

I have a jersey application running on a tomcat server and it has keycloak integrated in it.. My problem is that I'm trying to fetch the information of authenticated user but I'm having a hard time to find a solution. Most (if not all) of the solutions I have seen so far suggest to import KeycloakPrincipal and other things but that would have worked if keycloak was parts of my pom.xml file which isn't the case. Anybody has ran into this issue before?

Security concerns using Spring as backend for mobile app

Me and a team built a small "meet people" app last semester that used Spring linked to a MySQL database as the backend. I am working on my own app now and I'm worried about security because all of our user information was sent over HTTPS GET requests to the server. It seems weird to me that we were able to hop on google chrome, type in xxx.xxxxx.xx:xxx/user/2 and get back a JSON with all of a specific users information. If anyone knew our url/port, they would be able to access this information themselves.
I'm sure this is a basic question, but what steps do I need to take to create a Spring backend that isn't as easy to access? I'm basically a total beginner in this, but I did write the service in Spring last semester so I know the basics.
You can use Spring Security which is a very good project and easy to integrate.
There are many types of security features it provides :
Basic Spring Security
Role Based Spring Security
baeldung.com and howtodoinjava has a very good series on it.
You can also use jwt-authentication-on-spring-boot which is also a good way to secure the APIs.

Spring web flow with dart on frontend and backend

Anyone tried using spring web framework with dart
kindly provide me with an example or if you have seen one in Github i would appreciate the link , have searched but i havent got one
Unfortunately I don't think you can accomplish whatever it is you are trying to accomplish. dart, as tagged here is the dart programming language which runs in its own virtual machine or is compiled to javascript. It has no connection to Java or Java Server Pages at all.
If you are using Dart on the front end, any back-end server an serve the html and dart/javascript scripts and respond to any ajax requests you setup, but you cannot integrate Spring Web Flow, a Java Server backend, with a dart backend.

Resources