MongoDB sequences (auto-increment) - The Java Way
One of the missing elements while using MongoDB is lack of the auto-increment fields, commonly called sequences (e.g. in PostgreSQL). For MongoDB Atlas (managed MongoDB solution) there is a posibility to mimic this feature using database triggers (as mentioned on MongoDB page).
Continue reading →Last week we found out that in some cases our application is showing redundant data on error - for example stacktrace.
It happens when there was an error which was handled by the application container which was Jetty.
For example, sending a header like X-FORWARDED-PORT: some-not-numeric-value
causes
NumberFormatException
and shows a full stacktrace.
While working on webapp API in Java I need to send the app version and the build date to the frontend. But how to make this?
As my API build is based on maven I thought about getting version from pom.xml
file. So, let’s make it this way!
Yep, that’s another story of “always check if serialising and de-serialising works as expected”. And some kind of reminder for future-me if I forgot about this! ;-)
Session of logged users seems to be a pretty easy topic, yep? For sure it is! What if you want to share that session between different instances of your app? That seems quite easy too - let’s store it in a database and you’re good to go.
Continue reading →All articles are under CC BY-NC 4.0 license.
Copyright © Kamil Banach ;-)
This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.