Home Navigation

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

Wednesday 21 December 2016

application.xml file is not created when created EAR project in RSA

This might happen when you create EAR project and don't check the option to generate application.xml file.

If the application.xml file is missing, you can try by this way

Project -> Right click -> Java EE -> Open Application Server Deployment Descriptor Or

Project -> Right click -> Java EE -> Generate Deployment Descriptor

Could not find a valid parent module to add to the server when try to run a web application in webshpere RSA

Problem: When try to run a webapplication using RSA, right click project -> Run as -> Server, then it shows an error message that Could not find a valid parent module to add to the server

Solutions: There are two possible solutions
Option - 1:
                 Create the project project from the scratch and make sure to select the option "Add project to an                  EAR" in create dynamic webproject window

Option - 2:
                Create an EAR project and then add the web application project as a web module in EAR                     project

Monday 19 December 2016

Microservices basics

There is no formal definition of microservices but we can summarize in short, the mircoservice architectural style is an approach to developing a single application as a suite of small services, each running its own process and communicating with lightweight mechanisms ( http resource api, REST, messaging queue) . So it introduces distributed computing and synchronization communication.

These services are built around business capabilities and dependently deploy-able by fully automated machinery.

We can attempt to describe microservices with its some characteristics

Monolothic vs Microservices


Componentization via services: Component is something independently replaceable and independently upgrade-able.
When we talk about component we think of two types of software component one is Library as component that are linked into a program and called using in-memory function calls, while service runs on his own process who communicate with a mechanism such as a web service. In microservices we consider component as service not library.

Organize around business capabilities: 

The microservice approach to division is different, splitting up into services organized around business capability. Such services take a broad-stack implementation of software for that business area, including user-interface, persistant storage, and any external collaborations. Consequently the teams are cross-functional, including the full range of skills required for the development: user-experience, database, and project management.

Products not projects:

Smart endpoints and dumb pipes: When building communication structures between different processes, we've seen many products and approaches that stress putting significant smarts into the communication mechanism itself. A good example of this is the Enterprise Service Bus (ESB), where ESB products often include sophisticated facilities for message routing, choreography, transformation, and applying business rules.

The microservice community favours an alternative approach: smart endpoints and dumb pipes. Applications built from microservices aim to be as decoupled and as cohesive as possible - they own their own domain logic and act more as filters in the classical Unix sense - receiving a request, applying logic as appropriate and producing a response. These are choreographed using simple RESTish protocols rather than complex protocols such as WS-Choreography or BPEL or orchestration by a central tool.

The two protocols used most commonly are HTTP request-response with resource API's and lightweight messaging

Decentralized Governance: It made the system loosely coupled.

Decentralized Data Management: Every mirco service is resposible for its own data model and data.


Infrastructure Automation: Infrastructure automation techniques have evolved enormously over the last few years - the evolution of the cloud and AWS in particular has reduced the operational complexity of building, deploying and operating microservices.

Many of the products or systems being build with microservices are being built by teams with extensive experience of Continuous Delivery and it's precursor, Continuous Integration. Teams building software this way make extensive use of infrastructure automation techniques.

You also need to have a good monitoring system to monitor all the services

Design for failure: This is one of the most important characteristics. Your architecture should handle if any of the service goes offline. You have to have an alternative way of routing the failure service.

Evolutionary Design: Microservice practitioners, usually have come from an evolutionary design background and see service decomposition as a further tool to enable application developers to control changes in their application without slowing down change. Change control doesn't necessarily mean change reduction - with the right attitudes and tools you can make frequent, fast, and well-controlled changes to software.

Whenever you try to break a software system into components, you're faced with the decision of how to divide up the pieces - what are the principles on which we decide to slice up our application? The key property of a component is the notion of independent replacement and upgradeability - which implies we look for points where we can imagine rewriting a component without affecting its collaborators. Indeed many microservice groups take this further by explicitly expecting many services to be scrapped rather than evolved in the longer term.

Key to microservices are
- Divide component by business capabilities
- Each microservice should have his own datastore
- Stateless communication
- A good team, ideal two pizza method

Ref: Martin fowler

org.eclipse.jgit.api.errors.TransportException, This exception shows when push/pull to git remote repo from eclipse

Problem:


Solutions:

Window->Preference->Team->Git->Add Entry button

And put the following: key=http.sslVerify, value=false


Try the git command push/pull, it should be working now.