Skip to main content

Posts

Showing posts with the label java

Tech Conversant Weekly Jan 16 - Jan 21

Topic: General                                                                                                                                              Level: All In this post, we shall catch up on the multi-faceted technological updates that happened over the past week as well as a few that seized my attention, Frequently we read properties from file to the application, conversely, we can write to configuration properties file as well from Java  https://youtube.com/shorts/GzuYu6XPaVs Building custom URLs with special characters creates complexities in request mapping on the server-side code. The REST requests are to be intercepted for carrying out preprocessing not only on the URL but on the whole request before delegation to the controller. Create an implementation for ClientHttpRequestInterceptor and override the intercept method, subsequently registering the interceptor onto the rest template, any requests are routed via the implementation. https://www.baeldung.com/spring-restt

Tech Conversant Weekly Jan 02 - Jan 07

Topic: General                                                                                                                                              Level: All In this post, we shall catch up on the multi-faceted technological updates that happened over the past week as well as a few that seized my attention, Microservices using shared memory for interservice communication and data processing, to speed up the processing between multiple services and achieve low latency with high throughput, creating a Virtual memory that offers shared memory space residing in the local disk for the services to leverage. The Chronicle library facilitates creating the memory region of the heap on a file for virtual memory and debugging the file with readable YAML format. The feature of the memory map file has been available since JDK4, FileChannel.map + MapMode.READ_WRITE = MappedByteBuffer (not thread safe) Other places for improvement are, 1) Thread safe access 2) Long offsets (64-bit) 3) Comple

Tech Conversant Weekly Nov 28 - Dec 03

Topic: General                                                                                                                                              Level: All In this post, we shall catch up on the multi-faceted technological updates that happened over the past week as well as a few that seized my attention, How can a DTO contribute to enhancing the security of the java application? A DTO can be a JavaBeans (encapsulated) or POJO (no constructor) or an immutable Record class (added advantage on serialization), that maps the data from the database layer domain model to the presentation layer, restricting the data on a need-to-know basis and acts as a proxy providing filtering and preprocessing. https://snyk.io/blog/how-to-use-java-dtos/ By employing static code analysis tools, the NullPointerException feasibility on the code flow is determined, making the code not only null-safe but also cutting down the exception propagated stacktrace given in the piped code sequence invocation

Tech Conversant Weekly Nov 7 - Nov 12

Topic: General                                                                                                                                             Level: All In this post, we shall catch up on the multi-faceted technological updates that happened over the past week, Dealing with checked exceptions in functional interfaces via lambdas in Java Streams shatters the intent of a simplified functional pipeline making it verbose. By extracting the exception handling block to a class, Lombok annotation SneakyThrow, Apache Commons Lang Failable stream API, and Varv functional library with Streams offers alternatives for handlezing the try/catch scenario embracing code pipe flow, thereby optimizing lambdas in the Streams. https://blog.frankel.ch/exceptions-lambdas/ When we package and ship our application to the clients, making it evident on the dependencies (both stated and transitive) used in the application aids clients in making informed decisions, adhering to any defined standards,

Spring on GraalVM Implementation

Topic: GraalVM                                                                                                                            Level: Advanced Spring on GraalVM Implementation In this consecutive post ( prior post ), we shall exploit the theory of the previous post on GraalVM, Native Image, and Spring Native and set up a Spring Boot project running on GraalVM that leverages static analysis and linkage during the build time with ahead-of-time compilation delivering a windows native executable. Prerequisites GraalVM JDK 11 distribution ( https://github.com/graalvm/graalvm-ce-builds/releases/tag/vm-22.3.0 ) - ensure you revise the JAVA_HOME and PATH appropriately Native Image executable (for windows, https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16 ) Maven build tool IntelliJ IDE MySQL Windows 10 OS We will commence by downloading a Spring template with Spring Boot >=2.7.5 version running on JDK 11 with the dependencies for Gr

Spring on GraalVM

Topic: GraalVM                                                                                                                            Level: Advanced GraalVM - What? GraalVM is a virtual machine for seamless interoperability and polyglot language compilation that offers highly optimized runtime executable binaries, speeding the application startup and reducing memory consumption ideal for microservices, serverless, and cloud workloads in general. Any source code running on the Java Hotspot VM can also run on the GraalVM. Native Images - What? Native Image is a technology by which a java code is compiled ahead of time into a binary executable, termed a native executable which doesn't require a JVM to run. The notion of the native executable is to have optimized machine code (packaging only the necessary reachable runtime application classes, standard library classes, language runtime, statically linked native code from JDK, and other resources making it a lightweight artifact) o