Posts

Accessing HttpServletRequest in normal Java class

Accessing HttpServletRequest in normal Java class  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 at work where i need to access HttpServletRequest in a normal Java class inorder to get Ip Address from the request. In my normal Java class i do not have direct access to the request and hence i used the below code to do that. But the normal Java class should be the part of HttpServlet request thread. It means that the normal Java class is being called from a HttpServlet request thread. ServletRequest servletRequest = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest(); if(servletRequest instanceOf HttpServletRequest) {    ipAddress =  ((HttpServletRequest)request).getHeader(" X-Forwarded-For "); } if(ipAddress ...

Problems and Solutions regarding Fedora VM

Hi, This post addresses the problems developers face in Fedora VM in their daily work. How to configure proxies to get internet connection in Guest VM? - Login to Fedora VM. - Click on arrow symbol located next to Battery icon. It may differ according to the flavour of VM     that you use. - Choose Wired Connected -> Wired Settings - Go to Network proxy and click on Settings icon. - There you go!!! Choose option Manual and set Http and Https proxies. Now you could able to access the internet in Guest VM too. Please add your experiences too. It would be helpful for others. find . -name scooter\* - find a file in a directory from a command line sudo mount -t vboxsf projects /home/malathiboggavarapu/Shared - Mounts the folder projects to /home/malathiboggavarapu/Shared in Fedora cp [src][dest] - Copies the file from src to dest mv [src][dest] - Moves the file from src to dest history | grep mount - Find mount from history. If history contains some com...

Load Balancing using Spring Cloud Netflix Ribbon

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. This post teaches you about how to acheive Client side LoadBalancing using SpringCloud Netflix Ribbon Api. So let's jump start into the details. First we learn what is meant by LaodBalancing and the differences between Client side and Server side Load Balancing and also we see which one is the best fit for MicroServices. What is Load Balancing Simply put, Load balancing is a way to improve distribution of work load across multiple computing resources -Wikipedia The most important thing you need to know is what role does Load balancing plays in cloud native architecture. It would be very clear if we understand the difference between load balancing in cloud and non-cloud native architecture. In non-cloud native application, we go from having multiple instances...

Truth About the loss of jobs due to automation In 3 Minutes – wake up NOW!!!

Image
Job loss has been a trend which has been fluctuating across the decade due to various reasons starting from global conflicts to recessions. As we enter into the digital era, the new threat which is showing up is job loss due to “ Automation ”. Unlike earlier automation through computerization and Information technology which resulted in the generation of jobs, the upcoming rapid automation empowered with Artificial Intelligence (AI) shows a negative trend in the future job market. What could be the reason?  The earlier automation eliminated repetitive and low-value jobs and in turn generated high-value jobs which generated abundant opportunities for highly skilled knowledge workers. But what is the issue with the upcoming Automation? The answer to that is the upcoming automation empowered by Artificial Intelligence and Machine Learning can replace jobs which need human intelligence. This will eliminate jobs of high skilled workers too. At the sam...

Gateway Service using Spring Cloud Netflix Zuul

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 will see how to map our MicroServices in the Cloud using Intelligent Routing via Netflix Api. So what is meant by Intelligent Routing? Let's jump start into the details. Intelligent Routing Each of the individual services would be running on different port, different addresses or a combination of both. And they also likely have different paths and different API's to interact with. As a user or a client of those services such as mobile app or web app, interacting with each of the individual services which could easily be in double or triple digits would be a nightmare. Instead we can use Intelligent Routing to make our application appear as it was a single system.  Intelligent Routing via a Gateway Service Routing is implemented via ...

How to update Cygwin with SSH

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. Updating Cygwin with SSH is simple. If you are trying to update ssh in cygwin, you would have already downloaded the cygwin setup exe file setup-x86_64.exe. Follow the below steps to accomplish it 1) Double click on setup-x86_64.exe 2) Click on Next until your reach Select package menu 3) Type openssh in the searchbox. It will search for it and show up the packages. 4) Click on Net package and click on Skip. Select the two boxes 5) Click on Next and finish the installation 6) Now open cygwin shell and type ssh and press Enter. See the below picture. Regardless of whatever you need to update in Cygwin, the above steps are crucial to follow and this is the most usual way everyone do inorder to update Cygwin with several different tools. Hope it...

5 important things to remember while learning new Programming language

Learning something new is always fun and energetic. My name is Malathi Boggavarapu and i read a lot of articles on daily basis. I am a frequent blogger, had great enthusiasm towards learning new things, Travelling and Photography.  I am a Software Engineer by Profession. While going through some of the articles, i came across a saying "Every human have a natural ability called neuroplasticity which means that if we learn new knowledge and have new experiences, we can develop new networks or circuits of neurons and literally change our mind."  That's the power of learning new things. Because whenever you are learning something new, unconsciously you feel new experiences in your mind and hence develop new neurons which can change your mind. Now let's jump start to our actual topic about remembering 5 important things when we start to learn new programming language. Programmers always try to learn new technology when it is being demanded at work ...