Posts

Showing posts from December, 2018

Spring Framework and ScheduledExecutorService - Load property files during startup

Hi, I am Malathi Boggavarapu working at Volvo Group and i live in Gothenburg, Sweden. I have been working on Java since several years and had vast experience and knowledge across various technologies. In this post we see how to load property files during the application startup in an efficient way using Spring framework and ExecutorService which allows you to reload properties without server restart if any properties were changed. So let's get started. How to load Property files using Spring Every application is loaded using the deployment descriptor file web.xml. So in web.xml we need to declare the DispatcherServlet class with load-on-startup as 1. servlet-name can be anything. In our example it is called as bl (business layer). So during application startup, server tries to find the bl-servlet.xm l file. web.xml <servlet>     <servlet-name>bl</servlet-name>     <servlet-class>org.springframework,web.servlet.DispatcherSer

GraphQL Vs REST and What is GraphQl?

Image
Hi, I am Malathi Boggavarapu working at Volvo Group and i live in Gothenburg, Sweden. I have been working on Java since several years and had vast experience and knowledge across various technologies. In this post we discuss little bit about GraphQl versus REST. My goal here is not to say REST is not good, use GraphQl. It's like more exploration of how we currently fetch data for apps right now and how GraphQl can help and what it does differently. So i want to start with a simple UI component and walk through about how we get data to populate that component. Let's take an example of Shopping cart. See the below picture We need lot of data to render the products in the above picture. So what kind of data exactly we need? If we see the picture we have Cart which hold some Products and each Product have title , descrition , price and bunch of other things and also the Product image which have Url of the image and it's metadata.

Install ojdbc driver to Maven local repository

Image
Install ojdbc driver to Maven local repository Hi, I am Malathi Boggavarapu working at Volvo Group and i live in Gothenburg, Sweden. I have been working on Java since several years and had vast experience and knowledge across various technologies. In recent days i have a been building the sample REST api using Spring Boot framework and Gradle. So in no time i jumped to the website Spring Initializer (https://start.spring.io/ ) immediatly and generated the project with required dependencies such as Web, Actuator, JPA and JDBC. I added the jdbc dataSoruce configuration properties to application.yml inorder to connect to Oracle database. See below spring: datasource: url: jdbc:oracle:thin:@[host_name]:[port]/[service_name] username: [user_name] password: [password]       driver-class-name: oracle.jdbc.driver.OracleDriver But once i start the Spring boot application it started complaining 'Can not load OracleDriver' and could

View events fired on an element in google chrome

Image
Hi, I am Malathi Boggavarapu working at Volvo Group and i live in Gothenburg, Sweden. I have been working on Java since several years and had vast experience and knowledge across various technologies.  Recently i came across the situation where i need to find the event that has been triggered when i try to rotate the street view of google maps which is embedded in an iframe of the application. The real issue is the user could not rotate the street view so i need a way to find out what events are being triggered when i rotate the street view or whether any events are being triggered at all when i do it. So finally did google search and found out the following steps to do in google chrome - Go to More Tools -> Developer Tools or just press F12. - Click on Sources tab - On left hand side (or right side), scroll down to 'Event Listener Breakpoints' and expand tree - You find all the events. See the below picture - Select the ev