Home Navigation

Tuesday, 25 April 2017

Introduction to spring cloud platform

Spring Cloud provides tools for developers to quickly build some of the common patterns in distributed systems (e.g. configuration management, service discovery, circuit breakers, intelligent routing, micro-proxy, control bus, one-time tokens, global locks, leadership election, distributed sessions, cluster state). Coordination of distributed systems leads to boiler plate patterns, and using Spring Cloud developers can quickly stand up services and applications that implement those patterns. They will work well in any distributed environment, including the developer's own laptop, bare metal data centres, and managed platforms such as Cloud Foundry.

Spring cloud is based on Netflix OSS components. It integrates the Netflix components in the spring development environment using auto configuration and convention over configuration similar to the way Spring Boot works.


Operations Component
Netflix, Spring, ELK
Service Discovery server
Netflix Eureka
Dynamic Routing and Load balancer
Netflix Ribbon
Circuit Breaker
Netflix Hystrix
Monitoring
Hystrix dashboard and Turbine
Edge Server
Netflix Zuul
Central Configuration server
Spring cloud config server
OAuth 2.0 protected API’s
Spring Cloud +
Spring Security OAuth2
Centralized log analyses
Logstash, Elasticsearch, Kibana (ELK)


Friday, 17 March 2017

Java collections comparison


HashMap
TreeMap
Ordering
It doesn’t maintain ordering
TreeMap  elements are sorted according to the natural ordering of its elements . If TreeMap objects can not be sorted in natural order than use compareTo() method to sort the elements of TreeMap object.
Implementation
Hashing
Red black tree
Null key
Can store null key
No null key
Null values
Many null values
Many null values
Performance
Constant time O(1) get and put, fast in performance.
TreeMap provides guaranteed log(n) time cost for the get and put method. Slow in comparison
Comparison
Uses equals method
Uses compareTo method
Interface
Map
Navigational Map
Similarities
Not thread safe, shallow copy, fail fast iterator

HashTable
HashMap
LinkedHashMap
Synchronized
Unsynchronized
It is a subclass of HashMap. It inherits all the features of HashMap. In addition linkedlist preserved the insertion order.
Doesn’t permit null key
Permits one null key

Thursday, 16 February 2017

Maven's Non-Resolvable Parent POM Problem

Problem: [FATAL] Non-resolvable parent POM: Failure to find com.mycompany.samples:biometrics-samples:pom:4.2.0.0

Solution: Check if the maven installation is correct. Go to eclipse Window->Preference->Maven ->installations

Locate your external Maven installation directory

Then go to Maven->User settings and add the global settings.xml to {MAVEN_INSTALLATION}\conf\settings.xml and update and rebuild index.

Last step, right click on project -> mavne -> update projects and make sure to select force update option as well and click the button OK

It should resolve the issue.

Tuesday, 24 January 2017

DB2, SQLState: 56038, Error Code -4743, -4700

Functions that this release of DB2 introduces cannot be used before new function mode has been enabled. An attempt was made to execute one of these functions. In addition, support for extending the length of a VARCHAR (supported in V7) is restricted in V8 until new function mode has been enabled.


This error you might get when your project was compiled, configured and deployed using webshpere version 7 and you are trying to compile and deploy in websphere 8.5

To solve the issue, create and map new jdbc connection from ear deployment descriptor.

Ear project->Deployment descriptor->deployment tab-> remove all the existing jdbc configuration and configure the jdbc and jndi mapping again with DB2.

Thursday, 12 January 2017

A Resource reference binding could not be found for the jdbc/mydb resource CWNEN0044E

You need to add the binding in ibm-web-bnd.xml:

<resource-ref name="jdbc/mydb" binding-name="jdbc/jndi" />

jdbc/jndi: You will configure jndi in websphere admin console,
Reference name: resource-ref name should match with res-ref-name

<resource-ref>
    <res-ref-name>jdbc/mydb</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
 </resource-ref>

You should also make sure that <web-app version of web.xml file should be 2.5 or up and use schema not dtd. If you use older version of J2EE you have to use ibm-web-bnd.xmi file instead of xml.

Tuesday, 27 December 2016

Challenges with Microservices


  • Complexity has moved out of the application, but into the operations layer
  • Services may be unavailable: Much more monitoring needed.
  • Remote calls more expensive than in-process calls
  • Transactions: Must rely on eventual consistency over ACID
  • Features span multiple services
  • Change management becomes a different challenge, need to consider the interaction of services, Dependency management / versions
  • Refactoring module boundaries
Fallacies of distributed computing:
  • The network is reliable
  • Latency is zero
  • Bandwidth is infinite
  • The network is secure
  • Topology doesn't change
  • There is one administrator
  • Transport cost is zero
  • The network is homogeneous

Thursday, 22 December 2016

Configure Auto Deploy option Websphere 8 application server

- Login to websphere application server admin console, then go to the application->Global deployment settings


- Make sure to check mark the option "Monitor directory to automatically deploy application
- Give a directory path as your wish, or you may keep the default one which is reside in the Installation_root directory.
- Set the polling interval


I have set the below options


- Save and apply the settings and restart your server

make sure the directory you set is exists



Now drop EAR, WAR, JAR file to C:\RSA\monitoredDeployableApps\servers\server1, the application will be installed automatically. Monitor directory to automatically deploy applications.

To uninstall an application file that was previously installed using monitored directory

You can also install, update, or uninstall an application file by dragging or copying an application properties file to a monitored directory. The properties file must specify the deployment actions to be performed.

By default, monitored directory deployment is disabled.

Monitored directory
Specifies the directory to use for monitored directory deployment. The default monitored directory is monitoredDeployableApps. Using this setting, you can specify a different default monitored directory.

For deployment by dragging or copying an enterprise application file to a monitored directory, the directory to which you add enterprise application files depends upon the product profile:

•For base (stand-alone) application servers, the default monitored directory is the monitoredDeployableApps/servers/server_name directory of the application server profile.

•For deployment managers, the default monitored directories are the monitoredDeployableApps/servers/server_name, monitoredDeployableApps/nodes/node_name/servers/server_name, and monitoredDeployableApps/clusters/cluster_name directories of the deployment manager profile.

For deployment using properties files, the monitored directory is a subdirectory named deploymentProperties of the directory specified by this setting; for example, monitoredDeployableApps/deploymentProperties.

To change the default monitored directory, specify a different directory path for this setting. List the entire value for the directory, including the environment variable. Monitor directory to automatically deploy applications must be enabled to change this setting.

REF: http://www.webspheretools.com/sites/webspheretools.nsf/docs/WebSphere%208%20Auto%20Deploy