While developing a webpage, we will need to test it from different devices with different display sizes. By default the angular applications which runs throughΒ ng serveΒ will not be available from outside the device where it runs. If you need to access it from another device in the network, run it…
Installing MongoDB in Windows OS
Note: Below steps were prepared based on the installation of MongoDB-3.6.0(64 bit) in Windows-10 OS. MongoDB can be downloaded from their official website. You can either download msi file which provides step by step guide to install or choose zip file which doesn’t need any installation.
Apache Camel – Null safe operator for ‘simple’ statement
In Apache CamelΒ we use “simple” statement to extract values in a pojo. For example if we have a pojo “Employee” having “employeeId” as one of the attribute,Β and employee object is available in camel exchange body, we can retrieve the employee id with following statement. simple(“${body.employeeId}”); If by chance body is…
How to set execution environment and target environment JRE in maven projects
By default when we create a maven project, it is configured to use JRE5 and will try to find a compatible JRE/JDK. Hence If you are using eclipse IDE, you will find below warning in “Markers” tab. If your source and target JDK is other than JDK5, then you can…
Apache Camel – Index of Map or List from camel routes
From inside a camel route we can retrieve the value by using its index easily. To retrieve an item from a list by using index, use below code which will reads the list object in the exchange body and retrieves the value in position 2. simple(“${body[2].name}”) To retrieve an item…
Check the size of a List/Map from Apache camel route
We can check the size of a java.util.ListΒ using below code. .choice() .when(simple(“${body.size() > 10}”)) .log(LoggingLevel.INFO, “List size is greater than 10”) .when(simple(“${body.size() > 0}”)) .log(LoggingLevel.INFO, “List size is greater than 0”) .otherwise() .log(LoggingLevel.INFO, “List is empty”) .endChoice() Same logic can be used for other collection objects in Java. Please not…
Validating the class of Object available in camel exchange body
In camel routes, we can validateΒ the class of object available in Camel exchange body. It can be achieved by using below code: CamelContext context = new DefaultCamelContext(); try { context.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { from(“direct:validateInputObject”) .choice() .when(simple(“${body} is ‘java.util.List'”)) .log(LoggingLevel.INFO, “Body contains java.util.List object”) .when(simple(“${body}…
Logger in Apache Camel routes
Yes, we can log messages from Camel route, and can define different log levels for each log message. In order to add logger, first you need to add required additional dependencies to your application. Then add log4j.properties or log4j.xml to the application classpath. log4j.properties Add below line to your properties file to enable debugging…
Steps to configure and run maven web application using tomcat
For maven web application, it can be run in tomcat server without installing tomcat server locally!! Yes, its true!! Here maven provides a plugin for tomcat instance, which will used to deploy and run the web application using a simple maven command “tomcat7:run”. For this, first we have to configure…
Maven Web Project – Deploy using embedded tomcat server
Maven provides support for running web applications in embedded tomcat server. Use the following steps to configure local tomcat server and run it using maven command: Add maven dependency for tomcat embedded plugin to web project 2. Use following maven command to run the application in embedded tomcat server