<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"><channel><title>Krishna's page</title><description>...Mavin solutions</description><managingEditor>noreply@blogger.com (Krishna)</managingEditor><pubDate>Mon, 27 Oct 2025 02:27:50 -0500</pubDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">310</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">25</openSearch:itemsPerPage><link>http://www.krishnaspage.com/</link><language>en-us</language><item><title>Latest Versions of TechStack</title><link>http://www.krishnaspage.com/2022/01/latest-versions-of-techstack.html</link><category>Java</category><category>Technical</category><pubDate>Fri, 28 Jan 2022 00:15:00 -0600</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-9176469332786875180</guid><description>&lt;p style="text-align: center;"&gt;&lt;b&gt;&amp;nbsp;Latest Versions of TechStack&lt;/b&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;br /&gt;&lt;/p&gt;
&lt;style&gt;
table, th, td {
  border:1px solid black;
}
&lt;/style&gt;
  &lt;table style="width: 100%;"&gt;
  &lt;tbody&gt;&lt;tr&gt;
    &lt;th&gt;Software&lt;/th&gt;
    &lt;th&gt;Used Version(s)&lt;/th&gt;
    &lt;th&gt;Current&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Java&lt;/td&gt;
    &lt;td&gt;8,13&lt;/td&gt;
    &lt;td&gt;Java SE 17 (LTS)&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Spring boot&lt;/td&gt;
    &lt;td&gt;2.3.12&lt;/td&gt;
    &lt;td&gt;2.6.3&lt;/td&gt;
  &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td&gt;Angular&lt;/td&gt;
    &lt;td&gt; NA  &lt;/td&gt;
    &lt;td&gt;13.1.1&lt;/td&gt;
  &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td&gt;Android studio&lt;/td&gt;
    &lt;td&gt; NA  &lt;/td&gt;
    &lt;td&gt;4.1&lt;/td&gt;
  &lt;/tr&gt;
     &lt;tr&gt;
    &lt;td&gt;Lombok&lt;/td&gt;
    &lt;td&gt;v1.17&lt;/td&gt;
    &lt;td&gt;v1.18.22&lt;/td&gt;
  &lt;/tr&gt;
     &lt;tr&gt;
    &lt;td&gt;Log4j 2&lt;/td&gt;
    &lt;td&gt;2.17.1 &lt;/td&gt;
    &lt;td&gt;2.17.1&lt;/td&gt;
  &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td&gt;Oracle&lt;/td&gt;
    &lt;td&gt;12&lt;/td&gt;
    &lt;td&gt;19c&lt;/td&gt;
  &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td&gt;Springfox swagger&lt;/td&gt;
    &lt;td&gt;2.9.2&lt;/td&gt;
    &lt;td&gt;3.0.0&lt;/td&gt;
  &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td&gt;Resiliance 4j&lt;/td&gt;
    &lt;td&gt;1.7&lt;/td&gt;
    &lt;td&gt;1.7.1&lt;/td&gt;
  &lt;/tr&gt;
        &lt;tr&gt;
    &lt;td&gt;Jenkins&lt;/td&gt;
    &lt;td&gt;2.324&lt;/td&gt;
    &lt;td&gt;2.324&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>Apache Kafka - FAQs</title><link>http://www.krishnaspage.com/2020/11/apache-kafka-faqs.html</link><category>Java</category><category>Kafka</category><category>Technical</category><pubDate>Thu, 28 Nov 2019 18:39:00 -0600</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-2998874686878769920</guid><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Apache Kafka :&lt;/b&gt; an open-source message broker project developed by the Apache Software Foundation written in Scala and is a distributed publish-subscribe messaging system.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Features of kafka&amp;nbsp;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;High Throughpu&lt;/b&gt;t&lt;span style="white-space: pre;"&gt;	&lt;/span&gt;: Support for millions of messages with modest hardware&lt;/p&gt;&lt;p&gt;&lt;b&gt;Scalability&lt;/b&gt; : &lt;span style="white-space: pre;"&gt;	&lt;/span&gt;Highly scalable distributed systems with no downtime&lt;/p&gt;&lt;p&gt;&lt;b&gt;Replication&lt;/b&gt;&lt;span style="white-space: pre;"&gt;	&lt;/span&gt;: Messages are replicated across the cluster to provide support for multiple subscribers and balances the consumers in case of failures&lt;/p&gt;&lt;p&gt;&lt;b&gt;Durability&lt;/b&gt;&lt;span style="white-space: pre;"&gt;	&lt;/span&gt;Provides support for persistence of message to disk&lt;/p&gt;&lt;p&gt;&lt;b&gt;Stream Processing&lt;/b&gt;&lt;span style="white-space: pre;"&gt;	&lt;/span&gt;Used with real-time streaming applications like Apache Spark &amp;amp; Storm&lt;/p&gt;&lt;p&gt;&lt;b&gt;Data Loss&lt;/b&gt;&lt;span style="white-space: pre;"&gt;	&lt;/span&gt;Kafka with proper configurations can ensure zero data loss&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Various components of Kafka:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Topic&lt;/b&gt; – a stream of messages belonging to the same type&lt;/p&gt;&lt;p&gt;&lt;b&gt;Producer&lt;/b&gt; – that can publish messages to a topic&lt;/p&gt;&lt;p&gt;&lt;b&gt;Brokers &lt;/b&gt;– a set of servers where the publishes messages are stored&lt;/p&gt;&lt;p&gt;&lt;b&gt;Consumer&lt;/b&gt; – that subscribes to various topics and pulls data from the brokers.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Topic :&amp;nbsp;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Topic is like a table identified by name.&lt;/p&gt;&lt;p&gt;Topic is split in partitions.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Topic 1&lt;/b&gt; -- Partition 0, partition 1 , partition 2.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Explain the role of the offset.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Messages contained in the partitions are assigned a unique ID number that is called the offset. The role of the offset is to uniquely identify every message within the partition.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;kafka stores offsets at which consumer group has been reading.&lt;/li&gt;&lt;li&gt;offsets will be stored in a separate topic called "_consumer_offsets"&lt;/li&gt;&lt;li&gt;When consumer has processed data received from kafka it should be committing the offsets.&amp;nbsp;&lt;/li&gt;&lt;li&gt;offset is specific to a partition. because offset 3 in partion 1 and 2 are not same.&amp;nbsp;&lt;/li&gt;&lt;li&gt;offset is in order with in a partition.&lt;/li&gt;&lt;li&gt;data / offsets kept only for one week by default.&amp;nbsp;&lt;/li&gt;&lt;li&gt;once data written cant be changed (immutable)&lt;/li&gt;&lt;li&gt;Data is assigned randomly to a partition if we dont specify key&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;What is a Consumer Group?&lt;/b&gt;&lt;/p&gt;&lt;p&gt;To enhance parallelism.&lt;/p&gt;&lt;p&gt;Consumer Groups is a concept exclusive to Kafka.&amp;nbsp; Every Kafka consumer group consists of one or more consumers that jointly consume a set of subscribed topics.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;You cant have more consumers than partitions.&amp;nbsp;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;if you have 3 partitions u should not have 4 consumers in one group. because consumers in a group shares the partitions. if we have 3 partitions for a topic and 4 consumers in a group each consumer connects to one partitions and 4th one become idle and do nothing.&amp;nbsp;&lt;/p&gt;&lt;p&gt;consumer has to specify broker name and topic name to read and kafka will take care of pulling data from right brokers&amp;nbsp;&lt;/p&gt;&lt;p&gt;Messages are read in order like 0,1,2,... but in parallel across the partitions.&amp;nbsp;&lt;/p&gt;&lt;p&gt;B1 - Topic 1 - partition 0 - 0,1,2,3,4&lt;/p&gt;&lt;p&gt;B2 - Topic 2 - partition 1 - 0,1,2,3,4,5,6,7&lt;/p&gt;&lt;p&gt;Each consumer within a group read from exclusive partitions.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Brokers&amp;nbsp;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;A Kafka&amp;nbsp; cluster is composed of multiple brokers(servers)&lt;/li&gt;&lt;li&gt;Each broker contains certain topic partitions.&lt;/li&gt;&lt;li&gt;After connecting to any broker , you will be connected to entire cluster.&amp;nbsp;&lt;/li&gt;&lt;li&gt;A cluster with 3 brokers can be seen as follows , data is distributed with partitions.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Broker 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Broker 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Broker 3&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Topic 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Topic 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Topic 1&amp;nbsp;&lt;/p&gt;&lt;p&gt;P-0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;P-2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;P-1&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Topic 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Topic 2 &lt;span style="white-space: pre;"&gt;			&lt;/span&gt; Topic 1&lt;/p&gt;&lt;p&gt;P-1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;P-0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; P-0&amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Replication Factor always &amp;gt; 1&amp;nbsp;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Partitions :&amp;nbsp;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;Partitions are the main concurrency mechanism in kafka.&amp;nbsp;&lt;/li&gt;&lt;li&gt;A topic is divided into 1 or more partitions enabling producer and consumer loads to be scaled.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;What is the role of the ZooKeeper?&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Kafka uses Zookeeper to store offsets of messages consumed for a specific topic and partition by a specific Consumer Group.&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;nbsp;Is it possible to use Kafka without ZooKeeper?&lt;/b&gt;&lt;/p&gt;&lt;p&gt;No, it is not possible to bypass Zookeeper and connect directly to the Kafka server. If, for some reason, ZooKeeper is down, you cannot service any client request.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Explain the concept of Leader and Follower.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Every partition in Kafka has one server which plays the role of a Leader, and none or more servers that act as Followers. The Leader performs the task of all read and write requests for the partition, while the role of the Followers is to passively replicate the leader. In the event of the Leader failing, one of the Followers will take on the role of the Leader. This ensures load balancing of the server.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Why are Replications critical in Kafka? Kafka is durable with replications.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Replication ensures that published messages are not lost and can be consumed in the event of any machine error, program error or frequent software upgrades.&lt;/p&gt;&lt;p&gt;&lt;b&gt;How do you define a Partitioning Key?&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Within the Producer, the role of a Partitioning Key is to indicate the destination partition of the message. By default, a hashing-based Partitioner is used to determine the partition ID given the key. Alternatively, users can also use customized Partitions.&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>New Features in Java 13</title><link>http://www.krishnaspage.com/2019/11/new-features-in-java-13.html</link><pubDate>Wed, 13 Nov 2019 23:04:00 -0600</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-8412685682651586311</guid><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;h2 style="background-color: white; box-sizing: border-box; color: #333333; font-family: Raleway; font-weight: 300; letter-spacing: -1.5px; line-height: 1; margin: 60px 0px 10px; text-align: left;"&gt;&lt;span style="font-size: large;"&gt;New Features in Java 13&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;span style="background-color: white; font-family: Raleway; font-size: 18px;"&gt;We initially saw switch expressions in JDK 12 itself,&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: white; font-family: Raleway; font-size: 18px;"&gt;build on the previous version by adding a new&amp;nbsp;&lt;/span&gt;&lt;em style="background-color: white; box-sizing: border-box; font-family: Raleway; font-size: 18px;"&gt;&lt;b&gt;yield&lt;/b&gt;&lt;/em&gt;&lt;span style="background-color: white; font-family: Raleway; font-size: 18px;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;statement.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="background-color: white; font-family: Raleway; font-size: 18px;"&gt;&lt;b&gt;Text Blocks&lt;/b&gt; - To embed JSON , XML etc to avoid escaping in the strings.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="background-color: white; font-family: Raleway; font-size: 18px;"&gt;Class data sharing (CDS)&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="background-color: white; font-size: 18px;"&gt;&lt;span style="font-family: Raleway;"&gt;ZGC: Uncommit Unused Memory&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="background-color: white; font-size: 18px;"&gt;&lt;span style="font-family: Raleway;"&gt;Reimplement the Legacy Socket API&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>GIT Eclipse usage basic</title><link>http://www.krishnaspage.com/2017/08/git-eclipse-usage-basic.html</link><category>Java</category><pubDate>Wed, 2 Aug 2017 10:10:00 -0500</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-3114236544451657869</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div style="text-align: center;"&gt;
&lt;b&gt;GIT- Basics &amp;amp; Eclipse Usage&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
This post aim at very basic usage of using GIT based tools and eclipse configurations for the same.&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;&lt;b&gt;create a new repository : &lt;/b&gt;create a new directory, open it and perform a&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;git init&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
to create a new git repository.&lt;br /&gt;
&lt;div style="text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;&lt;b&gt;checkout a repository : &lt;/b&gt;Create a working copy of a local repository by running the command&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;git clone /path/to/repository&lt;/b&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
when using a remote server, your command will be&lt;br /&gt;
&lt;div&gt;
&lt;div style="text-align: left;"&gt;
git clone username@host:/path/to/repository&lt;br /&gt;
&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;Goto project dir&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
1. git init&lt;br /&gt;
2. git status&lt;br /&gt;
3.git add .&lt;br /&gt;
4. git status&lt;br /&gt;
5. git commit -m "first commit"&lt;br /&gt;
6. Create an empty repo in GITHUB&lt;br /&gt;
7.copy clone url&lt;br /&gt;
8.git remote add origin &amp;lt;&amp;lt; URL &amp;gt;&amp;gt;&lt;url&gt;&lt;/url&gt;&lt;br /&gt;
9.git push -u origin master&lt;br /&gt;
10. Check your files are there on GIT remote&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;To add more / update files&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;git add .&amp;nbsp;&lt;/li&gt;
&lt;li&gt;git status&amp;nbsp;&lt;/li&gt;
&lt;li&gt;git commit -m "second commit"&lt;/li&gt;
&lt;li&gt;git push -u origin master&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>Static keyword in java</title><link>http://www.krishnaspage.com/2020/02/static-keyword-in-java.html</link><pubDate>Mon, 27 Feb 2017 00:28:00 -0600</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-752640518347392707</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;h1 class="entry-title" itemprop="headline" style="border: 0px; font-family: inherit; font-size: 30px; font-style: inherit; font-weight: 300; line-height: 1.2em; margin: 0px; padding: 0px;"&gt;
Static keyword in java&lt;/h1&gt;
&lt;div class="entry-content" dir="auto" itemprop="text" style="background-color: white; border: 0px; margin: 2em 0px 0px; padding: 0px;"&gt;
&lt;div style="border: 0px; color: #3a3a3a; font-family: helvetica; font-size: 17px; margin: 0px 0px 1.5em; padding: 0px;"&gt;
The&amp;nbsp;&lt;span style="border: 0px; font-weight: 700; margin: 0px; padding: 0px;"&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style="border: 0px; font-weight: 700; margin: 0px; padding: 0px;"&gt;keyword&amp;nbsp;&lt;/span&gt;in java&lt;span style="border: 0px; font-weight: 700; margin: 0px; padding: 0px;"&gt;&amp;nbsp;&lt;/span&gt;is used for memory management in JAVA. Static keywords belong to the class rather than the instance/object of a class.&lt;/div&gt;
&lt;div style="border: 0px; color: #3a3a3a; font-family: helvetica; font-size: 17px; margin: 0px 0px 1.5em; padding: 0px;"&gt;
We can use&amp;nbsp;&lt;span style="border: 0px; font-weight: 700; margin: 0px; padding: 0px;"&gt;static&lt;/span&gt;&amp;nbsp;keywords with:&lt;/div&gt;
&lt;ol style="border: 0px; color: #3a3a3a; font-family: helvetica; font-size: 17px; list-style-position: initial; margin: 0px 0px 1.5em 3em; padding: 0px;"&gt;
&lt;li style="border: 0px; margin: 0px; padding: 0px;"&gt;&lt;span style="border: 0px; font-weight: 700; margin: 0px; padding: 0px;"&gt;Variable&lt;/span&gt;&lt;/li&gt;
&lt;li style="border: 0px; margin: 0px; padding: 0px;"&gt;&lt;span style="border: 0px; font-weight: 700; margin: 0px; padding: 0px;"&gt;Method&lt;/span&gt;&lt;/li&gt;
&lt;li style="border: 0px; margin: 0px; padding: 0px;"&gt;&lt;span style="border: 0px; font-weight: 700; margin: 0px; padding: 0px;"&gt;Block&lt;/span&gt;&lt;/li&gt;
&lt;li style="border: 0px; margin: 0px; padding: 0px;"&gt;&lt;span style="border: 0px; font-weight: 700; margin: 0px; padding: 0px;"&gt;Class&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 style="border: 0px; color: #3a3a3a; font-family: inherit; font-size: 20px; font-style: inherit; font-weight: 400; line-height: 1.2em; margin: 0px 0px 20px; padding: 0px;"&gt;
&lt;span style="border: 0px; font-weight: 700; margin: 0px; padding: 0px;"&gt;1. Static variable in Java&lt;/span&gt;&lt;/h3&gt;
&lt;div style="border: 0px; color: #3a3a3a; font-family: helvetica; font-size: 17px; margin: 0px 0px 1.5em; padding: 0px;"&gt;
You can declare a&amp;nbsp;&lt;span style="border: 0px; font-weight: 700; margin: 0px; padding: 0px;"&gt;static&lt;/span&gt;&amp;nbsp;variable by simply use of&amp;nbsp;&lt;span style="border: 0px; font-weight: 700; margin: 0px; padding: 0px;"&gt;static&lt;/span&gt;&amp;nbsp;keyword with a variable.&amp;nbsp;&lt;/div&gt;
&lt;ul style="border: 0px; color: #3a3a3a; font-family: helvetica; font-size: 17px; list-style-position: initial; margin: 0px 0px 1.5em 3em; padding: 0px;"&gt;
&lt;li style="border: 0px; margin: 0px; padding: 0px;"&gt;Static variables are also known as a class variable because they are associated with the class and common for all the objects of a class.&lt;/li&gt;
&lt;li style="border: 0px; margin: 0px; padding: 0px;"&gt;Static variables are declared using the static keyword within a class outside any method/constructor/block.&lt;/li&gt;
&lt;li style="border: 0px; margin: 0px; padding: 0px;"&gt;When a class created then one copy of a static variable created in memory. Static variables would be common for all objects of class because a static variable is associated with a class.&amp;nbsp;&lt;/li&gt;
&lt;li style="border: 0px; margin: 0px; padding: 0px;"&gt;Static variables are created at the start of program execution and destroyed automatically when execution ends.&lt;/li&gt;
&lt;li style="border: 0px; margin: 0px; padding: 0px;"&gt;Initialization of Static Variable is not Mandatory. Its default value is depending on the data type of variable.&lt;/li&gt;
&lt;li style="border: 0px; margin: 0px; padding: 0px;"&gt;If we access the static variable through an object the compiler will show the warning message. The compiler will replace the object name to the class name automatically.&lt;/li&gt;
&lt;li style="border: 0px; margin: 0px; padding: 0px;"&gt;We can create static variables at class-level only.&lt;/li&gt;
&lt;/ul&gt;
&lt;div dir="auto"&gt;
&lt;h3 style="border: 0px; color: #3a3a3a; font-family: helvetica; font-size: 20px; font-weight: 400; line-height: 1.2em; margin: 0px 0px 20px; padding: 0px;"&gt;
&lt;span style="border: 0px; font-weight: 700; margin: 0px; padding: 0px;"&gt;2. Static method in Java&lt;/span&gt;&lt;/h3&gt;
&lt;div style="border: 0px; color: #3a3a3a; font-family: helvetica; font-size: 17px; margin: 0px 0px 1.5em; padding: 0px;"&gt;
You can declare a static method by using of static keyword.&lt;/div&gt;
&lt;div style="border: 0px; color: #3a3a3a; font-family: helvetica; font-size: 17px; margin: 0px 0px 1.5em; padding: 0px;"&gt;
1. Static methods are belonging to a class.&lt;br /&gt;
2. You can access a static method by using the class name. You do not have the need to create an object.&lt;br /&gt;
3. A static method can access only static variables. If you write any non-static variable in a static method, then it will throw an exception at compilation time.&lt;/div&gt;
&lt;div style="border: 0px; color: #3a3a3a; font-family: helvetica; font-size: 17px; margin: 0px 0px 1.5em; padding: 0px;"&gt;
&lt;span style="border: 0px; font-weight: 700; margin: 0px; padding: 0px;"&gt;Why a static method is important&lt;/span&gt;:&amp;nbsp;&lt;/div&gt;&lt;div style="border: 0px; margin: 0px 0px 1.5em; padding: 0px;"&gt;&lt;span style="color: #3a3a3a; font-family: helvetica;"&gt;&lt;span style="font-size: 17px;"&gt;A static method has two main purposes: &lt;b&gt;For utility or helper methods that don't require any object state&lt;/b&gt;. Since there is no need to access instance variables, having static methods eliminates the need for the caller to instantiate the object just to call the method.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="border: 0px; margin: 0px 0px 1.5em; padding: 0px;"&gt;&lt;span style="color: #3a3a3a; font-family: helvetica;"&gt;&lt;span style="font-size: 17px;"&gt;Ex: &lt;b&gt;To know KM to Miles someone doesnt to build a car object. Car.convertKMtoMiles(25).&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="border: 0px; color: #3a3a3a; font-family: helvetica; font-size: 17px; margin: 0px 0px 1.5em; padding: 0px;"&gt;Static method can access without any object. They can access directly by class name. The most common example of a static method is&amp;nbsp;&lt;span style="border: 0px; font-style: italic; margin: 0px; padding: 0px;"&gt;main( )&lt;/span&gt;&amp;nbsp;method. If it were a non-static method, JVM creates an object first then call main() method that will lead the problem of extra memory allocation.&lt;/div&gt;
&lt;h3 style="border: 0px; color: #3a3a3a; font-family: helvetica; font-size: 20px; font-weight: 400; line-height: 1.2em; margin: 0px 0px 20px; padding: 0px;"&gt;
&lt;span style="border: 0px; font-weight: 700; margin: 0px; padding: 0px;"&gt;3. Static block in Java&lt;/span&gt;&lt;/h3&gt;
&lt;div style="border: 0px; color: #3a3a3a; font-family: helvetica; font-size: 17px; margin: 0px 0px 1.5em; padding: 0px;"&gt;
If you want to do some calculation and initialize the static variables you can use&amp;nbsp;&lt;span style="border: 0px; font-weight: 700; margin: 0px; padding: 0px;"&gt;static block&lt;/span&gt;. The static block is get executed once when the class is first loaded.&lt;/div&gt;
&lt;h2 style="border: 0px; color: #3a3a3a; font-family: helvetica; font-size: 25px; font-weight: 300; line-height: 1.2em; margin: 0px 0px 20px; padding: 0px;"&gt;
&lt;span style="border: 0px; font-weight: 700; margin: 0px; padding: 0px;"&gt;4. Static class in Java&lt;/span&gt;&lt;/h2&gt;
&lt;div style="border: 0px; color: #3a3a3a; font-family: helvetica; font-size: 17px; margin: 0px; padding: 0px;"&gt;
&lt;span style="border: 0px; font-weight: 700; margin: 0px; padding: 0px;"&gt;&lt;/span&gt;You can read the static class from&amp;nbsp;my previous post&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
-- &lt;br /&gt;
&lt;div class="gmail_signature" data-smartmail="gmail_signature" dir="ltr"&gt;
&lt;div dir="ltr"&gt;
&lt;div&gt;
&lt;div dir="ltr"&gt;
&lt;div&gt;
Cheers &lt;span style="font-family: &amp;quot;arial&amp;quot;;"&gt;☺&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span color="rgb(153 , 153 , 153)"&gt;Krishna babu Ghanta&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span color="rgb(153 , 153 , 153)"&gt;Mobile : 303-886-1490&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #999999;"&gt;&lt;b&gt;Linked In :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;a href="https://www.linkedin.com/in/krishnabab/" target="_blank"&gt;https://www.linkedin.com/in/krishnabab/&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span color="rgb(153 , 153 , 153)"&gt;Time zone : CST&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>Spring architecture and  Spring boot </title><link>http://www.krishnaspage.com/2020/02/spring-architecture-and-spring-boot.html</link><category>Java</category><category>Springboot</category><category>Technical</category><pubDate>Sun, 26 Feb 2017 23:21:00 -0600</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-6244204201697784141</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Spring is well-organized architecture consisting&amp;nbsp; of seven modules. Modules in the Spring framework are:&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRXe0o8pVmdJ6sU_fPrhm3fyMsOtn1Sri5os6Kcjqyfgz1ExqwiVJgvhl3Ek7QlrWW-TiZUGgXawuzJx_3Z2D7zsFBlBriGp4R5MIKsB5k4zsZHU722kfvlG2Zwh6FKwa51Z-HZ_PlGzhH/s640/springFramework2.jpg" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" data-original-height="432" data-original-width="631" height="438" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRXe0o8pVmdJ6sU_fPrhm3fyMsOtn1Sri5os6Kcjqyfgz1ExqwiVJgvhl3Ek7QlrWW-TiZUGgXawuzJx_3Z2D7zsFBlBriGp4R5MIKsB5k4zsZHU722kfvlG2Zwh6FKwa51Z-HZ_PlGzhH/s640/springFramework2.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Spring AOP&lt;/b&gt;&lt;br /&gt;
One of the key components of Spring is the AOP framework. AOP is used in Spring:&lt;br /&gt;
&lt;br /&gt;
To provide declarative enterprise services, especially as a replacement for EJB declarative services. The most important such service is declarative transaction management, which builds on Spring’s transaction abstraction.&lt;br /&gt;
To allow users to implement custom aspects, complementing their use of OOP with AOP&lt;br /&gt;
&lt;b&gt;Spring ORM&lt;/b&gt;&lt;br /&gt;
The ORM package is related to the database access. It provides integration layers for popular object-relational mapping APIs, including JDO, Hibernate and iBatis.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Spring Web&lt;/b&gt;&lt;br /&gt;
The Spring Web module is part of Spring?s web application development stack, which includes Spring MVC.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Spring DAO&lt;/b&gt;&lt;br /&gt;
The DAO (Data Access Object) support in Spring is primarily for standardizing the data access work using the technologies like JDBC, Hibernate or JDO.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Spring Context&lt;/b&gt;&lt;br /&gt;
This package builds on the beans package to add support for message sources and for the Observer design pattern, and the ability for application objects to obtain resources using a consistent API.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Spring Web MVC&lt;/b&gt;&lt;br /&gt;
This is the Module which provides the MVC implementations for the web applications.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Spring Core&lt;/b&gt;&lt;br /&gt;
The Core package is the most import component of the Spring Framework.&lt;br /&gt;
This component provides the Dependency Injection features. The BeanFactory&amp;nbsp; provides a factory pattern which separates the dependencies like initialization, creation and access of the objects from your actual program logic.&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRXe0o8pVmdJ6sU_fPrhm3fyMsOtn1Sri5os6Kcjqyfgz1ExqwiVJgvhl3Ek7QlrWW-TiZUGgXawuzJx_3Z2D7zsFBlBriGp4R5MIKsB5k4zsZHU722kfvlG2Zwh6FKwa51Z-HZ_PlGzhH/s72-c/springFramework2.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>Java Springboot Microservices FAQs</title><link>http://www.krishnaspage.com/2020/02/java-springboot-microservices-interview.html</link><category>Java</category><category>MicroServices</category><category>Springboot</category><pubDate>Sun, 26 Feb 2017 21:45:00 -0600</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-968176639836420459</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;span style="color: red;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;Is Spingboot thread-safe?&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;br /&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt; 
It depends. The main factor which determines the thread-safety of a component is its scope. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;
In a standard servlet-based Spring web application, every new HTTP request generates a new thread. If the container creates. a new bean instance just for that particular request, we can say this bean is thread-safe. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;
Is Spring singleton thread-safe? &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;
The short answer is: no, it isn't. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;
Reference:&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;a href="http://dolszewski.com/spring/spring-bean-thread-safety-guide/"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;http://dolszewski.com/spring / spring-bean-thread-safety-guide /&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;span style="color: red;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;Different scopes of beans ?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;ul&gt;&lt;li style="box-sizing: border-box;"&gt;singleton :&amp;nbsp;&lt;b style="background-color: white; color: #202124; font-family: Roboto, arial, sans-serif; font-size: 16px;"&gt;Singleton&lt;/b&gt;&lt;span style="background-color: white; color: #202124; font-family: Roboto, arial, sans-serif; font-size: 16px;"&gt;&amp;nbsp;is the default scope for a Bean&lt;/span&gt;&lt;/li&gt;&lt;li style="box-sizing: border-box;"&gt;prototype&lt;/li&gt;&lt;li style="box-sizing: border-box;"&gt;request&lt;/li&gt;&lt;li style="box-sizing: border-box;"&gt;session&lt;/li&gt;&lt;li style="box-sizing: border-box;"&gt;application&lt;/li&gt;&lt;li style="box-sizing: border-box;"&gt;websocket&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;span style="color: red;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;What are the disadvantages of Springboot?&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;Usually, it loads unwanted dependencies sometimes not of any use also, so it will create bulky jars for no use.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color: red;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;What are different design patterns you use in the Microservices ?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;b&gt;&amp;nbsp;Decomposition Patterns:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;	&lt;/span&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;b&gt;Decompose by Business Capability&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;	&lt;/span&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;b&gt;Decompose by Subdomain&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;	&lt;/span&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;b&gt;Strangler Pattern&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;b&gt;&amp;nbsp;Integration Patterns:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;	&lt;/span&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;b&gt;API Gateway Pattern&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;	&lt;/span&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;b&gt;Aggregator Pattern&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;	&lt;/span&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;b&gt;Client-Side UI Composition Pattern&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;b&gt;&amp;nbsp;Database Patterns&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&amp;nbsp; &lt;b&gt;Database per Service&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;	&lt;/span&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt; One database per microservice must be designed; it must be private to that service only. It should be accessed by the microservice API only. It cannot be accessed by other services directly. For example, for relational databases, we can use private-tables- Each microservice should have a separate database id so that separate access can be given to put up a barrier and prevent it from using other service tables. per-service, schema-per-service, or database-server-per-service.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&amp;nbsp; &lt;b&gt;Shared Database per Service&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;	&lt;/span&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;A shared database per service is not ideal, but that is the working solution for the above scenario. Most people consider this an anti-pattern for microservices, but for brownfield applications, this is a good start to break the application into smaller logical pieces. This should not be applied for greenfield applications. In this pattern, one database can be aligned with more than one microservice, but it has to be restricted to 2-3 maximum, otherwise scaling, autonomy, and independence will be challenging to execute.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&amp;nbsp; &lt;b&gt;Command Query Responsibility Segregation (CQRS)&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;	&lt;/span&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;CQRS suggests splitting the application into two parts — the command side and the query side. The command side handles the Create, Update, and Delete requests. The query side handles the query part by using the materialized views. The event sourcing pattern is generally used Materialized views are kept updated by subscribing to the stream of events.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&amp;nbsp; &lt;b&gt;Saga Pattern&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;	&lt;/span&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;A Saga represents a high-level business process that consists of several sub requests, which each update data within a single service. Each request has a compensating request that is executed when the request fails. It can be implemented in two ways:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;	&lt;/span&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;u&gt;Choreography&lt;/u&gt; — When there is no central coordination, each service produces and listens to another service's events and decides if an action should be taken or not.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;	&lt;/span&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;u&gt;Orchestration&lt;/u&gt; — An orchestrator (object) takes responsibility for a saga's decision making and sequencing business logic.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;	&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&amp;nbsp;&lt;b&gt; Observability Patterns&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;		&lt;/span&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;b&gt;Log Aggregation&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;		&lt;/span&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;b&gt;Performance Metrics:&lt;/b&gt; AppDynamics, Prometheus, Grafana&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;		&lt;/span&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;b&gt;Distributed Tracing: &lt;/b&gt;Zipkins, Slueth&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;		&lt;/span&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;b&gt;Health Check:&lt;/b&gt; Spring Boot Actuator&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&amp;nbsp; &lt;b&gt;Cross-Cutting Concern Patterns:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;		&lt;/span&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;b&gt;External Configuration:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;			&lt;/span&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;Externalize all the configuration, including endpoint URLs and credentials. The application should load them either at startup or on the fly.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;		&lt;/span&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;b&gt;Service Discovery Pattern&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;		&lt;/span&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;b&gt;Circuit Breaker Pattern&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="white-space: pre;"&gt;		&lt;/span&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;b&gt;Blue-Green Deployment Pattern&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;span style="color: red;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;How do we implement spring security?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt; 
Dependency:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;dependency&gt;&lt;/dependency&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;groupid&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;org.springframework.boot &lt;/span&gt;&lt;/span&gt;&lt;/groupid&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;artifactid&gt;&lt;b&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;spring-boot-starter-security&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/artifactid&gt;&lt;/div&gt;
&lt;br /&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;
start by creating a Spring Security configuration class that extends &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;WebSecurityConfigurerAdapter&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt; . By adding &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;@EnableWebSecurity,&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt; we get Spring Security and MVC integration support.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;rest security&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;security config class-&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;basic auth&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;authentication filter-&amp;gt; authentication object-&amp;gt; not validated-&amp;gt; authentication manager builder-&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;finds authetication providers-&amp;gt; like DAO or custom authentication provider&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;we can pass JWT token in header for authentication.&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;server validates if it is generated by itself.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p2" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 15px;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;session-based vs token based security.&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;tokens are stateless&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;requests can go to any node which doesn't understand previous session settings.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p2" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 15px;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;What is Bearer (ur the owner of the token) Vs Basic&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="p2" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 15px;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;after authentication is done only we get JWT token which is used for authorization&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span class="Apple-converted-space"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span class="Apple-converted-space"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;JWT --OAUTH Grant Types:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;implicit --Implicit Grant&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&lt;b&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;authorization_code --Authorization Code Grant-&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span face="Roboto, &amp;quot;Noto Sans&amp;quot;, &amp;quot;Noto Sans JP&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Noto Naskh Arabic&amp;quot;, &amp;quot;Noto Sans Thai&amp;quot;, &amp;quot;Noto Sans Hebrew&amp;quot;, &amp;quot;Noto Sans Bengali&amp;quot;, sans-serif" style="background-color: white; color: #202124; font-size: 16px;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt; This grant type flow is also called "three-legged" OAuth.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span face="Roboto, &amp;quot;Noto Sans&amp;quot;, &amp;quot;Noto Sans JP&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Noto Naskh Arabic&amp;quot;, &amp;quot;Noto Sans Thai&amp;quot;, &amp;quot;Noto Sans Hebrew&amp;quot;, &amp;quot;Noto Sans Bengali&amp;quot;, sans-serif" style="background-color: white; color: #202124; font-size: 16px;"&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span face="Roboto, &amp;quot;Noto Sans&amp;quot;, &amp;quot;Noto Sans JP&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Noto Naskh Arabic&amp;quot;, &amp;quot;Noto Sans Thai&amp;quot;, &amp;quot;Noto Sans Hebrew&amp;quot;, &amp;quot;Noto Sans Bengali&amp;quot;, sans-serif" style="background-color: white; color: #202124; font-size: 16px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span face="Roboto, &amp;quot;Noto Sans&amp;quot;, &amp;quot;Noto Sans JP&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Noto Naskh Arabic&amp;quot;, &amp;quot;Noto Sans Thai&amp;quot;, &amp;quot;Noto Sans Hebrew&amp;quot;, &amp;quot;Noto Sans Bengali&amp;quot;, sans-serif" style="background-color: white; color: #202124; font-size: 16px;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;You've seen this flow anytime your app opens a browser to the resource server's login page and invites you log in to your actual account (for example, Facebook or Twitter).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span face="Roboto, &amp;quot;Noto Sans&amp;quot;, &amp;quot;Noto Sans JP&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Noto Naskh Arabic&amp;quot;, &amp;quot;Noto Sans Thai&amp;quot;, &amp;quot;Noto Sans Hebrew&amp;quot;, &amp;quot;Noto Sans Bengali&amp;quot;, sans-serif" style="background-color: white; color: #202124; font-size: 16px;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;If you successfully log in, the app will receive an authorization code that it can use to negotiate an access token with the authorization server.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span face="Roboto, &amp;quot;Noto Sans&amp;quot;, &amp;quot;Noto Sans JP&amp;quot;, &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Noto Naskh Arabic&amp;quot;, &amp;quot;Noto Sans Thai&amp;quot;, &amp;quot;Noto Sans Hebrew&amp;quot;, &amp;quot;Noto Sans Bengali&amp;quot;, sans-serif" style="background-color: white; color: #202124; font-size: 16px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;client_credentials --Client Credentials Grant&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;password --Resource Owner Password Grant&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;refresh_token --Use Refresh Tokens&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span class="Apple-converted-space" style="font-size: 13px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;urn: ietf: params: oauth: grant-type: device_code --Device Authorization Grant&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;
Reference:&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;a href="https://developer.okta.com/blog/2018/10/05/build-a-spring-boot-app-with-user-authentication"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;https://developer.okta.com/blog/2018/10/05/build-a-spring-boot-app-with-user-authentication &lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: red;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;3. How to cancel an order for user-specific settings at the spring level?&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: red;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;3b. Multi calls between ms to ms?&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt; 
Using discovery services like Eureka we can route calls between internal microservices effectively.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsT-7K-0nbPFmchDJ4twRakYdVGMfOiB9TPoGbgsAO-S_ol05KyQ8N_1BbvYJKiD0jaHLvn-_aizJWskYH9NG1PzERj2P6enxTH2MyhpyD-MU5Eo9Ftns6MBK-nHdkEwO0mvFSqP-9W_k/s897/iQuTu.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" data-original-height="336" data-original-width="897" height="198" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsT-7K-0nbPFmchDJ4twRakYdVGMfOiB9TPoGbgsAO-S_ol05KyQ8N_1BbvYJKiD0jaHLvn-_aizJWskYH9NG1PzERj2P6enxTH2MyhpyD-MU5Eo9Ftns6MBK-nHdkEwO0mvFSqP-9W_k/w530-h198/iQuTu.png" width="530" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
&lt;br /&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;span style="color: red;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;How do we resolve cyclic dependency issues in Springboot?&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"&gt;&lt;div style="text-align: left;" trbidi="on"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;By using @Lazy annotation on the dependency we can resolve&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;" trbidi="on"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;or avoid constructor based injection in SB and use setter based injection&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;span style="color: red;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;Tomcat Max Threads settings in Springboot application?&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;span style="color: red;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;table class="tableblock frame-all grid-all stretch" style="background: rgb(255, 255, 255); border-spacing: 0px; border: 1px solid rgb(202, 202, 202); box-sizing: border-box; color: black; font-family: Karla, sans-serif; font-size: 16px; margin-bottom: 1.25em; max-width: 100%; overflow-x: scroll;"&gt;&lt;tbody style="box-sizing: border-box;"&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 1px 1px 0px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;
&lt;code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 4px; box-sizing: border-box; color: #3d3d3c; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 0.8525em; letter-spacing: 0px; padding: 0.1em 0.3em 0.2em; text-rendering: optimizespeed; word-break: break-word;"&gt;server.tomcat.max-connections&lt;/code&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 1px 1px 0px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;
&lt;code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 4px; box-sizing: border-box; color: #3d3d3c; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 0.8525em; letter-spacing: 0px; padding: 0.1em 0.3em 0.2em; text-rendering: optimizespeed; word-break: break-word;"&gt;8192&lt;/code&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 0px 1px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;
Maximum number of connections that the server accepts and processes at any given time. Once the limit has been reached, the operating system may still accept connections based on the "acceptCount" property.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="background: rgb(250, 250, 250); box-sizing: border-box;"&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 1px 1px 0px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;
&lt;code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 4px; box-sizing: border-box; color: #3d3d3c; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 0.8525em; letter-spacing: 0px; padding: 0.1em 0.3em 0.2em; text-rendering: optimizespeed; word-break: break-word;"&gt;server.tomcat.max-http-form-post-size&lt;/code&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 1px 1px 0px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;
&lt;code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 4px; box-sizing: border-box; color: #3d3d3c; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 0.8525em; letter-spacing: 0px; padding: 0.1em 0.3em 0.2em; text-rendering: optimizespeed; word-break: break-word;"&gt;2MB&lt;/code&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 0px 1px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;
Maximum size of the form content in any HTTP post request.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 1px 1px 0px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;
&lt;code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 4px; box-sizing: border-box; color: #3d3d3c; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 0.8525em; letter-spacing: 0px; padding: 0.1em 0.3em 0.2em; text-rendering: optimizespeed; word-break: break-word;"&gt;server.tomcat.max-swallow-size&lt;/code&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 1px 1px 0px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;
&lt;code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 4px; box-sizing: border-box; color: #3d3d3c; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 0.8525em; letter-spacing: 0px; padding: 0.1em 0.3em 0.2em; text-rendering: optimizespeed; word-break: break-word;"&gt;2MB&lt;/code&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 0px 1px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;
Maximum amount of request body to swallow.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="background: rgb(250, 250, 250); box-sizing: border-box;"&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 1px 1px 0px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;
&lt;code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 4px; box-sizing: border-box; color: #3d3d3c; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 0.8525em; letter-spacing: 0px; padding: 0.1em 0.3em 0.2em; text-rendering: optimizespeed; word-break: break-word;"&gt;server.tomcat.max-threads&lt;/code&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 1px 1px 0px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;
&lt;code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 4px; box-sizing: border-box; color: #3d3d3c; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 0.8525em; letter-spacing: 0px; padding: 0.1em 0.3em 0.2em; text-rendering: optimizespeed; word-break: break-word;"&gt;200&lt;/code&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 0px 1px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;
Maximum amount of worker threads.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 1px 1px 0px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;
&lt;code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 4px; box-sizing: border-box; color: #3d3d3c; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 0.8525em; letter-spacing: 0px; padding: 0.1em 0.3em 0.2em; text-rendering: optimizespeed; word-break: break-word;"&gt;server.tomcat.mbeanregistry.enabled&lt;/code&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 1px 1px 0px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;
&lt;code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 4px; box-sizing: border-box; color: #3d3d3c; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 0.8525em; letter-spacing: 0px; padding: 0.1em 0.3em 0.2em; text-rendering: optimizespeed; word-break: break-word;"&gt;false&lt;/code&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 0px 1px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;
Whether Tomcat's MBean Registry should be enabled.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="background: rgb(250, 250, 250); box-sizing: border-box;"&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 1px 1px 0px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;
&lt;code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 4px; box-sizing: border-box; color: #3d3d3c; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 0.8525em; letter-spacing: 0px; padding: 0.1em 0.3em 0.2em; text-rendering: optimizespeed; word-break: break-word;"&gt;server.tomcat.min-spare-threads&lt;/code&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 1px 1px 0px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;
&lt;code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 4px; box-sizing: border-box; color: #3d3d3c; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 0.8525em; letter-spacing: 0px; padding: 0.1em 0.3em 0.2em; text-rendering: optimizespeed; word-break: break-word;"&gt;10&lt;/code&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 0px 1px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;
Minimum amount of worker threads.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 1px 1px 0px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;
&lt;code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 4px; box-sizing: border-box; color: #3d3d3c; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 0.8525em; letter-spacing: 0px; padding: 0.1em 0.3em 0.2em; text-rendering: optimizespeed; word-break: break-word;"&gt;server.tomcat.port-header&lt;/code&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 1px 1px 0px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;
&lt;code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 4px; box-sizing: border-box; color: #3d3d3c; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 0.8525em; letter-spacing: 0px; padding: 0.1em 0.3em 0.2em; text-rendering: optimizespeed; word-break: break-word;"&gt;X-Forwarded-Port&lt;/code&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 0px 1px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;
Name of the HTTP header used to override the original port value.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="background: rgb(250, 250, 250); box-sizing: border-box;"&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 1px 1px 0px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;
&lt;code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 4px; box-sizing: border-box; color: #3d3d3c; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 0.8525em; letter-spacing: 0px; padding: 0.1em 0.3em 0.2em; text-rendering: optimizespeed; word-break: break-word;"&gt;server.tomcat.processor-cache&lt;/code&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 1px 1px 0px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;
&lt;code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 4px; box-sizing: border-box; color: #3d3d3c; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 0.8525em; letter-spacing: 0px; padding: 0.1em 0.3em 0.2em; text-rendering: optimizespeed; word-break: break-word;"&gt;200&lt;/code&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 0px 1px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;
Maximum number of idle processors that will be retained in the cache and reused with a subsequent request. When set to -1 the cache will be unlimited with a theoretical maximum size equal to the maximum number of connections.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 1px 1px 0px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;
&lt;code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 4px; box-sizing: border-box; color: #3d3d3c; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 0.8525em; letter-spacing: 0px; padding: 0.1em 0.3em 0.2em; text-rendering: optimizespeed; word-break: break-word;"&gt;server.tomcat.protocol-header&lt;/code&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 1px 1px 0px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;/td&gt;&lt;td class="tableblock halign-left valign-top" style="border-color: rgb(202, 202, 202); border-image: initial; border-style: solid; border-width: 0px 0px 1px; box-sizing: border-box; direction: ltr; font-size: inherit; line-height: 1.6; margin: 0px; padding: 0.5625em 0.625em; vertical-align: top;"&gt;&lt;div class="tableblock" style="box-sizing: border-box; direction: ltr; font-family: inherit; font-size: 1em; line-height: 1.6; padding: 0px; text-rendering: optimizelegibility;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;
Header that holds the incoming protocol, usually named "X-Forwarded-Proto".&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;
Reference: &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href="https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;b&gt;&lt;span style="color: red;"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;Sort Employee salary using Java Streams and display salary which is greater than X amount? Java 8 --streams, lambda expression&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;
&lt;div class="line number18 index17 alt1" style="background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; bottom: auto !important; box-sizing: content-box; color: #333333; float: none; font-family: consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, Courier, monospace; font-size: 14px; height: auto; inset: auto; left: auto !important; line-height: 1.1em; margin: 0px; min-height: auto; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto !important; top: auto !important; vertical-align: baseline; white-space: pre; width: auto;"&gt;
&lt;code class="java comments" style="background: 0px 0px; border-radius: 0px; border: 0px; bottom: auto !important; box-sizing: content-box; color: #008200; float: none; font-family: consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, Courier, monospace; font-size: 1em; height: auto; inset: auto; left: auto !important; line-height: 1.1em; margin: 0px; min-height: auto; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto !important; top: auto !important; vertical-align: baseline; width: auto;"&gt;// find employees whose salaries are above 10000&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number19 index18 alt2" style="background: 0px 0px rgb(255, 255, 255); border-radius: 0px; border: 0px; bottom: auto !important; box-sizing: content-box; color: #333333; float: none; font-family: consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, Courier, monospace; font-size: 14px; height: auto; inset: auto; left: auto !important; line-height: 1.1em; margin: 0px; min-height: auto; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto !important; top: auto !important; vertical-align: baseline; white-space: pre; width: auto;"&gt;
&lt;code class="java spaces" style="background: 0px 0px; border-radius: 0px; border: 0px; bottom: auto !important; box-sizing: content-box; float: none; font-family: consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, Courier, monospace; font-size: 1em; height: auto; inset: auto; left: auto !important; line-height: 1.1em; margin: 0px; min-height: auto; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto !important; top: auto !important; vertical-align: baseline; width: auto;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="java plain" style="background: 0px 0px; border-radius: 0px; border: 0px; bottom: auto !important; box-sizing: content-box; color: black; float: none; font-family: consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, Courier, monospace; font-size: 1em; height: auto; inset: auto; left: auto !important; line-height: 1.1em; margin: 0px; min-height: auto; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto !important; top: auto !important; vertical-align: baseline; width: auto;"&gt;empList.stream().&lt;b&gt;filter&lt;/b&gt;(emp-&amp;gt;emp.getSalary() &amp;gt; &lt;/code&gt;&lt;code class="java value" style="background: 0px 0px; border-radius: 0px; border: 0px; bottom: auto !important; box-sizing: content-box; color: #009900; float: none; font-family: consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, Courier, monospace; font-size: 1em; height: auto; inset: auto; left: auto !important; line-height: 1.1em; margin: 0px; min-height: auto; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto !important; top: auto !important; vertical-align: baseline; width: auto;"&gt;10000&lt;/code&gt;&lt;code class="java plain" style="background: 0px 0px; border-radius: 0px; border: 0px; bottom: auto !important; box-sizing: content-box; color: black; float: none; font-family: consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, Courier, monospace; font-size: 1em; height: auto; inset: auto; left: auto !important; line-height: 1.1em; margin: 0px; min-height: auto; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto !important; top: auto !important; vertical-align: baseline; width: auto;"&gt;).forEach(System.out::println);&lt;/code&gt;&lt;/div&gt;
&lt;br /&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;
Reference: &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href="https://www.java2novice.com/java-8/streams/filter-method-example/"&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;https://www.java2novice.com/java-8/streams/filter-method-example/&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;span style="color: red;"&gt;&lt;b&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;Spring boot --Dependency injection types?&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;There are basically three types of dependency injection: &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;constructor injection:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt; the dependencies are provided through a class constructor. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;setter injection:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt; the client exposes a setter method that the injector uses to inject the dependency. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;Interface injection:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt; the dependency provides an injector method that will Clients must implement an interface that exposes a setter method that accepts the dependency.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="vertical-align: inherit;"&gt;&lt;span style="vertical-align: inherit;"&gt;So now its the dependency injection's responsibility to:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;Create the objects&lt;/li&gt;
&lt;li&gt;Know which classes require those objects&lt;/li&gt;
&lt;li&gt;And provide them all those objects&lt;/li&gt;
&lt;/ul&gt;
Reference :&amp;nbsp;&lt;a href="https://java2blog.com/introduction-to-spring-framework/#Spring_Boot"&gt;https://java2blog.com/introduction-to-spring-framework/#Spring_Boot&lt;/a&gt;&lt;br /&gt;&lt;ul style="text-align: left;"&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;b&gt;&lt;span style="color: red;"&gt;How do we do monitoring of REST APIS ?&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Appdynamics like tools helps to do this monitoring&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;b&gt;&lt;span style="color: red;"&gt;How do we call External Microservices in Springboot REST APIS ?&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Using Rest Template or Feign clients&amp;nbsp;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;Resttemplate : &lt;b&gt;getForEntity&lt;/b&gt;(gets full responseEntity) vs &lt;b&gt;getForObject&lt;/b&gt; (only object we get)&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;	&lt;/span&gt; &lt;span class="Apple-converted-space"&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;exchange&lt;/b&gt; also do the same&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;/p&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;b&gt;&lt;span style="color: red;"&gt;What are status codes for DELETE API ?&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;Right Status codes for delete - 204 - content not found&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;	&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt; &lt;/span&gt;200 - OK&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;b&gt;&lt;span style="color: red;"&gt;Why Do we need Timeout setting in REST APIs ?&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;For each request, a thread is blocked.&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;at one point in time threads will be out. so time out is needed to release threads. Default is 200 threads in thread pool.&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;Ex :Read time out(not able to complete reading data) , server time out (not able to get connection)&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;/p&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;b&gt;&lt;span style="color: red;"&gt;Versioning in REST APIs ?&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;the new functionality will be rolled with new version apis&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;using request param or path param&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;also using headers&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;uri @Getmapping&lt;/p&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div style="text-align: left;" trbidi="on"&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;b&gt;&lt;span style="color: red;"&gt;What is content negotiation in the REST ?&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;mediatype : Produces or consumes is nothing but content negotiation.&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; text-align: left;"&gt;&lt;/p&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;b&gt;&lt;span style="color: red;"&gt;What are cross-cutting concerns?&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&amp;nbsp;AOP - for logging purposes&lt;span class="Apple-converted-space"&gt;,&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;security setup&lt;span class="Apple-converted-space"&gt;&amp;nbsp;using Request Filters, and Interceptors for managing requests and response data&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span class="Apple-converted-space"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;/p&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;span class="Apple-converted-space"&gt;&lt;b&gt;&lt;span style="color: red;"&gt;How do you create custom annotation in spring boot?&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span class="Apple-converted-space"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;STEP1: Create an interface with the annotation name&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;STEP2: Create an Aspect&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;STEP3: Add the annotation&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;@Target(ElementType.METHOD)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;@Retention(RetentionPolicy.RUNTIME)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;public @interface Traceable {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span class="Apple-converted-space" style="font-size: 13px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span class="Apple-converted-space"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;/p&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="color: red; font-size: 13px;"&gt;&lt;b&gt;Pagination and Sorting using Spring Data JPA&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;public interface ProductRepository extends PagingAndSortingRepository&amp;lt;Product, Integer&amp;gt; {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; List&amp;lt;Product&amp;gt; findAllByPrice(double price, Pageable pageable);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;Conversely, we could have chosen to extend JpaRepository instead, as it extends PagingAndSortingRepository too.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;HATEOAS constraint of REST means enabling the client of the API to discover the next and previous pages based on the current page in the navigation.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&amp;nbsp;we're going to use the Link HTTP header, coupled with the “next“, “prev“, “first” and “last” link relation types.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-size: 13px;"&gt;&lt;span class="Apple-converted-space" style="font-family: Helvetica Neue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&amp;nbsp;In the case of pagination, the event – PaginatedResultsRetrievedEvent – is fired in the controller layer. Then we'll implement discoverability with a custom listener for this event.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;/p&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;b style="color: red; font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px;"&gt;&amp;nbsp;REST Controller&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px;"&gt;@Api&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;@RequestMapping("/v1")&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;public interface ProfileV1Interface{&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;@ApiOperation(value = "Api to Get a specific setting for a cluster", notes = "Get a specific setting for a Cluster")&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;@GetMapping(value = "/cluster/{name}/settings", produces = MediaType.APPLICATION_JSON_VALUE)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;Map&amp;lt;String, String&amp;gt; getClusterSetting(@RequestParam(required = true) String clusterId,@PathVariable(required = true) String name);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-size: 13px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span style="font-family: Helvetica Neue;"&gt;&lt;span style="font-size: 13px;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;/p&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;b&gt;&lt;span style="color: red;"&gt;@autowire Vs @Inject&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="p1" style="font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"&gt;&lt;span face="-apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Liberation Sans&amp;quot;, sans-serif" style="background-color: white; color: #232629; font-size: 15px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;code style="border-radius: 3px; border: 0px; box-sizing: inherit; color: #232629; font-family: var(--ff-mono); font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 2px 4px; vertical-align: baseline; white-space: pre-wrap;"&gt;@Autowired&lt;/code&gt;&lt;span face="-apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Liberation Sans&amp;quot;, sans-serif" style="background-color: white; color: #232629; font-size: 15px;"&gt;&amp;nbsp;is Spring's own annotation.&amp;nbsp;&lt;/span&gt;&lt;code style="border-radius: 3px; border: 0px; box-sizing: inherit; color: #232629; font-family: var(--ff-mono); font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 2px 4px; vertical-align: baseline; white-space: pre-wrap;"&gt;@Inject&lt;/code&gt;&lt;span face="-apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Liberation Sans&amp;quot;, sans-serif" style="background-color: white; color: #232629; font-size: 15px;"&gt;&amp;nbsp;is part of a Java technology called CDI that defines a standard for dependency injection similar to Spring. In a Spring application, the two annotations work the same way as Spring has decided to support some JSR-299 annotations in addition to their own.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;b&gt;&lt;span style="color: red;"&gt;Tell me some important annotations in springboot?&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;div dir="ltr" style="color: #2b00fe;" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" style="color: #2b00fe;" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@SpringBootApplication: &lt;/span&gt;It is a combination of three annotations @&lt;span style="color: #2b00fe;"&gt;EnableAutoConfiguration,&lt;/span&gt; &lt;span style="color: #2b00fe;"&gt;@ComponentScan&lt;/span&gt;, and &lt;span style="color: #2b00fe;"&gt;@Configuration&lt;/span&gt;.&lt;/div&gt;&lt;div dir="ltr" style="color: #2b00fe;" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@Controller&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@RequestMapping&lt;/span&gt;("books")&amp;nbsp; :&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;blockquote&gt;@Controller: The @Controller is a class-level annotation. It is a specialization of @Component. It marks a class as a web request handler. It is often used to serve web pages. By default, it returns a string that indicates which route to redirect. It is mostly used with @RequestMapping annotation.&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;span style="color: #2b00fe;"&gt;@Service:&lt;/span&gt; It is also used at the class level. It tells the Spring that the class contains the business logic.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@Repository: &lt;/span&gt;It is a class-level annotation. The repository is a DAOs (Data Access Object) that access the database directly. The repository does all the operations related to the database.&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@ConditionalOnClass and @ConditionalOnMissingClass&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;Using these conditions, Spring will only use the marked auto-configuration bean if the class in the annotation's argument is present/absent:&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@ConditionalOnBean and @ConditionalOnMissingBean&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;We can use these annotations when we want to define conditions based on the presence or absence of a specific bean:&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@ConditionalOnProperty&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;With this annotation, we can make conditions on the values of properties:&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@ConditionalOnProperty&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;The @ConditionalOnProperty annotation is, in my experience, the most commonly used conditional annotation in Spring Boot projects. It allows to load beans conditionally depending on a certain environment property:&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@Configuration&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@ConditionalOnProperty(&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&amp;nbsp; &amp;nbsp; value="module.enabled",&amp;nbsp;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&amp;nbsp; &amp;nbsp; havingValue = "true",&amp;nbsp;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&amp;nbsp; &amp;nbsp; matchIfMissing = true)&lt;/div&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" trbidi="on"&gt;&amp;nbsp;&lt;span style="color: #2b00fe;"&gt;@Required&lt;/span&gt; : This annotation is applied to bean setter methods. It indicates that the required property must be filled at the configuration time in the affected bean, or else it throws an exception: BeanInitializationException.&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@Qualifier :&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;It is used along with @Autowired annotation. It is used when more control is required over the dependency injection process. Individual constructor arguments or method parameters can be specified by using this annotation. Confusion arises when more than one bean of the same type is created, and only one of them is to be wired with a property, @Qualifier is used to get rid of the confusion.&lt;/div&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@CookieValue :&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;It is used at the method parameter level as an argument of the request mapping method. For a given cookie name, the HTTP cookie is bound to a @CookieValue parameter.&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@Lazy&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;It is used in the component class. At startup, all auto-wired dependencies are created and configured. But a @Lazy annotation can be created if a bean is to be initialized lazily. This means that only if it is requested for a bean will be created. It can also be used on @Configuartion classes. It’s an indication that all @Bean methods within that @Configuration should be lazily initialized.&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@Configuration&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@ComponentScan&lt;/span&gt;(basePackages="org.mavin.krishna")&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;public class Config {&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;}&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@Primary&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;we use @Primary to give higher preference to a bean when there are multiple beans of the same type.&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@Order&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;The @Order annotation defines the sorting order of an annotated component or bean.&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;supports the ordering of injected components to a collection. As a result, Spring will inject the auto-wired beans of the same type based on their order value.&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;Ordered.LOWEST_PRECEDENCE.&amp;nbsp;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;Ordered.HIGHEST_PRECEDENCE&amp;nbsp;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;@Order(1)&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;@Component&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;@Order(Ordered.LOWEST_PRECEDENCE)&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@EnableAsync&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;With this annotation, we can enable asynchronous functionality in Spring.&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;We must use it with @Configuration:&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@EnableScheduling&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;With this annotation, we can enable scheduling in the application.&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;We also have to use it in conjunction with @Configuration:&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@Async&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;We can define methods we want to execute on a different thread, hence run them asynchronously.&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;To achieve this, we can annotate the method with @Async:&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@Scheduled&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;If we need a method to execute periodically, we can use this annotation:&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@Scheduled(fixedRate = 10000)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@PostConstruct&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;Spring calls methods annotated with @PostConstruct only once, just after the initialization of bean properties.&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span style="color: #2b00fe;"&gt;@PreDestroy&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;A method annotated with @PreDestroy runs only once, just before Spring removes our bean from the application context.&lt;/div&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsT-7K-0nbPFmchDJ4twRakYdVGMfOiB9TPoGbgsAO-S_ol05KyQ8N_1BbvYJKiD0jaHLvn-_aizJWskYH9NG1PzERj2P6enxTH2MyhpyD-MU5Eo9Ftns6MBK-nHdkEwO0mvFSqP-9W_k/s72-w530-h198-c/iQuTu.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>JBOSS start and stop shell scripts - domain mode - host controller - domain controller </title><link>http://www.krishnaspage.com/2020/02/jboss-start-and-stop-shell-scripts.html</link><category>Java</category><category>JBOSS</category><category>Technical</category><category>Websphere</category><pubDate>Wed, 22 Feb 2017 16:45:00 -0600</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-7924836366604444701</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&amp;nbsp;JBOSS start and stop shell scripts - domain mode - host controller - domain controller&lt;br /&gt;
===========START DOMAIN CONTROLLER MACHINE JBOSS=================&lt;br /&gt;
echo "Setting JBOSS Env"&lt;br /&gt;
export JAVA_HOME=/opt/app/java/jdk/jdk160&lt;br /&gt;
export PATH=$PATH:/opt/app/jboss/jboss-eap-6.3/bin:$JAVA_HOME/bin&lt;br /&gt;
echo "PATH is : $PATH"&lt;br /&gt;
&lt;br /&gt;
echo "JBOSS Environment is ready and starting jboss in domain mode"&lt;br /&gt;
echo "MY:JAVA_OPTS: $JAVA_OPTS"&lt;br /&gt;
export JAVA_OPTS="$JAVA_OPTS -DASOCPropsFile=/abc/etc/abc.props -DLNSPropsFile=/pns/etc/pns.props -DAVSPropsFile=/bvs/etc/bvs.props -DEOTPropsFile=/toe/etc/toe.props -DLPSPropsFile=/psl/etc/psl.props -DADLPropsFile=/hfl/etc/hfl.props -Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true"&lt;br /&gt;
echo "MY AFTER:JAVA_OPTS: $JAVA_OPTS"&lt;br /&gt;
&lt;br /&gt;
/export/opt/jboss/jboss-eap-6.3/bin/domain.sh -b cldv0015.abc.cpf.com -bmanagement cldv0015.abc.cpf.com &amp;amp;&lt;br /&gt;
=============================================&lt;br /&gt;
============START HOST CONTROLLER==========&lt;br /&gt;
=============================================&lt;br /&gt;
&lt;br /&gt;
==========STOP JBOSS Process harshly==============&lt;br /&gt;
echo "Stopping JBOSS JAVA processes"&lt;br /&gt;
&lt;br /&gt;
for i in `ps -eaf | grep jboss | grep java | cut -d " " -f6`&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; kill -9 $i&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; echo "Killing: $i"&lt;br /&gt;
}&lt;br /&gt;
ps -eaf | grep jboss | grep java&lt;br /&gt;
echo "Stop completed"&lt;br /&gt;
============================================&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>Unix command to find class in jar | windows command to search class in jars</title><link>http://www.krishnaspage.com/2016/07/unix-command-to-find-class-in-jar.html</link><category>Shell Scripting</category><category>Technical</category><category>UNIX</category><category>Windows</category><pubDate>Fri, 29 Jul 2016 15:52:00 -0500</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-8084437597895584626</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Below are the sample commands to find out required class is there in the jar files of current directory and its sub-dirs.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;Unix :&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;find . -type f -name '*.jar' -print0 | &amp;nbsp;xargs -0 -I '{}' sh -c 'jar tf {} | grep com/sun/net/ssl/HostnameVerifier.class &amp;amp;&amp;amp; &amp;nbsp;echo {}'&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;find . -type f -name '*.jar' -print0 | &amp;nbsp;xargs -0 -I '{}' sh -c 'jar tf {} | grep HostnameVerifier.class &amp;amp;&amp;amp; &amp;nbsp;echo {}'&lt;/b&gt;&lt;br /&gt;
Ex :&lt;br /&gt;
[kg6378@bldv0014 jdk1.6.0_20]$ find . -type f -name '*.jar' -print0 | &amp;nbsp;xargs -0 -I '{}' sh -c 'jar tf {} | grep com/sun/net/ssl/HostnameVerifier.class &amp;amp;&amp;amp; &amp;nbsp;echo {}'&lt;br /&gt;
com/sun/net/ssl/HostnameVerifier.class&lt;br /&gt;
./jre/lib/jsse.jar&lt;br /&gt;
&lt;br /&gt;
[kg6378@bldv0014 jdk1.6.0_20]$ find . -type f -name '*.jar' -print0 | &amp;nbsp;xargs -0 -I '{}' sh -c 'jar tf {} | grep HostnameVerifier.class &amp;amp;&amp;amp; &amp;nbsp;echo {}'&lt;br /&gt;
com/sun/deploy/security/CertificateHostnameVerifier.class&lt;br /&gt;
./jre/lib/deploy.jar&lt;br /&gt;
javax/net/ssl/HostnameVerifier.class&lt;br /&gt;
javax/net/ssl/HttpsURLConnection$DefaultHostnameVerifier.class&lt;br /&gt;
sun/net/www/protocol/https/DefaultHostnameVerifier.class&lt;br /&gt;
com/sun/net/ssl/HostnameVerifier.class&lt;br /&gt;
./jre/lib/jsse.jar&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Windows :&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
forfiles /S /M *.jar /C "cmd /c jar -tvf @file | findstr /C:"HostnameVerifier.class" &amp;amp;&amp;amp; echo @path"&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
C:\Users\kg6378\Desktop\jdk-7u79-windows-x64\tools&amp;gt;cd C:\Krish\MyDocs\SWS\Jdk1.6&lt;br /&gt;
.0_14&lt;br /&gt;
&lt;br /&gt;
C:\Krish\MyDocs\SWS\Jdk1.6.0_14&amp;gt;forfiles /S /M *.jar /C "cmd /c jar -tvf @file |&lt;br /&gt;
&amp;nbsp;findstr /C:"HostnameVerifier.class" &amp;amp;&amp;amp; echo @path"&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; 3517 Thu May 21 09:19:20 EDT 2009 com/sun/deploy/security/CertificateHostnameV&lt;br /&gt;
erifier.class&lt;br /&gt;
"C:\Krish\MyDocs\SWS\Jdk1.6.0_14\jre\lib\deploy.jar"&lt;br /&gt;
&amp;nbsp; &amp;nbsp;194 Thu Feb 05 13:54:20 EST 2009 javax/net/ssl/HostnameVerifier.class&lt;br /&gt;
&amp;nbsp; &amp;nbsp;618 Thu Feb 05 13:54:22 EST 2009 javax/net/ssl/HttpsURLConnection$DefaultHost&lt;br /&gt;
nameVerifier.class&lt;br /&gt;
&amp;nbsp; &amp;nbsp;384 Thu Feb 05 13:54:22 EST 2009 sun/net/www/protocol/https/DefaultHostnameVe&lt;br /&gt;
rifier.class&lt;br /&gt;
&amp;nbsp; &amp;nbsp;272 Thu Feb 05 13:54:32 EST 2009 com/sun/net/ssl/HostnameVerifier.class&lt;br /&gt;
"C:\Krish\MyDocs\SWS\Jdk1.6.0_14\jre\lib\jsse.jar"&lt;br /&gt;
&lt;br /&gt;
C:\Krish\MyDocs\SWS\Jdk1.6.0_14&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>JBOSS - Profiles - socket binding - offset - Groups - Server</title><link>http://www.krishnaspage.com/2015/09/jboss-profiles-socket-binding-offset.html</link><category>Java</category><category>JBOSS</category><category>Technical</category><category>Web Server</category><pubDate>Tue, 22 Sep 2015 11:19:00 -0500</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-5745791964054708361</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
JBOSS - Profiles - socket binding - offset - Groups - Server&lt;br /&gt;
&lt;br /&gt;
In JBOSS above are some common yet important terminology.&lt;br /&gt;
&lt;br /&gt;
Each Server instance will fall under a group. It can follow its own socket binding.&lt;br /&gt;
Each group falls under a profile. Default , Full , Full-has etc&lt;br /&gt;
&lt;br /&gt;
Based on socket binding default HTTP port and server offset we need to find out the server running http port.&amp;nbsp; &lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>Caused by: org.jboss.modules.xml.XmlPullParserException: Failed to add resource root 'abc.jar' at path 'abc.jar' (position: END_TAG seen ...</title><link>http://www.krishnaspage.com/2015/09/caused-by-orgjbossmodulesxmlxmlpullpars.html</link><category>Java</category><category>JBOSS</category><category>Technical</category><category>Web Server</category><pubDate>Thu, 17 Sep 2015 10:54:00 -0500</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-2814622155169450150</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Getting the below error ? Global modules classes not available ?&lt;br /&gt;
&lt;br /&gt;
Caused by: org.jboss.modules.xml.XmlPullParserException: Failed to add resource root 'abc.jar' at path 'abc.jar' (position: END_TAG seen ...&lt;resource-root path="def.jar"&gt;\n&lt;resource-root path="def.jar"&gt;... @8:33) caused by: java.util.zip.ZipException: error in opening zip file&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.jboss.modules.ModuleXmlParser.parseResourceRoot(ModuleXmlParser.java:723) [jboss-modules.jar:1.3.3.Final-redhat-1]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.jboss.modules.ModuleXmlParser.parseResources(ModuleXmlParser.java:572) [jboss-modules.jar:1.3.3.Final-redhat-1]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.jboss.modules.ModuleXmlParser.parseModuleContents(ModuleXmlParser.java:394) [jboss-modules.jar:1.3.3.Final-redhat-1]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.jboss.modules.ModuleXmlParser.parseDocument(ModuleXmlParser.java:219) [jboss-modules.jar:1.3.3.Final-redhat-1]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:153) [jboss-modules.jar:1.3.3.Final-redhat-1]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ... 18 more&lt;/resource-root&gt;&lt;/resource-root&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Solution &lt;/b&gt;: This is just because your global module jar file is corrupted and can not be read. Delete and copy the jar properly. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;More similar error :&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
09:38:16,093 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.module.service."deployment.TestWebProj.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.TestWebProj.war".main: JBAS018759: Failed to load module: deployment.TestWebProj.war:main&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_95]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_95]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at java.lang.Thread.run(Thread.java:682) [rt.jar:1.6.0_95]&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>JBOSS : WARs deployment shell script</title><link>http://www.krishnaspage.com/2015/09/jboss-wars-deployment-shell-script.html</link><category>Java</category><category>JBOSS</category><category>Technical</category><category>Websphere</category><pubDate>Wed, 16 Sep 2015 11:12:00 -0500</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-5911158581221493454</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Below is simple example of deploying the list of WARs from a props file and deploy into JBOSS.&lt;br /&gt;
---------Script 1 invokes script 2 and creates a log file---------&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
datestr=$(date +%Y%m%d_%H%M%S)&lt;br /&gt;
./connectToCLLI.sh &amp;gt; AsocDeploymentLog_$datestr&lt;br /&gt;
-----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
----------SCRIPT 2 , reads props file and get the WAR file and Group information-------&lt;br /&gt;
#!/bin/ksh&lt;br /&gt;
echo "Setting JBOSS Env"&lt;br /&gt;
export JBOSS_HOME=/export/opt/jboss/jboss-eap-6.3&lt;br /&gt;
export JAVA_HOME=/opt/app/java/jdk/jdk160&lt;br /&gt;
export PATH=$PATH:$JBOSS_HOME/bin:$JAVA_HOME/bin&lt;br /&gt;
export JB_CLI=$JBOSS_HOME/bin/jboss-cli.sh&lt;br /&gt;
DEPLOYMENT_HOST=`nslookup \`hostname\` |grep Name | awk '/:/{print $2}'`&lt;br /&gt;
export HOME_DIR=/pbcf/ctfr1603/&lt;br /&gt;
&lt;br /&gt;
echo "JBOSS Environment is ready and connecting to CLLI"&lt;br /&gt;
allDeployed=0&lt;br /&gt;
for LINE in `cat deploymentDescABC.props | grep -v "#"`&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;VAL1=`echo $LINE |cut -d '|' -f1 `&lt;br /&gt;
&amp;nbsp;GROUPS=`echo $LINE |cut -d '|' -f2 `&lt;br /&gt;
&amp;nbsp;export WAR_FILE=$HOME_DIR$VAL1&lt;br /&gt;
&amp;nbsp;echo "Deploying $WAR_FILE now"&lt;br /&gt;
&amp;nbsp;#export COMMANDS="connect,deploy $WAR_FILE --force,quit"&lt;br /&gt;
&amp;nbsp;export COMMANDS="connect,deploy $WAR_FILE --server-groups=$GROUPS,quit"&lt;br /&gt;
&amp;nbsp;echo "COMMANDS is $COMMANDS"&lt;br /&gt;
&amp;nbsp;if $JB_CLI -c --controller=$DEPLOYMENT_HOST:9999&amp;nbsp; --commands="$COMMANDS"&lt;br /&gt;
&amp;nbsp; then&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo "Deployment successful for $WAR_FILE !!"&lt;br /&gt;
&amp;nbsp;else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo "Deployment failed for $WAR_FILE "&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; allDeployed=1&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break&lt;br /&gt;
&amp;nbsp;fi&lt;br /&gt;
}&lt;br /&gt;
if [ $allDeployed = "0" ]&lt;br /&gt;
&amp;nbsp; then&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo "Overall deployment of all WARs is successful"&lt;br /&gt;
else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo "Overall deployment FAILED !!"&lt;br /&gt;
fi&amp;nbsp; &lt;br /&gt;
&amp;nbsp;---------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
----------Sample Props file -------------&lt;br /&gt;
&amp;nbsp;# list of WARs for ASOC Module&lt;br /&gt;
/abc/def/MyTestwar|G2&lt;br /&gt;
/abc/def/YourTestwar|G2&lt;br /&gt;
All WARs done#&lt;br /&gt;
----------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Sample Deploy and undeploy commands :&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;[jboss@hex0015 bin]$ ./jboss-cli.sh --controller=hex0015.abc.com:9999&lt;br /&gt;You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.&lt;br /&gt;----------------------------&lt;br /&gt;[disconnected /] connect&lt;br /&gt;[domain@hex0015.abc.com:9999 /] deploy /ssd/etc/jboss_config/atp/csac/PressQuery.war --all-server-groups&lt;br /&gt;
[domain@hex0015.abc.com:9999 /]&amp;nbsp; undeploy PressQuery.war --all-relevant-server-groups&lt;br /&gt;
&amp;nbsp;&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>JBOSS - Global modules - profiles modules.xml </title><link>http://www.krishnaspage.com/2015/09/jboss-global-modules-profiles-modulesxml.html</link><category>Java</category><category>JBOSS</category><category>Technical</category><category>Web Server</category><pubDate>Thu, 10 Sep 2015 10:49:00 -0500</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-1165529971238290595</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
JBOSS global modules is one of the best feature provided by JBOSS to share all common jars / libraries in one place to be used across all WAR / EARs deployed.&lt;br /&gt;
&lt;br /&gt;
To used jboss global modules we need to writed module.xml with list of jars under&lt;br /&gt;
/export/opt/jboss/jboss-eap-6.3/modules/&lt;name&gt;/&lt;name&gt;../&lt;main&gt;/module.xml&lt;/main&gt;&lt;/name&gt;&lt;/name&gt;&lt;br /&gt;
&lt;br /&gt;
Example : /export/opt/jboss/jboss-eap-6.3/modules/com/abc/main/module.xml&lt;br /&gt;
&lt;br /&gt;
After having this module.xml and copying the required jars into dir : &lt;br /&gt;
/export/opt/jboss/jboss-eap-6.3/modules/com/abc/main&lt;br /&gt;
&lt;br /&gt;
We need to add entry to the&lt;br /&gt;
domain.xml&lt;br /&gt;
&lt;br /&gt;
&lt;subsystem xmlns="urn:jboss:domain:ee:1.2"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;global-modules&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;module name="com.abc" slot="main"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/module&gt;&lt;/global-modules&gt;&lt;/b&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;spec-descriptor-property-replacement&gt;false&lt;/spec-descriptor-property-replacement&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;jboss-descriptor-property-replacement&gt;true&lt;/jboss-descriptor-property-replacement&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;annotation-property-replacement&gt;false&lt;/annotation-property-replacement&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/subsystem&gt; &lt;br /&gt;
&lt;br /&gt;
But this is very important to add under rite profile. For example if you want to share these global modules under default profile your servers also should fall under the same default profile.&lt;br /&gt;
If you server exists under a group which follows full profile you should have this entry in the full profile.&lt;br /&gt;
&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title> ERROR [org.jboss.modcluster] (ContainerBackgroundProcessor[StandardEngine[jboss.web]]) MODCLUSTER000042: Error null sending INFO command to zldv7606.vci.att.com/135.49.207.238:6666, configuration will be reset: null</title><link>http://www.krishnaspage.com/2015/09/error-orgjbossmodcluster.html</link><category>Java</category><category>JBOSS</category><category>Technical</category><category>Web Server</category><pubDate>Tue, 8 Sep 2015 10:36:00 -0500</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-8669533327692237011</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;b&gt;Are you seeing below error in jboss host controller machine server logs continuously ?&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
ERROR [org.jboss.modcluster] (ContainerBackgroundProcessor[StandardEngine[jboss.web]]) MODCLUSTER000042: Error null sending INFO command to zldv7606.vci.att.com/135.49.207.238:6666, configuration will be reset: null&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Solution : &lt;/b&gt;&lt;br /&gt;export PATH=$PATH:/opt/app/java/jdk/jdk160/bin&lt;br /&gt;bldv0014:/opt/app/jboss/jboss-eap-6.3/bin&amp;gt; ./jboss-cli.sh --controller=abcd0015.cddef.pbc.com:9999&lt;br /&gt;You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.&lt;br /&gt;[disconnected /] connect&lt;br /&gt;Authenticating against security realm: ManagementRealm&lt;br /&gt;Username: jbadmin&lt;br /&gt;Password:&lt;br /&gt;[domain@abcs0015.cdef.pbc.com:9999 /] /profile=full-ha/subsystem=modcluster:remove&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "outcome" =&amp;gt; "success",&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "result" =&amp;gt; undefined,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "server-groups" =&amp;gt; undefined&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>How to print request and response XML data (HTTP communication information) in JBOSS server logs ? </title><link>http://www.krishnaspage.com/2015/11/how-to-print-request-and-response-xml.html</link><category>Java</category><category>JBOSS</category><category>Web Server</category><pubDate>Thu, 3 Sep 2015 10:39:00 -0500</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-8868627711378338923</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
How to print request and response XML data (HTTP communication information) in jboss server logs ?&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
Set the below property to JVM process being run for jboss&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;-Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true &lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>Webservice HTTPS client running - SSL handshake confirmation - print SOAP request response data</title><link>http://www.krishnaspage.com/2015/11/webservice-https-client-running-ssl.html</link><category>Java</category><category>JBOSS</category><category>Technical</category><category>Web Server</category><pubDate>Wed, 2 Sep 2015 10:30:00 -0500</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-3070435201232973380</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
After writing sample client and while running many a times we get confused whether actual SSL handshake is successful or not with the provided keystore and password parameters , in such cases below parameter helps understanding ssl handshake details. &lt;br /&gt;
&lt;b&gt;-Djavax.net.debug=ssl&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Sample run command : &lt;br /&gt;
&lt;i&gt;&lt;b&gt;&lt;br /&gt;java -Djavax.net.ssl.trustStore=/spl/etc/iscks.jks -Djavax.net.ssl.trustStorePassword=csi123 -Djavax.net.ssl.keyStore=/lps/etc/iscks.jks -Djavax.net.ssl.keyStorePassword=csi123 -Djavax.net.debug=ssl spl.isc.ISCWebServiceClient&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
And another common problem is that we want to see how soap request and response is happening . &lt;br /&gt;
&lt;br /&gt;
in such case use the below java code in the client to see how soap request and response happens &lt;br /&gt;
&lt;i&gt;&lt;b&gt;-Djavax.net.debug=ssl&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Other way :&amp;nbsp; with in java client code.&lt;/b&gt;&lt;br /&gt;
System.setProperty("com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump", "true");&lt;br /&gt;System.setProperty("com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump", "true");&lt;br /&gt;System.setProperty("com.sun.xml.ws.transport.http.HttpAdapter.dump", "true");&lt;br /&gt;System.setProperty("com.sun.xml.internal.ws.transport.http.HttpAdapter.dump", "true");&amp;nbsp; &lt;i&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>JDK Version history - Best Features</title><link>http://www.krishnaspage.com/2014/04/jdk-version-history-best-features.html</link><pubDate>Wed, 16 Apr 2014 04:45:00 -0500</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-2536111576883813428</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div style="text-align: center;"&gt;
&lt;b&gt;JDK Version history - Best Features&lt;/b&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://jaxenter.com/assets/Java-7-The-Top-8-Features-table-one.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://jaxenter.com/assets/Java-7-The-Top-8-Features-table-one.JPG" height="166" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
In this post I'll not go deep into each feature but keep it as a chit-sheet for interview preparation on different JDK best features in different versions.&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;b&gt;JDK 7 - new and best features&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
1. Diamond operator / Type interface &amp;gt;&amp;gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
2. String is now allowed in Switch&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
3.Automatic resource management - try-with-resources statement&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
4.Underscore in Numeric literals _&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
5. Improved exception handling - Catching Multiple Exception Type in Single Catch Block&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
6. New file system API (NIO 2.0)&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
7. Binary Literals with prefix "0b"&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
8. Fork and Join&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;b&gt;JDK 8 - new and best features&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
1. Lambda Expressions, a new language feature, has been introduced in this release. They enable you to treat functionality as a method argument, or code as data. Lambda expressions let you express instances of single-method interfaces (referred to as functional interfaces) more compactly.&lt;b&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
2.Collections :&amp;nbsp; Classes in the new java.util.stream package provide a Stream API to support functional-style operations on streams of elements. &lt;b&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
Reference : [&lt;a href="http://javarevisited.blogspot.in/2014/04/10-jdk-7-features-to-revisit-before-you.html" target="_blank"&gt;1&lt;/a&gt;] [2] [3] &lt;/div&gt;
&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>Creating Web-Service Client for online webservices using AXIS2</title><link>http://www.krishnaspage.com/2014/04/creating-web-service-client-for-online.html</link><category>Java</category><pubDate>Wed, 16 Apr 2014 03:59:00 -0500</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-976946093740414034</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnHNcv98ClTmy1nHeKhMQBh6EjMns6-SeS-urgCd9Mdy580zIO6b5-5PGQ8w631DKYh2AheXgXOeDMD4eIfa7lGuAXWz1MtW0hq1QubDx_bAcZiqpLaeDCTmj1XRIYpVIuGenhnUGyQmM/s1600/sd.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;Creating WS Client for on-line Web-services...&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
First we should know who is providing on-line web-services(WS).&lt;br /&gt;
&lt;a href="http://www.webservicex.net/"&gt;&lt;b&gt;http://www.webservicex.net&lt;/b&gt;&lt;/a&gt; is one such site where we can find different on-line web-services like Stock Quote, IP Locator etc.&lt;br /&gt;
&lt;br /&gt;
We can see WSDL file for each WS in the above site and using this WSDL we need to generate our client and to query the WS . &lt;br /&gt;
We can send request to the on-line Web-service and in turn we get response for the request from WS . &lt;br /&gt;
So For example if we have generated Stock Quote WS client code , in request we send a symbol (for EX: IBM) to request it's recent stock quote value. &lt;br /&gt;
So in response we should get it's latest value and other stuff. &lt;br /&gt;
&lt;br /&gt;
Before we generate WS Client code for provided WSDL in Stock quote from &lt;a href="http://www.webservicex.net/" target="_blank"&gt;http://www.webservicex.net&amp;nbsp;&lt;/a&gt; . &lt;br /&gt;
Let's see how it works&lt;br /&gt;
&lt;br /&gt;
SOAP UI is one of the easiest way to check this out. &lt;br /&gt;
Download SOAP UI ZIP and launch the SOAP UI .&lt;a href="http://sourceforge.net/projects/soapui/files/soapui/5.0.0/SoapUI-5.0.0-windows-bin.zip/download" target="_blank"&gt; http://sourceforge.net/projects/soapui/files/soapui/5.0.0/SoapUI-5.0.0-windows-bin.zip/download&lt;/a&gt;&lt;br /&gt;
After extracting you can run file : &lt;b&gt;soapui.bat&lt;/b&gt; from it's extracted location &lt;b&gt;Webservices_Stuff\SoapUI-5.0.0\bin&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Create a new project for example StockQuote in SOAPUI and provide WSDL path taken from &lt;a href="http://www.webservicex.net/"&gt;http://www.webservicex.net&lt;/a&gt; for Stock Quote &lt;br /&gt;
WSDL used : &lt;br /&gt;
&lt;a href="http://www.webservicex.net/stockquote.asmx?WSDL"&gt;http://www.webservicex.net/stockquote.asmx?WSDL&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
On the left hand side in the SOAPUI new project is created with GetQuote and Request 1 etc. &lt;br /&gt;
If we double click the Request 1 we will see a window opened with two parts one with Request XML and other one Response XML. &lt;br /&gt;
There in the Request XML if set the ? symbol with IBM like one company symbol and click on run button on the top it gives us the response with&lt;br /&gt;
detailed information on the stock. &lt;br /&gt;
&lt;br /&gt;
So now our next job is to create client code for the StockQuote in our eclipse . &lt;br /&gt;
So first let's download the AXIS2 project to help on this. &lt;br /&gt;
Download axis2-1.6.2-war.zip , from &lt;a href="http://archive.apache.org/dist/axis/axis2/java/core/1.6.1/axis2-1.6.1-war.zip"&gt;http://archive.apache.org/dist/axis/axis2/java/core/1.6.1/axis2-1.6.1-war.zip&lt;/a&gt;&lt;br /&gt;
And Create a user library to hold the required jars in path ... &lt;br /&gt;
Look for screenshot attached. &lt;br /&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnHNcv98ClTmy1nHeKhMQBh6EjMns6-SeS-urgCd9Mdy580zIO6b5-5PGQ8w631DKYh2AheXgXOeDMD4eIfa7lGuAXWz1MtW0hq1QubDx_bAcZiqpLaeDCTmj1XRIYpVIuGenhnUGyQmM/s1600/sd.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnHNcv98ClTmy1nHeKhMQBh6EjMns6-SeS-urgCd9Mdy580zIO6b5-5PGQ8w631DKYh2AheXgXOeDMD4eIfa7lGuAXWz1MtW0hq1QubDx_bAcZiqpLaeDCTmj1XRIYpVIuGenhnUGyQmM/s1600/sd.png" height="320" width="272" /&gt;&lt;/a&gt;&lt;br /&gt;
Now create a java project with name StockQuote and From Eclipse Run &amp;gt; RunConfigurations create new StockQuote run configuration. &lt;br /&gt;
In the main tab provide Project name as &lt;b&gt;StockQuote &lt;/b&gt;and provide main class as &lt;br /&gt;
&lt;b&gt;org.apache.axis2.wsdl.WSDL2Java&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
In the Arguments tab &lt;br /&gt;
under Program arguments &lt;br /&gt;
provide required arguments like &lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;-o C:\Krish\MyDocs\WorkSpaces\My_Java_Workspace\StockQuote&lt;br /&gt;-p com.demo.ws.stock.quote&lt;br /&gt;-u&lt;br /&gt;-uri http://www.webservicex.net/stockquote.asmx?WSDL&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Now run this Run Configuration &lt;br /&gt;
Refresh the StockQuote Project from left navigation on Eclipse. &lt;br /&gt;
Now You should see new code file created for StockQuote Web-Service Client under Src directory. &lt;br /&gt;
&lt;br /&gt;
Observe &lt;b&gt;StockQuoteStub.java &lt;/b&gt;file. &lt;br /&gt;
&lt;br /&gt;
to find out how to construct Request and Response objects &lt;br /&gt;
Now write your main client class ... sample file looks like below .. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Sample Main Code :&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush: java"&gt;import java.rmi.RemoteException;

import net.webservicex.www.GetQuote;
import net.webservicex.www.GetQuoteResponse;

import org.apache.axis2.AxisFault;

import com.demo.ws.stock.quote.StockQuoteStub;

public class MainClient {

 public static void main(String[] args) throws RemoteException {

  try {
   StockQuoteStub stub = new StockQuoteStub();
   GetQuote gq = new GetQuote();
   gq.setSymbol("IBM");
   GetQuoteResponse resp = stub.getQuote(gq);
   System.out.println(resp.getGetQuoteResult());
  } catch (AxisFault e) {
   e.printStackTrace();
  }

 }

}
&lt;/pre&gt;
&lt;b&gt;Sample Output after running this WS :&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;stockquotes&gt;&lt;stock&gt;&lt;symbol&gt;IBM&lt;/symbol&gt;&lt;last&gt;197.02&lt;/last&gt;&lt;date&gt;4/15/2014&lt;/date&gt;&lt;time&gt;4:00pm&lt;/time&gt;&lt;change&gt;-0.75&lt;/change&gt;&lt;open&gt;195.99&lt;/open&gt;&lt;high&gt;197.41&lt;/high&gt;&lt;low&gt;195.42&lt;/low&gt;&lt;volume&gt;5353177&lt;/volume&gt;&lt;mktcap&gt;205.2B&lt;/mktcap&gt;&lt;previousclose&gt;197.77&lt;/previousclose&gt;&lt;percentagechange&gt;-0.38%&lt;/percentagechange&gt;&lt;annrange&gt;172.19 - 211.98&lt;/annrange&gt;&lt;earns&gt;14.942&lt;/earns&gt;&lt;p-e&gt;13.24&lt;/p-e&gt;&lt;name&gt;International Bus&lt;/name&gt;&lt;/stock&gt;&lt;/stockquotes&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnHNcv98ClTmy1nHeKhMQBh6EjMns6-SeS-urgCd9Mdy580zIO6b5-5PGQ8w631DKYh2AheXgXOeDMD4eIfa7lGuAXWz1MtW0hq1QubDx_bAcZiqpLaeDCTmj1XRIYpVIuGenhnUGyQmM/s72-c/sd.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author><enclosure length="18523371" type="application/zip" url="http://archive.apache.org/dist/axis/axis2/java/core/1.6.1/axis2-1.6.1-war.zip"/></item><item><title>Sorting algorithms in java array</title><link>http://www.krishnaspage.com/2014/02/sorting-algorithms-in-java-array.html</link><category>Data Structures</category><category>Java</category><pubDate>Tue, 18 Feb 2014 04:56:00 -0600</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-2401242987765379712</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div style="text-align: center;"&gt;
&lt;span style="color: red;"&gt;&lt;b&gt;Sorting algorithms in java array&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
There are many sorting algorithms in data structures world each having their own pros and cons.&lt;br /&gt;
let's see how these searching algorithms can be implemented in Java using arrays.&amp;nbsp; &lt;br /&gt;
Below are the implemented searching algorithms&amp;nbsp; in the below example code.&lt;br /&gt;
&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Implement bubble sort in java.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Implement selection sort in java.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Implement insertion sort in java.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Implement quick sort in java.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Implement merge sort in java.&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;Sorting class code :&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: java"&gt;package com.krish.sorting;

import java.util.Random;

public class SortingTechniques {
 // Applies selection sort technique to the given array
 public static int[] doSelectionSort(int[] arr) {
  for (int i = 0; i &amp;lt; arr.length - 1; i++) {
   int index = i;
   for (int j = i + 1; j &amp;lt; arr.length; j++) {
    if (arr[j] &amp;lt; arr[index]) {
     index = j;
    }
   }
   int smallerNumber = arr[index];
   arr[index] = arr[i];
   arr[i] = smallerNumber;
  }
  return arr;
 }

 // Applies bubble sort technique to the given array
 public static int[] doBubbleSort(int[] arr) {
  int n = arr.length;
  int k;
  for (int m = n; m &amp;gt;= 0; m--) {
   for (int i = 0; i &amp;lt; n - 1; i++) {
    k = i + 1;
    if (arr[i] &amp;gt; arr[k]) {
     swapNumbers(i, k, arr);
    }
   }
  }
  return arr;

 }

 // Applies Insertion sorting Technique
 public static int[] doInsertionSort(int[] arr) {
  int temp;
  for (int i = 1; i &amp;lt; arr.length; i++) {
   for (int j = i; j &amp;gt; 0; j--) {
    if (arr[j] &amp;lt; arr[j - 1]) {
     temp = arr[j];
     arr[j] = arr[j - 1];
     arr[j - 1] = temp;
    }
   }
  }
  return arr;
 }

 // Applies Quick sort to the given array
 public static void doQuickSort(int lowerIndex, int higherIndex,int[] myArray) {
  int i = lowerIndex;
  int j = higherIndex;
  // calculate pivot number, I am taking pivot as middle index number
  int pivot = myArray[lowerIndex + (higherIndex - lowerIndex) / 2];
  // Divide into two arrays
  while (i &amp;lt;= j) {
   /**
    * In each iteration, we will identify a number from left side which
    * is greater then the pivot value, and also we will identify a
    * number from right side which is less then the pivot value. Once
    * the search is done, then we exchange both numbers.
    */
   while (myArray[i] &amp;lt; pivot) {
    i++;
   }
   while (myArray[j] &amp;gt; pivot) {
    j--;
   }
   if (i &amp;lt;= j) {
    exchangeNumbers(i, j,myArray);
    // move index to next position on both sides
    i++;
    j--;
   }
  }
  // call quickSort() method recursively
  if (lowerIndex &amp;lt; j)
   doQuickSort(lowerIndex, j,myArray);
  if (i &amp;lt; higherIndex)
   doQuickSort(i, higherIndex,myArray);
 }

 private static void exchangeNumbers(int i, int j,int[] myArray) {
  int temp = myArray[i];
  myArray[i] = myArray[j];
  myArray[j] = temp;
 }

 private static void swapNumbers(int i, int k, int[] arr) {
  int temp;
  temp = arr[i];
  arr[i] = arr[k];
  arr[k] = temp;
 }

 public static void printArray(int[] printArray) {
  for (int i : printArray) {
   System.out.print(i);
   System.out.print(", ");
  }
 }

 private static int[] getRandomNumbersArray() {
  Random myRandom = new Random();
  int[] randomArray = { myRandom.nextInt(100), myRandom.nextInt(20),
    myRandom.nextInt(600), myRandom.nextInt(60),
    myRandom.nextInt(200) };
  return randomArray;
 }

 public static void main(String[] args) {

  int[] myArray = getRandomNumbersArray();
  System.out.println("\nBefore Selection sort:");
  printArray(myArray);
  System.out.println("\nAfter Selection sort:");
  printArray(doSelectionSort(myArray));
  
  myArray = getRandomNumbersArray();
  System.out.println("\nBefore Bubble sort:");
  printArray(myArray);
  System.out.println("\nAfter Bubble sort:");
  printArray(doSelectionSort(myArray));
  
  myArray = getRandomNumbersArray();
  System.out.println("\nBefore Insertion sort:");
  printArray(myArray);
  System.out.println("\nAfter Insertion sort:");
  printArray(doSelectionSort(myArray));
  myArray = getRandomNumbersArray();
  
  System.out.println("\nBefore Quick sort:");
  printArray(myArray);
  int length = myArray.length;
  doQuickSort(0, length - 1,myArray);
  System.out.println("\nAfter Quick sort:");
  printArray(myArray);
 }
}

&lt;/pre&gt;
&lt;b&gt;&amp;nbsp;Output :&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;Before Selection sort:&lt;br /&gt;10, 0, 480, 41, 175, &lt;br /&gt;After Selection sort:&lt;br /&gt;0, 10, 41, 175, 480, &lt;br /&gt;Before Bubble sort:&lt;br /&gt;77, 3, 91, 4, 8, &lt;br /&gt;After Bubble sort:&lt;br /&gt;3, 4, 8, 77, 91, &lt;br /&gt;Before Insertion sort:&lt;br /&gt;35, 14, 41, 24, 168, &lt;br /&gt;After Insertion sort:&lt;br /&gt;14, 24, 35, 41, 168, &lt;br /&gt;Before Quick sort:&lt;br /&gt;6, 9, 188, 21, 102, &lt;br /&gt;After Quick sort:&lt;br /&gt;6, 9, 21, 102, 188,&lt;br /&gt;
&lt;br /&gt;
References : [&lt;a href="http://datastructure-using-java.blogspot.in/2010/03/selection-sort-quick-sort-merge-sort.html" target="_blank"&gt;1&lt;/a&gt;][&lt;a href="http://java2novice.com/java-sorting-algorithms/quick-sort/" target="_blank"&gt;2&lt;/a&gt;]&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>Queue implementation using linked list in Java</title><link>http://www.krishnaspage.com/2014/02/queue-implementation-using-linked-list.html</link><category>Data Structures</category><category>Java</category><pubDate>Tue, 18 Feb 2014 03:50:00 -0600</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-8738865090927765362</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div style="text-align: center;"&gt;
&lt;span style="color: red;"&gt;&lt;b&gt;Queue implementation using linked list in Java&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
Queue is another famous data structure which allows operating from two ends(front and rear) through head and tail. It works in First In First Out(&lt;b&gt;FIFO&lt;/b&gt;) fashion. &lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcSBA05tAQeEKEPoA5mctcOVh4omVlO5CydESupJ4nIcuqovyhWKsQ" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcSBA05tAQeEKEPoA5mctcOVh4omVlO5CydESupJ4nIcuqovyhWKsQ" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
Queue data structure is like two ended room which allows entry(enqueue) from one end called as rear and exit (dequeue) from another end called a front...&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
So to remember , queue always supports insertion from rear-end / tail and deletion called as dequeue happens only from fron end / head. &lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
Let's see how can we implement simple Queue data structure in Java using a single linked list.&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
We need follow the Cell class we have used in the&lt;a href="http://www.krishnababug.com/2014/02/stack-implementation-using-linked-list.html" target="_blank"&gt; Stack example &lt;/a&gt;in the &lt;a href="http://www.krishnababug.com/2014/02/stack-implementation-using-linked-list.html" target="_blank"&gt;previous post&lt;/a&gt;. &lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;b&gt;Queue main class :&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;/div&gt;
&lt;pre class="brush: java"&gt;package com.krish.queue;

import com.krish.datastructures.common.Cell;

public class QueueMain {
 Cell head;
 Cell tail;

 public QueueMain() {
  head = null;
  tail = null;
 }

 public void enqueue(Object obj) {
  Cell newCell = new Cell(obj, null);
  if (head == null &amp;amp;&amp;amp; tail == null)
   head = newCell;
  else
   tail.next = newCell;
  tail = newCell;
  System.out.println("Enqueud element:"+obj);
  printQueue();
 }

 public Cell front() {
  return head;
 }

 public Cell rear() {
  return tail;
 }

 public void dequeue() {
  if (head == null &amp;amp;&amp;amp; tail == null) {
   System.out.println("Q is empty");
  } else {
   System.out.println("Dequeued element:"+head.getVal());
   if (head.next == null) {
    tail = null;
   }
   head = head.next;
  }
  printQueue();
 }

 public int getsize() {
   int size = 0;
  if(!(head ==null &amp;amp;&amp;amp; tail == null)){
     size = 1;
     for(Cell n = head; n.next != null; n = n.next)
         size = size+1; 
  
     return size;
  }
  return size;
  }

 public void printQueue() {
  if (head == null &amp;amp;&amp;amp; tail == null) {
   System.out.println("Q is empty");
  } else {
   System.out.println("Q Elememts:");
   Cell current = head;
   System.out.println("Head");
   while (current != null) {
    System.out.println("-&amp;gt;" + current.getVal());
    current = current.next;
   }
   System.out.println("&lt;--tail br=""&gt;   System.out.println("Size of the Q:"+getsize());
  }
 }

 public static void main(String[] args) {
  QueueMain queue = new QueueMain();
  queue.enqueue(23);
  queue.enqueue(43);
  queue.enqueue(143);
  queue.enqueue(321);
  queue.dequeue();
  queue.dequeue();
 }
}
&lt;/--tail&gt;&lt;/pre&gt;
&lt;div style="text-align: left;"&gt;
&lt;b&gt;Output :&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
Enqueud element:23&lt;br /&gt;Q Elememts:&lt;br /&gt;Head&lt;br /&gt;-&amp;gt;23&lt;br /&gt;&lt;--tail br=""&gt;Size of the Q:1&lt;br /&gt;Enqueud element:43&lt;br /&gt;Q Elememts:&lt;br /&gt;Head&lt;br /&gt;-&amp;gt;23&lt;br /&gt;-&amp;gt;43&lt;br /&gt;&lt;--tail br=""&gt;Size of the Q:2&lt;br /&gt;Enqueud element:143&lt;br /&gt;Q Elememts:&lt;br /&gt;Head&lt;br /&gt;-&amp;gt;23&lt;br /&gt;-&amp;gt;43&lt;br /&gt;-&amp;gt;143&lt;br /&gt;&lt;--tail br=""&gt;Size of the Q:3&lt;br /&gt;Enqueud element:321&lt;br /&gt;Q Elememts:&lt;br /&gt;Head&lt;br /&gt;-&amp;gt;23&lt;br /&gt;-&amp;gt;43&lt;br /&gt;-&amp;gt;143&lt;br /&gt;-&amp;gt;321&lt;br /&gt;&lt;--tail br=""&gt;Size of the Q:4&lt;br /&gt;Dequeued element:23&lt;br /&gt;Q Elememts:&lt;br /&gt;Head&lt;br /&gt;-&amp;gt;43&lt;br /&gt;-&amp;gt;143&lt;br /&gt;-&amp;gt;321&lt;br /&gt;&lt;--tail br=""&gt;Size of the Q:3&lt;br /&gt;Dequeued element:43&lt;br /&gt;Q Elememts:&lt;br /&gt;Head&lt;br /&gt;-&amp;gt;143&lt;br /&gt;-&amp;gt;321&lt;br /&gt;&lt;--tail br=""&gt;Size of the Q:2&lt;/--tail&gt;&lt;/--tail&gt;&lt;/--tail&gt;&lt;/--tail&gt;&lt;/--tail&gt;&lt;/--tail&gt;&lt;br /&gt;
&lt;br /&gt;
References : [&lt;a href="http://en.wikibooks.org/wiki/Data_Structures/Stacks_and_Queues#Queues" target="_blank"&gt;1&lt;/a&gt;][&lt;a href="http://stackoverflow.com/questions/12617021/measure-size-length-of-singly-linked-list-in-java" target="_blank"&gt;2&lt;/a&gt;][&lt;a href="http://docs.oracle.com/javase/7/docs/api/java/util/LinkedList.html" target="_blank"&gt;3&lt;/a&gt;][&lt;a href="http://datastructure-using-java.blogspot.in/2010/02/implement-all-queue-operations-using.html" target="_blank"&gt;4&lt;/a&gt;]&lt;/div&gt;
&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>Stack implementation using linked list in Java </title><link>http://www.krishnaspage.com/2014/02/stack-implementation-using-linked-list.html</link><category>Data Structures</category><category>Java</category><pubDate>Mon, 17 Feb 2014 07:40:00 -0600</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-260415831491251337</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div style="text-align: center;"&gt;
&lt;span style="color: red;"&gt;&lt;b&gt;Stack implementation using linked list in Java with out using arrays &lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
We have seen implementing the &lt;a href="http://www.krishnababug.com/2014/02/stack-implementation-in-java.html" target="_blank"&gt;stack using arrays&lt;/a&gt; in java in the previous post which has certain &lt;a href="http://www.krishnababug.com/2014/02/stack-implementation-in-java.html" target="_blank"&gt;drawbacks &lt;/a&gt;like inserting / deleting an element from the desired or particular location. &lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
So in a linked list there is a connection for each node / cell (it contains one object to hold desired value and link to the next node / cell).&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
So when user pushed an element to the stack first element goes to the end, and the recently pushed item will have connection to the last recent item.&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
so when a new node is pushed, existing top becomes old and new one becomes top similarly for each pop operation in stack takes out top element and his next becomes present top.&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
below example code helps to understand linked list creation using Cell class an StackUsing LinkedList class helps will do actual push and pop operations&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;b&gt;Cell Class : (Linked list) :&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;pre class="brush: java"&gt;package com.krish.datastructures.common;

public class Cell {
	Object val; // value in the cell
	public Cell next; // the address of the next cell in the list

	/**
	 * Constructor Cell builds a new cell
	 * 
	 * @param value
	 *            - the value inserted in the cell
	 * @param link
	 *            - the cell that is chained to this new cell
	 */
	public Cell(Object value, Cell link) {
		val = value;
		next = link;
	}

	/** getVal returns the value held in the cell */
	public Object getVal() {
		return val;
	}

	/** getNext returns the address of the cell chained to this one */
	public Cell getNext() {
		return next;
	}

	/**
	 * setNext resets the address of the cell chained to this one
	 * 
	 * @param link
	 *            - the address of the Cell that is chained to this one
	 */
	public void setNext(Cell link) {
		next = link;
	}
}

&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;b&gt;Stack using Linked list :&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class="brush: java"&gt;package com.krish.stack;

import com.krish.datastructures.common.Cell;

public class StackUsingLinkedLists {
	public static Cell top;

	/** Constructor Stack creates an empty stack */
	public StackUsingLinkedLists() {
		top = null;
	}

	/**
	 * push inserts a new element onto the stack
	 * 
	 * @param ob
	 *            - the element to be added
	 */
	public void push(Object ob) {
		System.out.println("PUSH : Inserted the element:" + ob);
		top = new Cell(ob, top);
		printStack();
	}

	/**
	 * pop removes the most recently added element prints error if stack is
	 * empty
	 */
	public void pop() {
		if (top == null) {
			System.out.println("POP: Stack error: stack empty");
		} else {
			Object answer = top.getVal();
			top = top.getNext();
			System.out.println("POP: popped the element:" + answer);
			printStack();
		}

	}

	/**
	 * top returns the identity of the most recently added element
	 * 
	 * @return the element
	 * @exception RuntimeException
	 *                if stack is empty
	 */
	public Object top() {
		if (top == null) {
			throw new RuntimeException("Stack error: stack empty");
		}
		return top.getVal();
	}

	/**
	 * isEmpty states whether the stack has 0 elements.
	 * 
	 * @return whether the stack has no elements
	 */
	public boolean isEmpty() {
		return (top == null);
	}

	// Print the stack elements by using top and next
	public void printStack() {
		if (top == null) {
			System.out.println("PRINT: Stack error: stack empty");
		} else {
			System.out.println("PRINT:These are the stack elements now!");
			Cell temp = top;
			while (temp != null) {
				System.out.println(temp.getVal());
				temp = temp.next;
			}
		}
	}

	public static void main(String[] args) {
		StackUsingLinkedLists stack = new StackUsingLinkedLists();
		stack.pop();
		stack.push(23);
		stack.push(267);
		stack.push(500);
		stack.pop();
		stack.pop();
		stack.pop();
	}
}
&lt;/pre&gt;
&lt;div style="text-align: left;"&gt;
&lt;b&gt;Output :&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
POP: Stack error: stack empty&lt;br /&gt;PUSH : Inserted the element:23&lt;br /&gt;PRINT:These are the stack elements now!&lt;br /&gt;23&lt;br /&gt;PUSH : Inserted the element:267&lt;br /&gt;PRINT:These are the stack elements now!&lt;br /&gt;267&lt;br /&gt;23&lt;br /&gt;PUSH : Inserted the element:500&lt;br /&gt;PRINT:These are the stack elements now!&lt;br /&gt;500&lt;br /&gt;267&lt;br /&gt;23&lt;br /&gt;POP: popped the element:500&lt;br /&gt;PRINT:These are the stack elements now!&lt;br /&gt;267&lt;br /&gt;23&lt;br /&gt;POP: popped the element:267&lt;br /&gt;PRINT:These are the stack elements now!&lt;br /&gt;23&lt;br /&gt;POP: popped the element:23&lt;br /&gt;PRINT: Stack error: stack empty&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;b&gt;Reference : [&lt;a href="http://www.sanfoundry.com/java-program-implement-stack-using-linked-list/" target="_blank"&gt;1&lt;/a&gt;] [&lt;a href="http://people.cis.ksu.edu/~schmidt/300s05/Lectures/Week4.html" target="_blank"&gt;2&lt;/a&gt;]&amp;nbsp;&lt;/b&gt; &lt;/div&gt;
&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>Stack implementation in Java</title><link>http://www.krishnaspage.com/2014/02/stack-implementation-in-java.html</link><category>Data Structures</category><category>Java</category><pubDate>Mon, 17 Feb 2014 03:15:00 -0600</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-3410338731124957259</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Stack implementation in Java&lt;br /&gt;
Stack : Stack in first in last out operated data structure ,where the first inserted (push'ed)element into the stack will be taken out (pop'ed) at last. it is like single door room . Those who enters room first will be able to come out only in the last . In other word last pushed element will be poped out first .&lt;br /&gt;
&lt;br /&gt;
which we call generally as LIFO - Last In First Out&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjTBbAr60ZQ2OGwxIrgzXvHNA-2taIDu08mLjKvr6usAnKf6XGXTpffFZ_rQMesAX3Ptrk4LAl3Sm08UswlxZNN691QNQAMBjjFUeqXzH9eSkEavXAeIoFfW5UpsNPGRa-fom2-lnhy58v/s320/stack-datastructure.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjTBbAr60ZQ2OGwxIrgzXvHNA-2taIDu08mLjKvr6usAnKf6XGXTpffFZ_rQMesAX3Ptrk4LAl3Sm08UswlxZNN691QNQAMBjjFUeqXzH9eSkEavXAeIoFfW5UpsNPGRa-fom2-lnhy58v/s320/stack-datastructure.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
We can implement this stack using Java arrays like below ...&lt;br /&gt;
The below implementation takes/reads size of the stack what user want to create and implements stack operations.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Main Program :&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush: java"&gt;package com.krish.stack;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class StackMain {

	public static void main(String[] args) {
		try{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String size;

		System.out.println("Enter stack size u want to create : ");
		size = br.readLine();
		System.out.println("Creating a Stack size is:"+Integer.parseInt(size));
		Stack stack = new Stack(Integer.parseInt(size));
		stack.printStackElements();
		stack.push(100);
		stack.push(200);
		stack.push(300);
		stack.pop();
		stack.pop();
		stack.pop();
		}
		catch(Exception e){
			e.printStackTrace();
		}
	}

}

&lt;/pre&gt;
&lt;b&gt;Stack Class:&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush: java"&gt;package com.krish.stack;

public class Stack {
	int[] myStack;
	int top = -1;
	int size;

	public Stack(int size) {
		this.size = size;
		myStack = new int[size];
	}

	public void printStackElements() {
		if (top &amp;gt;= 0) {
			System.out.println("Present elements in the stack:");
			for (int i = 0; i &amp;lt;= top; i++) {
				System.out.println("Element at " + i + "position is "
						+ myStack[i]);
			}

		} else {
			System.out.println("Stack is empty");

		}

	}

	public void push(int element) {
		if (top &amp;lt; size - 1) {
			System.out.println("Pushing " + element + " to stack now");
			System.out.println("After push()");
			top++;
			myStack[top] = element;
			printStackElements();

		} else {
			System.out.println("Stack overflow; element can't be pushed");
		}
	}

	public void pop() {
		if (top &amp;gt;= 0) {
			System.out.println("Poping the top element now:" + myStack[top]);
			top--;
			printStackElements();
		} else {
			System.out.println("stack undeflow");
		}
	}
}

&lt;/pre&gt;
&lt;b&gt;Output :&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;Enter stack size u want to create : &lt;br /&gt;
2&lt;br /&gt;
Creating a Stack size is:2&lt;br /&gt;
Stack is empty&lt;br /&gt;
Pushing 100 to stack now&lt;br /&gt;
After push()&lt;br /&gt;
Present elements in the stack:&lt;br /&gt;
Element at 0position is 100&lt;br /&gt;
Pushing 200 to stack now&lt;br /&gt;
After push()&lt;br /&gt;
Present elements in the stack:&lt;br /&gt;
Element at 0position is 100&lt;br /&gt;
Element at 1position is 200&lt;br /&gt;
Stack overflow; element can't be pushed&lt;br /&gt;
Poping the top element now:200&lt;br /&gt;
Present elements in the stack:&lt;br /&gt;
Element at 0position is 100&lt;br /&gt;
Poping the top element now:100&lt;br /&gt;
Stack is empty&lt;br /&gt;
stack undeflow&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Advantages and disadvanaatages of using arrays in this :&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
1. &lt;span style="color: blue;"&gt;We can access any stack element when in array at any point of time randomly.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
2. &lt;span style="color: #cc0000;"&gt;Size is fixed we can't add more elements. &lt;/span&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
3. &lt;span style="color: #cc0000;"&gt;If we want to remove an element in between the elements then it is difficult to adjust the other elements.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #cc0000;"&gt;4. IF we want to insert at a particular position in between the array also it is difficult. &lt;/span&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Reference : [&lt;a href="http://www.beingjavaguys.com/2013/07/stack-implementation-in-java.html" target="_blank"&gt;1&lt;/a&gt;]&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjTBbAr60ZQ2OGwxIrgzXvHNA-2taIDu08mLjKvr6usAnKf6XGXTpffFZ_rQMesAX3Ptrk4LAl3Sm08UswlxZNN691QNQAMBjjFUeqXzH9eSkEavXAeIoFfW5UpsNPGRa-fom2-lnhy58v/s72-c/stack-datastructure.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>SQL injection - Java</title><link>http://www.krishnaspage.com/2014/02/sql-injection-java.html</link><category>Database</category><category>Java</category><pubDate>Mon, 17 Feb 2014 00:58:00 -0600</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-2577273330675666206</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div style="text-align: center;"&gt;
&lt;b&gt;&lt;span style="color: red;"&gt;SQL Injection&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
SQL injection is a code injection technique, used to attack data driven applications, in which malicious SQL statements are inserted into an entry field for execution (e.g. to dump the database contents to the attacker).[1] SQL injection must exploit a security vulnerability in an application's software, for example, when user input is either incorrectly filtered for string literal escape characters embedded in SQL statements or user input is not strongly typed and unexpectedly executed. SQL injection is mostly known as an attack vector for websites but can be used to attack any type of SQL database.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;b&gt;PreparedStatements &lt;/b&gt;are the way to go, because they make SQL injection impossible. Here's a simple example taking the user's input as the parameters:&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class="brush: java"&gt;public insertUser(String name, String email) {
   Connection conn = null;
   PreparedStatement stmt = null;
   try {
      conn = setupTheDatabaseConnectionSomehow();
      stmt = conn.prepareStatement("INSERT INTO person (name, email) values (?, ?)");
      stmt.setString(1, name);
      stmt.setString(2, email);
      stmt.executeUpdate();
   }
   finally {
      try {
         if (stmt != null) { stmt.close(); }
      }
      catch (Exception e) {
         // log this error
      }
      try {
         if (conn != null) { conn.close(); }
      }
      catch (Exception e) {
         // log this error
      }
   }
}
&lt;/pre&gt;
&lt;b&gt;Reference : &lt;/b&gt;
&lt;a href="http://stackoverflow.com/questions/1812891/java-escape-string-to-prevent-sql-injection"&gt;http://stackoverflow.com/questions/1812891/java-escape-string-to-prevent-sql-injection&lt;/a&gt;
&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>JDBC - Java -  Interview questions</title><link>http://www.krishnaspage.com/2014/02/jdbc-java-interview-questions.html</link><category>Database</category><category>Java</category><pubDate>Mon, 17 Feb 2014 00:51:00 -0600</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-8401806628069395598</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div style="text-align: center;"&gt;
&lt;b&gt;&lt;span style="color: red;"&gt;JDBC - Java - Theory - Interview questions&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;b&gt;JDBC Basics :&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;Establishing a connection. : &lt;/b&gt;First, establish a connection with the data source you want to use. A data source can be a DBMS, a legacy file system, or some other source of data with a corresponding JDBC driver. This connection is represented by a Connection object.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;b&gt; Create a statement. : &lt;/b&gt;A Statement is an interface that represents a SQL statement. You execute Statement objects, and they generate ResultSet objects, which is a table of data representing a database result set. You need a Connection object to create a Statement object.&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; There are three different kinds of statements:&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;Statement:&lt;/b&gt; Used to implement simple SQL statements with no parameters.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;PreparedStatement: &lt;/b&gt;(Extends Statement.) Used for precompiling SQL statements that might contain input parameters. See Using Prepared Statements for more information.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;CallableStatement:&lt;/b&gt; (Extends PreparedStatement.) Used to execute stored procedures that may contain both input and output parameters. See Stored Procedures for more information.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Execute the query. :&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; To execute a query, call an execute method from Statement such as the following:&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;execute: R&lt;/b&gt;eturns true if the first object that the query returns is a ResultSet object. Use this method if the query could return one or more ResultSet objects. Retrieve the ResultSet objects returned from the query by repeatedly calling Statement.getResultSet.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;b&gt; executeQuery:&lt;/b&gt; Returns one ResultSet object.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;b&gt; executeUpdate: &lt;/b&gt;Returns an integer representing the number of rows affected by the SQL statement. Use this method if you are using INSERT, DELETE, or UPDATE SQL statements.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;b&gt; Process the ResultSet object. : &lt;/b&gt;You access the data in a ResultSet object through a cursor. Note that this cursor is not a database cursor. This cursor is a pointer that points to one row of data in the ResultSet object. Initially, the cursor is positioned before the first row. You call various methods defined in the ResultSet object to move the cursor.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;Close the connection. : &lt;/b&gt;When you are finished using a Statement, call the method Statement.close to immediately release the resources it is using. When you call this method, its ResultSet objects are closed.&lt;br /&gt;&lt;br /&gt;For example, the method CoffeesTables.viewTable ensures that the Statement object is closed at the end of the method, regardless of any SQLException objects thrown, by wrapping it in a finally block:&lt;br /&gt;&lt;br /&gt;} finally {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (stmt != null) { stmt.close(); }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;JDBC throws an SQLException when it encounters an error during an interaction with a data source.&lt;/div&gt;
&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item><item><title>DB2 - GROUP BY - HAVING</title><link>http://www.krishnaspage.com/2014/01/db2-group-by-having.html</link><category>Database</category><category>DB2</category><pubDate>Mon, 6 Jan 2014 23:48:00 -0600</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6133978473254512685.post-5746181485818581830</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div data-mce-style="text-align: center;" style="text-align: center;"&gt;
&lt;strong&gt;DB2 - GROUP BY - HAVING&lt;/strong&gt;&lt;/div&gt;
&lt;div data-mce-style="text-align: left;"&gt;
GROUP BY : To group different rows of data on specific coloumn name .&lt;/div&gt;
&lt;div data-mce-style="text-align: left;"&gt;
HAVING : on finale output of select query put we can put a condition to filter specific&lt;/div&gt;
&lt;div data-mce-style="text-align: left;"&gt;
Note : While &lt;strong&gt;"WHERE"&lt;/strong&gt; is used to apply selection criteria to the base data, &lt;strong&gt;"HAVING"&lt;/strong&gt; is used to apply selection criteria to the grouped data:&lt;/div&gt;
&lt;div data-mce-style="text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div data-mce-style="text-align: left;"&gt;
Example 1 :&lt;/div&gt;
&lt;h2 class="plain"&gt;
TOUR_GROUP : &lt;span data-mce-style="font-size: 8pt;" style="font-size: 8pt;"&gt;Table has following coloumns &lt;/span&gt;&lt;/h2&gt;
&lt;div data-mce-style="text-align: left;"&gt;
&lt;strong&gt;TOUR&amp;nbsp;&amp;nbsp;&amp;nbsp; GUIDE&amp;nbsp;&amp;nbsp;&amp;nbsp; LANGUAGE&amp;nbsp;&amp;nbsp;&amp;nbsp; TOUR_DATE&amp;nbsp;&amp;nbsp;&amp;nbsp; START_TIME&amp;nbsp;&amp;nbsp;&amp;nbsp; END_TIME&amp;nbsp;&amp;nbsp;&amp;nbsp; GROUP_SIZE&amp;nbsp;&amp;nbsp;&amp;nbsp; AVAILABILITY&lt;/strong&gt;&lt;/div&gt;
&lt;div data-mce-style="text-align: left;"&gt;
Query 1 :&lt;br /&gt;&lt;br /&gt;SELECT LANGUAGE, COUNT(*) "NUMBER_OF_TOURS", MAX(GROUP_SIZE) "MAX_GROUP_SIZE", MIN(GROUP_SIZE) "MIN_GROUP_SIZE"&lt;br /&gt;FROM TOUR_GROUP&lt;br /&gt;GROUP BY LANGUAGE&lt;br /&gt;ORDER BY NUMBER_OF_TOURS;&lt;br /&gt;&lt;br /&gt;Query 2 :&lt;/div&gt;
&lt;div data-mce-style="text-align: left;"&gt;
SELECT LANGUAGE, COUNT(*) "NUMBER_OF_TOURS", MAX(GROUP_SIZE) "MAX_GROUP_SIZE", MIN(GROUP_SIZE) "MIN_GROUP_SIZE"&lt;br /&gt;FROM TOUR_GROUP&lt;br /&gt;WHERE GROUP_SIZE &amp;lt;= 20&lt;br /&gt;GROUP BY LANGUAGE&lt;br /&gt;HAVING COUNT(*) &amp;gt; 1&lt;br /&gt;ORDER BY NUMBER_OF_TOURS;&lt;/div&gt;
&lt;div data-mce-style="text-align: left;"&gt;
Query 3 :&lt;/div&gt;
&lt;div data-mce-style="text-align: left;"&gt;
SELECT TOUR, COUNT (DISTINCT LANGUAGE) "NUMBER_LANGUAGES"&lt;br /&gt;FROM TOUR_GROUP&lt;br /&gt;GROUP BY TOUR&lt;br /&gt;ORDER BY COUNT(DISTINCT LANGUAGE), TOUR;&lt;/div&gt;
&lt;div data-mce-style="text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div data-mce-style="text-align: left;"&gt;
Reference : [&lt;a data-mce-href="http://www.gatebase.toucansurf.com/db2examples11.html" href="http://www.gatebase.toucansurf.com/db2examples11.html"&gt;1&lt;/a&gt;] [2]&lt;/div&gt;
&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>Krishnaspage@gmail.com (Krishna)</author></item></channel></rss>