<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8882377031456587900</id><updated>2026-07-25T17:32:20.617+05:30</updated><category term="API"/><category term="Simple Java Codes"/><category term="Guest Post"/><category term="Javascript"/><category term="Eclipse"/><category term="Exception"/><category term="Apache"/><category term="LINUX"/><category term="HTML"/><category term="JSP"/><category term="MY SQL"/><category term="UNIX"/><category term="SpringBoot"/><category term="DB2"/><category term="Spring"/><category term="Maven"/><category term="String"/><category term="Web Service"/><category term="SQLCODE"/><category term="Cryptography"/><category term="Oracle"/><category term="PHP"/><category term="shell script"/><category term="ClassNotFoundException"/><category term="Jar File"/><category term="MS SQL"/><category term="DWR"/><category term="Image processing"/><category term="JDBC"/><category term="AJAX"/><category term="hibernate"/><category term="pom.xml"/><category term="FileNotFoundException"/><category term="JQuery"/><category term="Lucene"/><category term="NoClassDefFoundError"/><category term="mail"/><category term="Install MY SQL"/><category term="Interview questions"/><category term="JAXB"/><category term="JSON"/><category term="Junit"/><category term="Python"/><category term="ReactJs"/><category term="SQLException"/><category term="Servlet"/><category term="Thread"/><category term="Tomcat"/><category term="XML"/><category term="error"/><category term="CSV File"/><category term="ConnectException"/><category term="Docker"/><category term="Eureka"/><category term="Game"/><category term="JSTL"/><category term="JasperException"/><category term="Liferay"/><category term="Quartz"/><category term="Redux"/><category term="Restful"/><category term="Service discovery"/><category term="Spring Cloud"/><category term="iCal4j"/><category term="iCalendar"/><category term="Axis"/><category term="CSS"/><category term="Compare Files"/><category term="Design Patterns"/><category term="IllegalArgumentException"/><category term="JBehave"/><category term="LDAP"/><category term="Log4j"/><category term="Netflix"/><category term="NoSuchMethodError"/><category term="Number"/><category term="Prepared Statement"/><category term="Robot"/><category term="SQL Injection"/><category term="SSLHandshakeException"/><category term="SVN"/><category term="Threads"/><category term="UnknownHostException"/><category term="UnsatisfiedLinkError"/><category term="react native"/><category term="AQT"/><category term="AWS"/><category term="ActiveMQ"/><category term="AngularJS"/><category term="Axios"/><category term="BLOB"/><category term="Block chain"/><category term="Cucumber"/><category term="FTP"/><category term="HTML5"/><category term="Indenting XML"/><category term="JMS"/><category term="JSh"/><category term="JVM"/><category term="JWT"/><category term="Java 7"/><category term="Java 9"/><category term="JavaFx"/><category term="Lambda"/><category term="LockObtainFailedException"/><category term="Mockito"/><category term="Node"/><category term="PM2"/><category term="Quicksight"/><category term="Read doc"/><category term="Refection API"/><category term="Ribbon"/><category term="SSH"/><category term="Serialization"/><category term="Sound"/><category term="Tech Articles"/><category term="UTC Time"/><category term="ZipException"/><category term="Zuul"/><category term="draft-js"/><category term="garbage collection"/><category term="gradle"/><category term="java21"/><category term="keystore"/><category term="react"/><category term="rich text editor"/><title type='text'>JavaXp.com | Java Experts Blog | Java Examples | API | Errors | Exceptions</title><subtitle type='html'>&lt;b&gt;Java, J2EE, SQL, Frameworks, APIs, Exceptions and more..&lt;/b&gt;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.javaxp.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>388</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-1656337754100302329</id><published>2025-10-15T03:07:00.002+05:30</published><updated>2025-10-15T03:07:26.524+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Guest Post"/><title type='text'>Java Performance Optimization for High-Volume Search Applications</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;span id=&quot;docs-internal-guid-c72c253e-7fff-e6bc-c517-0d26a6d1a046&quot;&gt;&lt;div style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: left;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; text-align: justify; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Imagine a search box that must sweep billions of records across more than fifty data sources and still answer in under three seconds while thousands of people are clicking at once. That is the everyday reality for public unclaimed property lookups. Latency here is not a vanity metric. Ten seconds feels like forever, and thirty seconds often means a user gives up and never finds the money that could cover rent, tuition, or medical bills. Java can handle this scale, but large datasets, legacy endpoints, and network drag can slow even well-written code. The question is blunt: how do you deliver Google-like speed on top of upstream systems that were never designed for it? Below is a practical playbook drawn from turning a single-state search that took more than thirty seconds into a fifty-state sweep that lands under three seconds, with lessons you can reuse in any high-volume Java search.&lt;/span&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; text-align: justify; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;text-wrap-mode: nowrap;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 12pt; text-align: center;&quot;&gt;&lt;a href=&quot;https://stackify.com/java-performance-tuning/&quot; style=&quot;text-decoration-line: none;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;color: #1155cc; font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; text-decoration-line: underline; text-decoration-skip-ink: none; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;&lt;span style=&quot;border: none; display: inline-block; height: 360px; overflow: hidden; width: 720px;&quot;&gt;&lt;img height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEi2ISpj4EEosmZnTSnOPwNuuA2TE3dLQEZYgwITh0GD5BaFWAGxV2B6NiT3CpuF0h_3eiQqdABXsqWQBYei-27EEvLuGTl_zO98_p8Pl_zGml_96hvCrgPNA1xkNItT_yJpERqZJN2sd8x05IhbXZ--XQlb8bPGcD5lzcrAREB9XhLrJhAOCuqR7BqqpXdg&quot; style=&quot;margin-left: 0px; margin-top: 0px;&quot; width=&quot;720&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;h4 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 12pt; margin-top: 0pt; text-align: center;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 10pt; font-style: italic; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 400; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Java performance in a cup: profile, optimize, repeat.&lt;/span&gt;&lt;/h4&gt;&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Understanding the Performance Bottlenecks&lt;/span&gt;&lt;/h2&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Database Query Time&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;This is commonly the most significant slice. The usual culprits are missing or weak indexes, joins that force full scans, overgrown subqueries, and servers that are starved for CPU, memory, or I O. Shape access paths to exploit indexes, and verify with execution plans rather than hunches.&lt;/span&gt;&lt;/p&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Network Latency&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Parallel calls help, but round-trip calls to external databases, slow links into legacy data centers, API rate limits that serialize requests, repeat DNS lookups, and SSL or TLS setup costs all add up. Minimize handshakes, coalesce requests, and reuse connections aggressively.&lt;/span&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;text-wrap-mode: nowrap;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Data Processing Time&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Large XML or JSON payloads must be parsed, validated, transformed, deduped, fuzzy-matched for names, and ranked. Streaming parsers, compact payloads, and careful algorithm choices trim this section.&lt;/span&gt;&lt;/p&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Application Overhead&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Heavy object churn, the wrong collections for the job, noisy logging, synchronous waits, and needless copying waste CPU. Favor allocation light patterns and keep the hot path small.&lt;/span&gt;&lt;/p&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Measurement is Critical&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;You cannot optimize what you cannot see. Use profilers like VisualVM, JProfiler, or YourKit, plus APM, to find real hotspots under realistic load. Optimize only what measurements justify.&lt;/span&gt;&lt;/p&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Common Misconceptions&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Developers often assume the database is always at fault. Optimization without measurement can make things worse. Tricks that worked for thousands of rows rarely scale to billions.&lt;/span&gt;&lt;/p&gt;&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Database Optimization Strategies&lt;/span&gt;&lt;/h2&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Indexing Strategy&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Indexes move the needle the most. Build composite indexes that mirror user queries, for example, last name, first name, and state. Use covering indexes so the engine reads the needed columns straight from the index. Do not over-index because extra indexes slow writes and bloat storage.&lt;/span&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;text-wrap-mode: nowrap;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Query Optimization&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Reshape queries so the planner can choose indexes. Replace broad ORs with UNION where it improves index use. Remove joins by selectively denormalizing hot read paths. Avoid SELECT* and fetch only needed columns. Cap transferred rows with LIMIT or TOP for first page delivery. Use engine hints only when profiling proves a gain.&lt;/span&gt;&lt;/p&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Connection Pooling&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Creating connections is expensive. Use a fast pool such as HikariCP and size it deliberately. A helpful first guess is pool size equals core count times two plus effective spindle count, then refine using production metrics.&lt;/span&gt;&lt;/p&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Read Replicas&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Split reads from writes. Direct search traffic to read replicas and keep the primary focused on writes. Read heavy systems see immediate throughput gains with minimal code changes.&lt;/span&gt;&lt;/p&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Batch Processing&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;When scanning many jurisdictions, batch lookups are used. One request carrying ten searches can replace ten separate round-trip searches and cut network overhead dramatically.&lt;/span&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;text-wrap-mode: nowrap;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Database Caching&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Enable query result caching where appropriate and tune it using actual hit rates. Popular names repeat, so cached answers land instantly and reduce load.&lt;/span&gt;&lt;/p&gt;&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Application Level Optimization&lt;/span&gt;&lt;/h2&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Concurrency&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Never query fifty states one by one. Use CompletableFuture or virtual threads in Java 21 to issue calls in parallel and then compose results. Total time approaches the slowest upstream, not the sum of all.&lt;/span&gt;&lt;/p&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Caching Layers&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Adopt a three-tier model. L1 is an in-process cache with Caffeine for microsecond access on hot keys. L2 is a distributed cache with Redis, so instances share hits. L3 is an edge cache or CDN for static payloads and precomputed common results. Choose TTLs based on the upstream refresh cadence. For many public datasets, a daily or weekly refresh is adequate.&lt;/span&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;text-wrap-mode: nowrap;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Pagination and Lazy Loading&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Return the first page immediately and stream further pages. Perceived speed rises even if total work stays the same.&lt;/span&gt;&lt;/p&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Object Reuse&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Pool expensive objects. You already have pool connections and threads. Extend that mindset to parsers, mappers, and buffers to cut allocation churn and GC pressure.&lt;/span&gt;&lt;/p&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Garbage Collection Tuning&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Favor low-latency collectors like G1GC or ZGC for interactive search. Tune heap size and GC threads guided by profiling under realistic load. The goal is brief, predictable pauses.&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Implementing these tactics at scale changed outcomes. Platforms like &lt;/span&gt;&lt;a href=&quot;https://www.claimnotify.org/&quot; style=&quot;text-decoration-line: none;&quot; target=&quot;_blank&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;color: #1155cc; font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; text-decoration-line: underline; text-decoration-skip-ink: none; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Claim Notify&lt;/span&gt;&lt;/a&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt; issue parallel queries across more than fifty state data sources, serve millions of lookups from layered caches, and hold response times under three seconds even across billions of records. This demonstrates that Java can feel consumer-grade while wrangling messy, massive datasets.&lt;/span&gt;&lt;/p&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Asynchronous Processing&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Move expensive enrichment to background workers via Kafka or RabbitMQ. Deliver fast first page results and notify users when deep scans complete.&lt;/span&gt;&lt;/p&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Resource Hygiene&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Close streams and sockets with try-with-resources. Track open file descriptors and database handles. Small leaks become production fires under real traffic.&lt;/span&gt;&lt;/p&gt;&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Real World Performance Results&lt;/span&gt;&lt;/h2&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Before Optimization&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;A single state search took thirty to forty-five seconds. A full multi-state pass would have taken more than twenty-five minutes. Concurrency collapsed near a dozen users before timeouts. Database CPU pegged in the high eighties to mid-nineties. The JVM threw intermittent out-of-memory errors. There was no caching.&lt;/span&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;text-wrap-mode: nowrap;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;After Optimization&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;A single state search takes between half a second and one second. A comprehensive fifty-state search returns in two to three seconds. The system handles more than one thousand concurrent users without degradation. Database CPU averages in the twenties to forties. Memory is stable. Cache hit rate reaches seventy-five to eighty percent, which slashes query volume.&lt;/span&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;text-wrap-mode: nowrap;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Performance Metrics That Matter&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;P50 latency sits near 1.2 seconds, P95 near 2.8, and P99 near 4.5. Throughput reaches roughly five hundred searches per second with an error rate under 0.1 percent. Infrastructure cost drops about sixty percent, helped by a seventy percent reduction in database queries due to caching.&lt;/span&gt;&lt;/p&gt;&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Monitoring and Continuous Improvement&lt;/span&gt;&lt;/h2&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;What to Track&lt;/span&gt;&lt;/h3&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Watch latency percentiles, slow query logs, cache hit and miss patterns, heap usage, GC pauses, thread counts, upstream API times, and timeout or error rates. Use APM tools, query analyzers, load testing with JMeter or Gatling, and alerts that trigger on percentile shifts rather than averages. Profile production traffic regularly, A/B test changes, and keep current with Java runtime improvements.&lt;/span&gt;&lt;/p&gt;&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Performance as a Feature&lt;/span&gt;&lt;/h2&gt;&lt;p dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;&quot;&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;Measure first and cut second. Databases deliver the biggest early wins through indexing, query shaping, pooling, replicas, and batching. Parallelism collapses wall time from the sum to the max. Caching multiplies speed and reduces cost. Continuous monitoring preserves the gains. Platforms like ClaimNotify show that disciplined, data-guided engineering lets Java deliver consumer-grade speed on top of complex public data. Start by baselining your system, fix the loudest bottleneck, and repeat. Share the tuning tactics and surprises you discover so the community can push the craft forward.&lt;/span&gt;&lt;span face=&quot;Arial, sans-serif&quot; style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;text-wrap-mode: nowrap;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javaxp.com/feeds/1656337754100302329/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8882377031456587900/1656337754100302329?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/1656337754100302329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/1656337754100302329'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2025/10/java-performance-optimization-for-high.html' title='Java Performance Optimization for High-Volume Search Applications'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEi2ISpj4EEosmZnTSnOPwNuuA2TE3dLQEZYgwITh0GD5BaFWAGxV2B6NiT3CpuF0h_3eiQqdABXsqWQBYei-27EEvLuGTl_zO98_p8Pl_zGml_96hvCrgPNA1xkNItT_yJpERqZJN2sd8x05IhbXZ--XQlb8bPGcD5lzcrAREB9XhLrJhAOCuqR7BqqpXdg=s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-748976334901938896</id><published>2025-03-08T22:57:00.005+05:30</published><updated>2025-03-11T16:21:02.782+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Guest Post"/><title type='text'>Best Java Libraries for XML Data Processing</title><content type='html'>&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span id=&quot;docs-internal-guid-d4bc9776-7fff-5419-7c72-b375e4f8b03c&quot;&gt;&lt;span style=&quot;color: #1d1c1d; font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;&lt;span style=&quot;border: none; display: inline-block; height: 401px; overflow: hidden; width: 602px;&quot;&gt;&lt;img height=&quot;401&quot; src=&quot;https://lh7-rt.googleusercontent.com/docsz/AD_4nXewhQJuW9rGP6Nxoru6OkJ051sbjhUvxBWXm7A69y8IjMw0_gOroBLtFhFsX14I3UhWjjmfbEIY7madWE54PZUxCNcw-eKpAiANLDcNHx_pXorAI4iV_-prnwG-hFg4dTCGnhXRkw?key=-r89afxPOkmlu51zsTIiyWIQ&quot; style=&quot;margin-left: 0px; margin-top: 0px;&quot; width=&quot;602&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://www.freepik.com/premium-photo/java-programming-concept-virtual-machine-server-room-background_30325040.htm#fromView=search&amp;amp;page=1&amp;amp;position=23&amp;amp;uuid=ff354e02-c01b-4d9b-957e-cbb00f0a1c22&amp;amp;query=+Java+Libraries+xml&quot; target=&quot;_blank&quot;&gt;Source&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Users continue to rely on XML (eXtensible Markup Language) for data exchange and storage across Java applications because it delivers adaptable structures for complex information representation. XML demonstrates wide industry application because of its platform-independent format that produces human-readable content.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, the processing of XML data requires careful management due to its difficulties including efficient parsing of big files and database storage consistency with data integrity and fast data transformation.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Top Java Libraries for XML Processing&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span id=&quot;docs-internal-guid-663d5169-7fff-9d4e-52a3-bc2e0b505657&quot;&gt;&lt;span style=&quot;color: #1d1c1d; font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space-collapse: preserve;&quot;&gt;&lt;span style=&quot;border: none; display: inline-block; height: 401px; overflow: hidden; width: 602px;&quot;&gt;&lt;img height=&quot;401&quot; src=&quot;https://lh7-rt.googleusercontent.com/docsz/AD_4nXcgJ7PsRw5XN_0MwAuMSTxD8FGnsLUjC0LOxib_kFlrhZcNzJDBt711BDu9g8bKuGzi8gsvQD_fEQyReLMdYXD0QR66fLuITROScVghqMIjnHMR_WV7S7WWcPxdPRrRTV4P-Nfb_Q?key=-r89afxPOkmlu51zsTIiyWIQ&quot; style=&quot;margin-left: 0px; margin-top: 0px;&quot; width=&quot;602&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://www.freepik.com/premium-photo/computer-programmer-looking-code-desktop-pc_103676879.htm#fromView=search&amp;amp;page=2&amp;amp;position=18&amp;amp;uuid=3067c894-384d-42ab-b7f1-5cbb840c40da&amp;amp;query=+Java+Libraries&quot; target=&quot;_blank&quot;&gt;Source&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The selection of a library depends on two factors: the level of task complexity and the set criteria for system performance.&amp;nbsp;&lt;/div&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The following list contains the main Java libraries that facilitate XML processing:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;JAXB (Java Architecture for XML Binding)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The conversion of Java objects to XML and back to Java objects functions smoothly through this library. Programmers maintain control over Java classes through an automatic XML serializing feature of the library.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;DOM &amp;amp; SAX Parsers&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The two fundamental &lt;a href=&quot;https://www.javaxp.com/2009/10/java-simple-xml-parse.html&quot; target=&quot;_blank&quot;&gt;XML parser&lt;/a&gt; components are DOM (Document Object Model) and SAX (Simple API for XML) which process &lt;a href=&quot;https://www.javaxp.com/2011/12/xml-document-structures-must-start-and.html&quot; target=&quot;_blank&quot;&gt;XML document structures&lt;/a&gt; swiftly. DOM treats the complete XML document as an in-memory tree structure that works best for files with a smaller size.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SAX executes as an event-driven XML parser that sequentially processes data so large XML files use less memory space.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;StAX (Streaming API for XML)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The StAX API functions as a pull-parsing mechanism for achieving both efficiency and memory-friendly XML file handling. Through its stream-based XML processing model, StAX functions as an optimal solution when users have extensive XML information that needs efficient handling while minimizing memory usage.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;dom4j &amp;amp; JDOM&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The user-friendly XML data manipulation libraries dom4j and JDOM provide easy interfaces for XML data processing. Through simple API functions developers can handle XML documents with these libraries while they produce document formats which include XPath and XSLT.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;These XML libraries simplify XML operation and provide developer-friendly access to standard Java XML APIs for those using an alternative to built-in XML solutions.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;XStream&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;XStream serves users by focusing on XML to Java object conversions and their reverse operations. It makes XML serialization and deserialization of Java objects simple by removing the need for complicated configuration.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Using Java XML Libraries to Prepare Data for SQL Databases&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Java libraries serve as fundamental tools to prepare XML data for SQL databases through their capabilities of handling XML content transformation and structure definition to make it usable by relational databases.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;How Java Libraries Help Parse and Transform XML&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The first step requires XML data parsing through JAXB DOM and SAX libraries to produce either structured Java objects or recognizable usable data formats. Developers can utilize these libraries to retrieve particular XML document elements and their attributes.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Parsed XML data moves through libraries StAX or dom4j to achieve a structure that functions according to the relational model of an SQL database.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Best Practices for Structuring XML for SQL Storage&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Here are some key tips:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Flatten Complex XML Structures&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;A flat structure suits relational databases making it advisable to convert nested XML elements into simple row-column combinations. You should use XML elements as relational table counterparts through a process that employs foreign keys for hierarchical information processing.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Normalize Data&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Normalization of database data maintains both consistency of information and protects against repetitive data entry. You should remove repetitive elements in XML data by distributing them across separate related tables to decrease redundant information while securing data consistency.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Use Appropriate Data Types&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The conversion of XML-extracted data must identify matching SQL data types between VARCHAR, INTEGER, and DATE. XStream included in Java libraries enables developers to achieve type conversion which ensures optimized SQL table storage.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Handle Large XML Files in Chunks&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The processing and storage of big XML documents should be done in smaller less cumbersome data increments. StAX libraries enable the streaming of XML data through their parsing functions while also promoting efficient memory utilization to enhance scalability.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Once XML is processed using these Java libraries, the next step is storing it in a relational database. Here’s a &lt;a href=&quot;https://sonra.io/how-to-insert-xml-data-into-sql-table/&quot; target=&quot;_blank&quot;&gt;detailed guide&lt;/a&gt; on how to insert XML data into SQL tables effectively.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Java provides developers with multiple strong libraries that enable effective XML data handling including JAXB, DOM, SAX, StAX and dom4j, JDOM and XStream. These tools help developers improve the flow of XML data to the database while providing efficient storage capabilities.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javaxp.com/feeds/748976334901938896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8882377031456587900/748976334901938896?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/748976334901938896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/748976334901938896'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2025/03/best-java-libraries-for-xml-data.html' title='Best Java Libraries for XML Data Processing'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh7-rt.googleusercontent.com/docsz/AD_4nXewhQJuW9rGP6Nxoru6OkJ051sbjhUvxBWXm7A69y8IjMw0_gOroBLtFhFsX14I3UhWjjmfbEIY7madWE54PZUxCNcw-eKpAiANLDcNHx_pXorAI4iV_-prnwG-hFg4dTCGnhXRkw=s72-c?key=-r89afxPOkmlu51zsTIiyWIQ" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-7450508795900811921</id><published>2025-03-01T18:56:00.000+05:30</published><updated>2025-03-01T18:56:22.032+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="java21"/><title type='text'>Upgrading to Java 21 and Spring Boot 3: A Comprehensive Guide</title><content type='html'>&lt;p&gt;The transition from Java 17 to Java 21, paired with an upgrade to Spring Boot 3, is a transformative step for modern application development. This blog post shares the detailed insights, challenges, and solutions from upgrading various services and Lambda functions to these latest versions. We’ll explore the evolution of dependencies, dive into troubleshooting steps, discuss resolutions for common issues, and provide actionable takeaways to help you succeed in your own upgrade journey.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Overview of the Upgrade&lt;/b&gt;&lt;/p&gt;&lt;p&gt;The upgrade process entailed moving applications from Java 17 to Java 21 and aligning them with Spring Boot 3. This wasn’t a simple plug-and-play operation—it required careful updates to dependencies, adjustments to configurations, and tweaks to codebases to ensure everything worked harmoniously with the new versions. The process touched multiple components, including core services and AWS Lambda functions, each requiring its own set of changes.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Dependency Evolution&lt;/b&gt;&lt;/p&gt;&lt;p&gt;The upgrade unfolded in stages, with dependencies evolving iteratively as issues surfaced and were resolved. Here’s how the key components changed over time:&lt;/p&gt;&lt;p&gt;&lt;b&gt;Java&lt;/b&gt;: Initially running on version 17, the leap to Java 21 introduced a &quot;&lt;a href=&quot;https://stackoverflow.com/questions/77974590/unsupported-class-file-major-version-65-with-java-21-workaround&quot; target=&quot;_blank&quot;&gt;Major version 65&lt;/a&gt;&quot; issue, signaling bytecode incompatibility with older tools. This necessitated updates to other dependencies to align with Java 21’s requirements.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Gradle&lt;/b&gt;: Starting at version 7.2, we upgraded to 8.1 early in the process to leverage its improved features and compatibility with Java 21. However, this shift triggered initial compile errors, which we addressed as part of broader dependency updates.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Spring Boot&lt;/b&gt;: We began with version 2.7.3 but quickly encountered limitations. An intermediate step to 2.7.18 resolved some issues, but JUnit and acceptance test failures persisted. The final move to Spring Boot 3.3.3 was essential to fully support Java 21 and handle the significant shift from javax to jakarta namespaces.&lt;/p&gt;&lt;p&gt;&lt;b&gt;AWS SDK v1&lt;/b&gt;: Version 1.12.139 was in use initially, but it proved incompatible with Java 21. We phased it out entirely, relying instead on AWS SDK v2.&lt;/p&gt;&lt;p&gt;&lt;b&gt;AWS SDK v2&lt;/b&gt;: Starting at 2.17.162, this remained stable throughout the upgrade, though we later validated its compatibility with the final configuration.&lt;/p&gt;&lt;p&gt;&lt;b&gt;LocalStack&lt;/b&gt;: We started with version 1.17.1 for local testing. As issues emerged with Spring Boot 3, we upgraded to 1.20.1 and eventually aligned the LocalStack Docker image to version 3.0.0 for better test reliability.&lt;/p&gt;&lt;p&gt;&lt;b&gt;LocalStack Docker&lt;/b&gt;: The initial version, 0.14.0, was outdated for our needs. Upgrading to 3.0.0 ensured compatibility with the updated LocalStack and Spring Boot 3.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Lombok Plugin&lt;/b&gt;: Version 6.4.3 caused compile errors with Java 21. Upgrading to 8.10 resolved these issues and ensured smooth integration with the new Java version.&lt;/p&gt;&lt;p&gt;&lt;b&gt;AWS Spring&lt;/b&gt;: We began with version 2.4.4, which worked with Spring Boot 2.x. The move to Spring Boot 3 required an update to version 3.1.1 to maintain AWS integration.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Spring Cloud AWS Messaging&lt;/b&gt;: Also at 2.4.4 initially, this dependency was ultimately removed as we streamlined our AWS interactions with SDK v2.&lt;/p&gt;&lt;p&gt;Each step in this evolution addressed specific pain points—whether it was compilation failures, test issues, or runtime errors—bringing us closer to a fully functional Java 21 and Spring Boot 3 setup.&lt;/p&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Known Issues and Solutions&lt;/b&gt;&lt;/div&gt;&lt;p&gt;Throughout the upgrade, several issues emerged that required targeted solutions. Here’s a detailed look at what we encountered and how we resolved them:&lt;/p&gt;&lt;div&gt;&lt;b&gt;1. PortUnreachableException Spamming Logs&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Issue&lt;/b&gt;: After the Spring Boot upgrade, logs became inundated with errors like:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;java.net.PortUnreachableException: recvAddress(..) failed: Connection refused&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Cause&lt;/b&gt;: This stemmed from a StatsD configuration mismatch introduced by Spring Boot’s updated metrics handling.&lt;/div&gt;&lt;p&gt;&lt;b&gt;Solution&lt;/b&gt;: We updated the configuration key from &lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;management.metrics.export.statsd.enabled&lt;/span&gt; to &lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;management.statsd.metrics.export.enabled&lt;/span&gt; and explicitly enabled it in the application’s YAML file:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;management:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;&amp;nbsp; statsd:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;&amp;nbsp; &amp;nbsp; metrics:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; export:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; enabled: true&lt;/span&gt;&lt;/p&gt;&lt;p&gt;This adjustment silenced the log spam and restored proper metrics behavior.&lt;/p&gt;&lt;div&gt;&lt;b&gt;2. Container Privileged Mode&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;Issue&lt;/b&gt;: Running containers in privileged mode clashed with Docker’s user namespaces, causing failures during testing.&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Solution&lt;/b&gt;: We disabled Testcontainers’ Ryuk resource reaper by setting an environment variable:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;TESTCONTAINERS_RYUK_DISABLED=true&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;This workaround allowed our tests to run smoothly without requiring privileged mode adjustments.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;3. Gradle Job Dependency&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Issue&lt;/b&gt;: A task responsible for running the application failed because it implicitly relied on the output of a jar task without declaring a dependency. The error message highlighted this misconfiguration:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;Task uses this output of another task without declaring an explicit or implicit dependency.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Solution&lt;/b&gt;: We modified the build.gradle file to explicitly declare the dependency:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;afterEvaluate {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;&amp;nbsp; &amp;nbsp; tasks.named(&#39;forkedSpringBootRun&#39;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dependsOn &#39;:jar&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This ensured tasks executed in the correct order, resolving the build failure.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;4. Missing AWSCredentials&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Issue&lt;/b&gt;: After removing AWS SDK v1, we encountered a &lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;NoClassDefFoundError: com/amazonaws/auth/AWSCredentials&lt;/span&gt; error, indicating a lingering dependency mismatch.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Solution&lt;/b&gt;: We updated the LocalStack Docker image to &lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;localstack/localstack:3.0.0&lt;/span&gt; and refreshed the Testcontainers dependencies in &lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;build.gradle&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;testImplementation &#39;org.testcontainers:localstack&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;testImplementation &#39;org.testcontainers:testcontainers&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This aligned our local testing environment with the updated AWS SDK v2 setup.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;5. Acceptance Test Failures&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Issue&lt;/b&gt;: Acceptance tests failed due to a missing AmazonSQSAsync bean, disrupting validation of AWS SQS interactions.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Solution&lt;/b&gt;: We added the spring.cloud.aws.sqs.endpoint property to the configuration and updated the Docker entry point to support Java 21. This restored the bean’s availability and fixed the tests.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;public LocalStackContainer create() {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;&amp;nbsp; &amp;nbsp; try (LocalStackContainer localstack =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new LocalStackContainer(DockerImageName.parse(IMAGE_NAME))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .withExposedPorts(EXPOSED_PORT)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .withServices(DYNAMODB, SNS, SQS)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;span style=&quot;font-family: Source Code Pro;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .withCopyToContainer(forClasspathResource(INIT_LOCALSTACK_SH, 0775),&quot;/etc/localstack/init/ready.d/init-localstack.sh&quot;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Source Code Pro&amp;quot;;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .waitingFor(&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Wait.forLogMessage(LOG_MARKER, 1).withStartupTimeout(Duration.ofMinutes(1)))) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; return localstack;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe; font-family: Source Code Pro;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;h2&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Conclusion&lt;/span&gt;&lt;/h2&gt;
&lt;p class=&quot;break-words&quot; style=&quot;white-space-collapse: preserve;&quot;&gt;Upgrading to Java 21 and Spring Boot 3 is a complex but rewarding endeavor. By navigating challenges like log spam from &lt;span class=&quot;text-sm px-1 rounded-sm !font-mono bg-sunset/10 text-rust dark:bg-dawn/10 dark:text-dawn&quot;&gt;PortUnreachableException&lt;/span&gt;, Gradle task misconfigurations, and AWS SDK transitions, you can modernize your applications for improved performance and maintainability. This guide offers a detailed roadmap to help you avoid common pitfalls and achieve a successful upgrade.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javaxp.com/feeds/7450508795900811921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8882377031456587900/7450508795900811921?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/7450508795900811921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/7450508795900811921'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2025/03/upgrading-to-java-21-and-spring-boot-3.html' title='Upgrading to Java 21 and Spring Boot 3: A Comprehensive Guide'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-6671220374667445545</id><published>2024-03-19T02:55:00.004+05:30</published><updated>2024-03-19T02:57:00.019+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Docker"/><category scheme="http://www.blogger.com/atom/ns#" term="PM2"/><category scheme="http://www.blogger.com/atom/ns#" term="shell script"/><title type='text'>Simplifying Docker Deployment with PM2</title><content type='html'>&lt;p&gt;As you know, &lt;a href=&quot;https://pm2.keymetrics.io/&quot; target=&quot;_blank&quot;&gt;PM2&lt;/a&gt; is a daemon process manager that allows you to keep applications online. Many times, you may be running your service inside a Docker image. The service can be written in any language, such as Node.js, Java, etc. Below is the shell script that can be used to deploy your service. It can be added and used in your CI/CD pipeline.&lt;/p&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/76829bd78ccd04651fc912ac84a1ac34.js&quot;&gt;&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javaxp.com/feeds/6671220374667445545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8882377031456587900/6671220374667445545?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/6671220374667445545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/6671220374667445545'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2024/03/simplifying-docker-deployment-with-pm2.html' title='Simplifying Docker Deployment with PM2'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-6566964962575772092</id><published>2023-12-31T21:00:00.007+05:30</published><updated>2024-03-16T05:17:56.729+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="AWS"/><category scheme="http://www.blogger.com/atom/ns#" term="Lambda"/><category scheme="http://www.blogger.com/atom/ns#" term="Node"/><category scheme="http://www.blogger.com/atom/ns#" term="Quicksight"/><title type='text'>AWS - Get quicksight embed url using JavaScript SDK V3</title><content type='html'>&lt;p&gt;In the realm of data-driven solutions, AWS QuickSight offers a robust platform for crafting dynamic and insightful dashboards. Embedding these dashboards directly into your applications adds a layer of accessibility and convenience. This guide walks you through the process of obtaining a secure QuickSight embed URL using JavaScript SDK V3, suitable for both Node.js backend and Lambda functions. Before proceeding, ensure your QuickSight dashboard is created and shared with the intended audience.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Prerequisites:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Make sure you&#39;ve completed the following preliminary steps:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;b&gt;Dashboard Setup:&lt;/b&gt;&lt;div&gt;&lt;b&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;Create your QuickSight dashboard and Share the dashboard with all users in your AWS account.&lt;div&gt;Open the published dashboard and choose Share at upper right. Then choose Share dashboard.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg88GgCVPqVKxi5X1KW2zgUrEVItG1Oa1n7lWTacw3eKAXMLaVD10HXX6RtlN_ncMyRJRKTpalKflfjluEMYs0Jt9dSyWUcYMYxWzN5DYv-tqkLpdrz8iIk4zkrMZqqQTfzHOqU5AH3hZqYfssrMGsHypeBC9pz-kNfPqN5fZHwyWZQXCDa6_NvXVEQWGUt&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;608&quot; data-original-width=&quot;855&quot; height=&quot;285&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg88GgCVPqVKxi5X1KW2zgUrEVItG1Oa1n7lWTacw3eKAXMLaVD10HXX6RtlN_ncMyRJRKTpalKflfjluEMYs0Jt9dSyWUcYMYxWzN5DYv-tqkLpdrz8iIk4zkrMZqqQTfzHOqU5AH3hZqYfssrMGsHypeBC9pz-kNfPqN5fZHwyWZQXCDa6_NvXVEQWGUt=w400-h285&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Domain Whitelisting:&lt;/b&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Whitelist the domain where you plan to embed the QuickSight dashboard&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhN26GdCjJiIzZcVbVdPXWDRlCrBL_7Ve_YcLEfntI0Se6P_80cJ4BOU2ovVi5vkwMkpVC0R_rTYP99-zs9On2gEuIzCzocQZL3A_oL81CvmYb1xQ2axyUkg1gx8v0MDocjFJDKiAg_JLjjqwZy8ibJRCIfn7koPzY4QqQEWtztyCh1K_60tTvkThvNmZIX&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;622&quot; data-original-width=&quot;1265&quot; height=&quot;196&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhN26GdCjJiIzZcVbVdPXWDRlCrBL_7Ve_YcLEfntI0Se6P_80cJ4BOU2ovVi5vkwMkpVC0R_rTYP99-zs9On2gEuIzCzocQZL3A_oL81CvmYb1xQ2axyUkg1gx8v0MDocjFJDKiAg_JLjjqwZy8ibJRCIfn7koPzY4QqQEWtztyCh1K_60tTvkThvNmZIX=w400-h196&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;p&gt;&lt;b&gt;Step 1: &lt;/b&gt;IAM Role Creation with Required Policies&lt;/p&gt;&lt;p&gt;To interact with QuickSight, set up an IAM role with specific permissions. Include the following policies in your IAM role: &lt;span style=&quot;color: #2b00fe; font-family: courier;&quot;&gt;quicksight:RegisterUser&lt;/span&gt; and &lt;span style=&quot;color: #2b00fe; font-family: courier;&quot;&gt;quicksight:GetDashboardEmbedUrl&lt;/span&gt;.&lt;/p&gt;&lt;p&gt;
  
  &lt;script src=&quot;https://gist.github.com/madan712/8d4ad0ec66587e392457cf7a6bfa5ecc.js&quot;&gt;&lt;/script&gt;
  &lt;/p&gt;&lt;p&gt;&lt;b&gt;Step 2: &lt;/b&gt;Assuming IAM Role Using AWS SDK&lt;/p&gt;&lt;p&gt;Assume the IAM role you created using the AWS SDK.&lt;/p&gt;&lt;p&gt;
  &lt;script src=&quot;https://gist.github.com/madan712/2172bbb03865ffe57b7a90eba3d97e00.js&quot;&gt;&lt;/script&gt;
  &lt;/p&gt;&lt;p&gt;&lt;b&gt;Step 3: &lt;/b&gt;Register a User in QuickSight&lt;/p&gt;&lt;p&gt;Before obtaining the embed URL, register a user in QuickSight. Note that this is a one-time process; subsequent calls will result in an error.&lt;/p&gt;&lt;p&gt;&lt;script src=&quot;https://gist.github.com/madan712/2c195dfe36726221472a0d9692b79f1d.js&quot;&gt;&lt;/script&gt;&lt;/p&gt;&lt;p&gt;This will create a QuickSight user, as shown below:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjAUz3EhZSzB8Ckqy8MuL8GhwwzRtDjLGWZsS6dhModXFRUUStyF2luyU--WRizfHUh8aJmmcOjUQl48q52B6PhsigpolkLnvPUGGHzh0c9fVCrmmUTTxZVBwhjCs1daRFu2D7mgvz0mLuwXFT_QhxV4dEHz6ArT_5L9WnCeIYWBOVUhdMVMsRYXAi22RrJ&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;625&quot; data-original-width=&quot;1285&quot; height=&quot;195&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjAUz3EhZSzB8Ckqy8MuL8GhwwzRtDjLGWZsS6dhModXFRUUStyF2luyU--WRizfHUh8aJmmcOjUQl48q52B6PhsigpolkLnvPUGGHzh0c9fVCrmmUTTxZVBwhjCs1daRFu2D7mgvz0mLuwXFT_QhxV4dEHz6ArT_5L9WnCeIYWBOVUhdMVMsRYXAi22RrJ=w400-h195&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Step 4: &lt;/b&gt;Retrieve Secure QuickSight Dashboard Embed URL&lt;/p&gt;&lt;p&gt;Fetch the secure QuickSight dashboard embed URL using the following code snippet:&lt;/p&gt;&lt;p&gt;&lt;script src=&quot;https://gist.github.com/madan712/f8bb91ac04577ebef5815c522ffe1be0.js&quot;&gt;&lt;/script&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Complete Lambda Function Code&lt;/b&gt;:&lt;/p&gt;&lt;p&gt;Here is the complete Node Lambda function code, seamlessly integrating all the steps discussed above:&lt;/p&gt;&lt;p&gt;Make sure to add following npm package&amp;nbsp;&lt;span style=&quot;color: #2b00fe; font-family: courier;&quot;&gt;@aws-sdk/client-sts&lt;/span&gt; and &lt;span style=&quot;color: #2b00fe; font-family: courier;&quot;&gt;@aws-sdk/client-quicksight&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;script src=&quot;https://gist.github.com/madan712/9af75f2646a79266cc809fafff174a29.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javaxp.com/feeds/6566964962575772092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8882377031456587900/6566964962575772092?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/6566964962575772092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/6566964962575772092'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2023/12/aws-get-quicksight-embed-url.html' title='AWS - Get quicksight embed url using JavaScript SDK V3'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEg88GgCVPqVKxi5X1KW2zgUrEVItG1Oa1n7lWTacw3eKAXMLaVD10HXX6RtlN_ncMyRJRKTpalKflfjluEMYs0Jt9dSyWUcYMYxWzN5DYv-tqkLpdrz8iIk4zkrMZqqQTfzHOqU5AH3hZqYfssrMGsHypeBC9pz-kNfPqN5fZHwyWZQXCDa6_NvXVEQWGUt=s72-w400-h285-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-8646083484038106115</id><published>2023-06-02T20:39:00.001+05:30</published><updated>2023-06-02T21:03:12.837+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Docker"/><title type='text'>Docker - err: exec: &quot;docker-credential-desktop&quot;: executable file not found in $PATH, out: ``</title><content type='html'>&lt;p&gt;&lt;b&gt;Introduction:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Docker has revolutionized the way we package, distribute, and deploy applications. However, like any other technology, it is not immune to errors and issues. One such error that I encountered recently while working with Docker on my Mac was the &quot;error getting credentials - executable file not found&quot; error. In this blog post, I will share my experience with this error and provide a solution that worked for me.&lt;/p&gt;&lt;p&gt;&lt;b&gt;The Error:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;When attempting to build a Docker image or perform a Docker login, I encountered the following error message:&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #2b00fe; font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #2b00fe; font-family: courier;&quot;&gt;openjdk:17: error getting credentials - err: exec: &quot;docker-credential-desktop&quot;: executable file not found in $PATH, out: ``&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #2b00fe; font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #2b00fe; font-family: courier;&quot;&gt;Error saving credentials: error storing credentials - err: exec: &quot;docker-credential-desktop&quot;: executable file not found in $PATH, out: ``&lt;/span&gt;&lt;span style=&quot;color: #2b00fe; font-family: courier;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #2b00fe; font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Diagnosis:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;The error message suggests that the Docker daemon was unable to locate the &quot;docker-credential-desktop&quot; executable file in the $PATH environment variable. This executable is responsible for retrieving Docker credentials and authentication.&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;b&gt;Solution:&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;After researching the issue, I discovered that the problem was specific to Docker on macOS. The Docker Desktop application on macOS uses a credential helper called &quot;docker-credential-desktop&quot; to handle authentication with Docker registries. To resolve the error, I followed these steps:&lt;/p&gt;&lt;p&gt;1. Open Finder and navigate to the following path: `/Users/[USERNAME]/.docker/`.&lt;/p&gt;&lt;p&gt;2. Look for the file named `config.json` in the `.docker` directory.&lt;/p&gt;&lt;p&gt;3. Delete the `config.json` file.&lt;/p&gt;&lt;p&gt;4. Retry the Docker command that was previously failing (e.g., `docker build`, `docker login`, etc.).&lt;/p&gt;&lt;p&gt;&lt;b&gt;Explanation:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;By deleting the `config.json` file, we essentially reset the Docker configuration and remove any potential misconfigurations or conflicts. Docker Desktop will recreate the necessary files and configurations automatically when you run Docker commands again.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Conclusion:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;If you encounter the &quot;error getting credentials - executable file not found&quot; error while working with Docker on your macOS machine, deleting the `config.json` file located at `/Users/[USERNAME]/.docker/` can help resolve the issue. Remember to retry the Docker command after deleting the file to confirm that the error is resolved.&lt;/p&gt;&lt;p&gt;Docker is a powerful tool, but occasional errors and challenges are inevitable. Hopefully, this blog post has provided you with a solution to the specific error discussed here, allowing you to continue working with Docker seamlessly. Happy Dockerizing!&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javaxp.com/feeds/8646083484038106115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8882377031456587900/8646083484038106115?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/8646083484038106115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/8646083484038106115'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2023/06/docker-err-exec-docker-credential.html' title='Docker - err: exec: &quot;docker-credential-desktop&quot;: executable file not found in $PATH, out: ``'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-2575333536698357613</id><published>2023-04-19T20:01:00.004+05:30</published><updated>2023-04-19T20:01:26.449+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="draft-js"/><category scheme="http://www.blogger.com/atom/ns#" term="react"/><category scheme="http://www.blogger.com/atom/ns#" term="rich text editor"/><title type='text'>React simple rich text editor using draft-js</title><content type='html'>&lt;p&gt;This React Simple Rich Text Editor is created using the Draft.js library and includes button controls made with react-icons. It allows users to toggle between different inline styles like block, italic, and underline, as well as block types such as header-one, unordered-list-item, and ordered-list-item. The controls buttons are selected on text click, making it easy for users to format their text.&amp;nbsp;&lt;/p&gt;&lt;p&gt;The component requires two packages to be installed&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;yarn add&amp;nbsp;draft-js react-icons&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjYPT98udaYddrUHtO2DCwVxJ2eQOIZD-YWh2dQAURslgpcJaZa-wj81jnJFxXviXuBQXS0z7StdSAk9C2VYcHlAYdHKweRWvyydzx4AFo5flqpMCUodC-MBb0pvktoNCKdLh5CAPzJ-j5l9bE0bQpqiMVZu9lBupoe1qpjrLzkM0wPiXrVC_grmeMKLA&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;380&quot; data-original-width=&quot;1164&quot; height=&quot;209&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjYPT98udaYddrUHtO2DCwVxJ2eQOIZD-YWh2dQAURslgpcJaZa-wj81jnJFxXviXuBQXS0z7StdSAk9C2VYcHlAYdHKweRWvyydzx4AFo5flqpMCUodC-MBb0pvktoNCKdLh5CAPzJ-j5l9bE0bQpqiMVZu9lBupoe1qpjrLzkM0wPiXrVC_grmeMKLA=w640-h209&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;script src=&quot;https://gist.github.com/madan712/75739927dfd5a7c3586757f692a41f1d.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javaxp.com/feeds/2575333536698357613/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8882377031456587900/2575333536698357613?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/2575333536698357613'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/2575333536698357613'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2023/04/react-simple-rich-text-editor-using.html' title='React simple rich text editor using draft-js'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEjYPT98udaYddrUHtO2DCwVxJ2eQOIZD-YWh2dQAURslgpcJaZa-wj81jnJFxXviXuBQXS0z7StdSAk9C2VYcHlAYdHKweRWvyydzx4AFo5flqpMCUodC-MBb0pvktoNCKdLh5CAPzJ-j5l9bE0bQpqiMVZu9lBupoe1qpjrLzkM0wPiXrVC_grmeMKLA=s72-w640-h209-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-7566274979226677814</id><published>2023-02-23T19:09:00.004+05:30</published><updated>2023-02-23T19:16:10.160+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Exception"/><category scheme="http://www.blogger.com/atom/ns#" term="gradle"/><title type='text'>Caused by: java.lang.UnsupportedOperationException: PermittedSubclasses requires ASM9</title><content type='html'>&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: white; color: #374151; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;After attempting to upgrade Spring Boot from version 2.7.3 to version 3.0.2, I encountered this error. I spent a few hours searching on Google to try to figure out the cause of the error. Eventually, I realized that the error was related to the version of Gradle that I was using. At the time, I had been using Gradle version 7.3.3. However, once I updated to Gradle version 8.0.1, the error was successfully resolved.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjNzIDB8sNVCaErrtDs11O7BUKHmoT-eNG-6Q5pj3W0jlpyzTySqP_Fkm5_R_svAqgVGT0X5Gmip6QRzxdCsxjbWXHbFuuK_0wtla6XWUGpnyaOZO1gaAeWsopHQA-tfCHivYO4MAOZsbfePVGfsgBssyOXInwIj-izZIbB8xJhxmXOkmPCXDLRNH9byA&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;709&quot; data-original-width=&quot;977&quot; height=&quot;290&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjNzIDB8sNVCaErrtDs11O7BUKHmoT-eNG-6Q5pj3W0jlpyzTySqP_Fkm5_R_svAqgVGT0X5Gmip6QRzxdCsxjbWXHbFuuK_0wtla6XWUGpnyaOZO1gaAeWsopHQA-tfCHivYO4MAOZsbfePVGfsgBssyOXInwIj-izZIbB8xJhxmXOkmPCXDLRNH9byA=w400-h290&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;text-align: left;&quot;&gt;I also updated&amp;nbsp;distributionUrl in gradle-wrapper.properties as shown below&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;pre style=&quot;background-color: #2b2b2b; color: #a9b7c6; font-family: &amp;quot;JetBrains Mono&amp;quot;, monospace; font-size: 9.8pt;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;distributionUrl&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;https&lt;/span&gt;\:&lt;span style=&quot;color: #6a8759;&quot;&gt;//services.gradle.org/distributions/gradle-8.0.1-bin.zip&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Note - After above changes i removed .idea folder and restarted my intellij&lt;/div&gt;&lt;p&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javaxp.com/feeds/7566274979226677814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8882377031456587900/7566274979226677814?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/7566274979226677814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/7566274979226677814'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2023/02/caused-by-javalangunsupportedoperatione.html' title='Caused by: java.lang.UnsupportedOperationException: PermittedSubclasses requires ASM9'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEjNzIDB8sNVCaErrtDs11O7BUKHmoT-eNG-6Q5pj3W0jlpyzTySqP_Fkm5_R_svAqgVGT0X5Gmip6QRzxdCsxjbWXHbFuuK_0wtla6XWUGpnyaOZO1gaAeWsopHQA-tfCHivYO4MAOZsbfePVGfsgBssyOXInwIj-izZIbB8xJhxmXOkmPCXDLRNH9byA=s72-w400-h290-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-3893842725743137132</id><published>2023-02-03T06:19:00.006+05:30</published><updated>2023-02-03T06:21:28.442+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Guest Post"/><category scheme="http://www.blogger.com/atom/ns#" term="Thread"/><title type='text'>Java thread synchronization</title><content type='html'>&lt;p&gt;Do you know what is thread synchronization Java? Have you ever thought about how to use synchronized in Java? let us gain some knowledge about thread synchronization Java &amp;amp; try to find out the answer to what is thread synchronization in Java.&lt;/p&gt;&lt;p&gt;But before we start writing about thread synchronization Java &amp;amp; try to find out how to use synchronized in Java. Let us first try to understand the policy of synchronization from one daily life example.&lt;/p&gt;&lt;p&gt;Assume one daily life scenario.&lt;/p&gt;&lt;p&gt;Suppose in your school, there is one toilet for the gents. Now, at the same time, you &amp;amp; your friend need to access the toilet. In both cases, the matter is an urgent one. So, you are not ready to let him go. Neither of your friends is ready to let you go. As a result, there is a mess in front of the toilet.&lt;/p&gt;&lt;p&gt;So, what you will do in such a case? Or what your friend will do at that time?&lt;/p&gt;&lt;p&gt;So, you called the teacher to solve the situation that arise there. Your teacher will draw a solution &amp;amp; allow anyone to go to the toilet first. And as a teacher is a respected person both of you are ready with the solution. In this case, the teacher helps to solve the conflict.&lt;/p&gt;&lt;p&gt;The same thing happens in thread synchronization Java. When two different parts of the program try to access the same resources then this trouble arises. We will try to know more about it when we discuss what is thread synchronization in Java.&lt;/p&gt;&lt;p&gt;&lt;b&gt;What Is Thread Synchronization in Java:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Java is an important programming language. Java is used in the corporate world as it helps to solve real-life problems very easily. Java is used for game development purposes. These along with an operation some more processes are going on. For implementing that situation, Java programming language used the thread concept. Thread is a special concept of the Java programming language. It helps to execute more operations a t same time.&lt;/p&gt;&lt;p&gt;Synchronization means collaborating two or more processes at the same time. The thread synchronization Java is quite like this. Now, sometimes when two or more processes are using the same resource then there will be a problem. This problem arises when we use thread in Java. Two or more parts of the code want to use the same resources. Then there is a mess at that point.&lt;/p&gt;&lt;p&gt;The main goal of thread synchronization in Java is to remove the problems related to resources. If two or more parts want to use the same resource, then one by one they will execute that. This means one part will use that resource, then it will be removed. After that, another part is going to use the resource &amp;amp; will be removed. This is a very problematic situation. To come out of this situation, we used the &#39;synchronized&#39; keyword.&lt;/p&gt;&lt;p&gt;Synchronize is like the teacher at your school. It helps to remove the conflicts between two or more parts for using the same recourses. We will find out more about this when we implement the thread synchronized Java. Similarly, when you are stuck at Java coding you can use &lt;a href=&quot;https://codingzap.com/do-my-java-homework/&quot; target=&quot;_blank&quot;&gt;Java Assignment Help&lt;/a&gt; Services from codingzap.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Why Should We Use Thread Synchronization Java:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Now, after knowing about thread synchronization Java, we need to know why we should use it. This is a very important topic. Often, we find out that, the threads that are implemented in the program are not executing the same we want. In those cases, we need to use this method. As there is a problem related to the synchronization.&lt;/p&gt;&lt;p&gt;If we don&#39;t use synchronization, then there will be an issue related to the memory space. Also, the flow of the output of the program will not be similar as desired. There will be a thread interface problem if we don&#39;t use synchronization at the correct time. When we implement thread synchronization Java, it will be easy to understand.&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;b&gt;How To Use Synchronized in Java:&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Now, it is time to implement Thread Synchronization Java. Here, first, we need to declare one function that is synchronized. This means, there will be no issue with the synchronization. We have written a for loop there. This will be executed by the threads. Now, we have declared two threads. Using the concept of the thread, we are accessing the synchronized function. In one thread, we are trying to provide the value of 2. And in another thread, we are trying to provide the value of 10.&lt;/p&gt;&lt;p&gt;Now, in the main driver function, we will create an object of the synchronized class. Now using that object, we are trying to make a new object of the thread class. Hence, we have implemented two objects for the threads. Now using the start() function of the thread, we will execute that.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;script src=&quot;https://gist.github.com/madan712/9f0b4b5d66eb2cddfd3141b6b478e7a9.js&quot;&gt;&lt;/script&gt;&lt;/p&gt;&lt;p&gt;Let us try to find out the output of the above code. This will help to understand thread synchronization Java.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Output:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;b&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiZyfXRk3_JsOrd93Einy-LmuGHbICrIaXIY2K3gD29O-7NvsXeF7fWCpTwaBqwCE7RqHZAc0csDtxBezbHvD56-MvVF3tyyST99EWQj3IFYIDO3JkPXxus4OYSRMhWiQwt2i3kdTXmAMEpTOdCdW7xoHAs6qxnqkdfLH0nI-9W7OTvyZy2R9gWuuNIIw&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;410&quot; data-original-width=&quot;890&quot; height=&quot;294&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiZyfXRk3_JsOrd93Einy-LmuGHbICrIaXIY2K3gD29O-7NvsXeF7fWCpTwaBqwCE7RqHZAc0csDtxBezbHvD56-MvVF3tyyST99EWQj3IFYIDO3JkPXxus4OYSRMhWiQwt2i3kdTXmAMEpTOdCdW7xoHAs6qxnqkdfLH0nI-9W7OTvyZy2R9gWuuNIIw=w640-h294&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;b&gt;Conclusion:&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;As we saw, thread synchronization Java is a very important topic.&lt;/p&gt;&lt;p&gt;We need to remember what thread synchronization in Java is. Also, we need to understand how to use synchronized in Java.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;It is advisable to clear the basis of the Java Programming Language. Also, we need to clear the multithreading in Java programming language. Then the topic is understandable.&lt;/p&gt;&lt;div&gt;&lt;b&gt;Sponsor by:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;https://codingzap.com/&quot; target=&quot;_blank&quot;&gt;https://codingzap.com/&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javaxp.com/feeds/3893842725743137132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8882377031456587900/3893842725743137132?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/3893842725743137132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/3893842725743137132'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2023/02/java-thread-synchronization.html' title='Java thread synchronization'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEiZyfXRk3_JsOrd93Einy-LmuGHbICrIaXIY2K3gD29O-7NvsXeF7fWCpTwaBqwCE7RqHZAc0csDtxBezbHvD56-MvVF3tyyST99EWQj3IFYIDO3JkPXxus4OYSRMhWiQwt2i3kdTXmAMEpTOdCdW7xoHAs6qxnqkdfLH0nI-9W7OTvyZy2R9gWuuNIIw=s72-w640-h294-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-7892848920405098531</id><published>2022-07-09T18:51:00.002+05:30</published><updated>2022-07-09T18:51:15.417+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Simple Java Codes"/><title type='text'>Java - Progress bar in console</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;
  &lt;script src=&quot;https://gist.github.com/madan712/dc1c432362dc466cd80bf02c76a40c88.js&quot;&gt;&lt;/script&gt;
  &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Output -&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPMaEy09CiYvQBsY7HlQS_oxG9ijqFjKNQADFLdBsMKrTitAp0V6FtiNMH2Bnqpo5eWp8oWyMS7aSdda--FMJsR5SqSIsiO9fXwbe-WZDud-GogrieiBk0aX4A_zPth4PhQxOPEOZQg4W16Pf2pxUXW78SZBCbKK1zQS7u6GdkEXS_kUFQ8Ssk8SUNDw/s600/java%20console%20progress%20bar.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;109&quot; data-original-width=&quot;600&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPMaEy09CiYvQBsY7HlQS_oxG9ijqFjKNQADFLdBsMKrTitAp0V6FtiNMH2Bnqpo5eWp8oWyMS7aSdda--FMJsR5SqSIsiO9fXwbe-WZDud-GogrieiBk0aX4A_zPth4PhQxOPEOZQg4W16Pf2pxUXW78SZBCbKK1zQS7u6GdkEXS_kUFQ8Ssk8SUNDw/s16000/java%20console%20progress%20bar.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javaxp.com/feeds/7892848920405098531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8882377031456587900/7892848920405098531?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/7892848920405098531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/7892848920405098531'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2022/07/java-progress-bar-in-console.html' title='Java - Progress bar in console'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPMaEy09CiYvQBsY7HlQS_oxG9ijqFjKNQADFLdBsMKrTitAp0V6FtiNMH2Bnqpo5eWp8oWyMS7aSdda--FMJsR5SqSIsiO9fXwbe-WZDud-GogrieiBk0aX4A_zPth4PhQxOPEOZQg4W16Pf2pxUXW78SZBCbKK1zQS7u6GdkEXS_kUFQ8Ssk8SUNDw/s72-c/java%20console%20progress%20bar.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-5826726449207055840</id><published>2022-04-05T22:06:00.006+05:30</published><updated>2022-04-06T00:05:44.060+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Docker"/><title type='text'>Docker - Springboot and mysql image example</title><content type='html'>&lt;p&gt;A simple docker example using springboot and database as mysql/mariadb&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh17ws6bmI1xbY0Qu4IAJgVTpQDxLLs2kaTC4JGxhpsk8Y3JbNYbFoq6egyCKpg_8claNnhtkfqAVCLMTNUYZ9Szo6u28JTkGhG1up9D4qSDqw7ChwEqE4tT6yQc9bbOi63MsdXn0JHYdR0mYg-AnmEraVf0868d-e1HKHr3CSV1CmBn3e1BYyhHNIO2A/s1500/docker%20image.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1278&quot; data-original-width=&quot;1500&quot; height=&quot;341&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh17ws6bmI1xbY0Qu4IAJgVTpQDxLLs2kaTC4JGxhpsk8Y3JbNYbFoq6egyCKpg_8claNnhtkfqAVCLMTNUYZ9Szo6u28JTkGhG1up9D4qSDqw7ChwEqE4tT6yQc9bbOi63MsdXn0JHYdR0mYg-AnmEraVf0868d-e1HKHr3CSV1CmBn3e1BYyhHNIO2A/w400-h341/docker%20image.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;Create springboot image&lt;/b&gt;&lt;/p&gt;Get the completed springboot source code on github for &lt;a href=&quot;https://github.com/madan712/hello-docker&quot; target=&quot;_blank&quot;&gt;hello-docker&lt;/a&gt;&amp;nbsp;image&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. Create docker image&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 13.6px;&quot;&gt;&lt;span style=&quot;color: #2b00fe; font-family: courier;&quot;&gt;cd hello-docker&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: 13.6px;&quot;&gt;&lt;span style=&quot;color: #2b00fe; font-family: courier;&quot;&gt;&amp;nbsp;&amp;nbsp;docker build --tag hello-docker .&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2. Tag the image&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 13.6px;&quot;&gt;&lt;span style=&quot;color: #2b00fe; font-family: courier;&quot;&gt;docker tag hello-docker madan712/hello-docker:v1.0&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Run individual container(s) in a docker network&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Since springboot application need to connect to database, both the containers should be present in same docker network.&lt;/p&gt;&lt;p&gt;1. Created docker network&lt;/p&gt;&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2b00fe; font-family: courier;&quot;&gt;docker network create mynetwork&lt;/span&gt;&lt;/p&gt;&lt;p&gt;2.&lt;span&gt;&amp;nbsp;Run database image in docker network&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #2b00fe; font-family: courier;&quot;&gt;docker run -d --name mysqldb -p 3306:3306&amp;nbsp; -e MYSQL_ROOT_PASSWORD=pass123 -e MYSQL_DATABASE=mydb --network mynetwork mysql&lt;/span&gt;&lt;/p&gt;&lt;p&gt;3.&amp;nbsp;Run springboot application&lt;/p&gt;&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2b00fe; font-family: courier;&quot;&gt;docker run -d --name hello-docker -p 8080:8080 -e SPRING_DATASOURCE_URL=&quot;jdbc:mysql://mysqldb:3306/mydb?useSSL=false&quot; -e SPRING_DATASOURCE_USERNAME=root -e SPRING_DATASOURCE_PASSWORD=pass123 --network mynetwork madan712/hello-docker:v1.0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Run multi-container docker application using docker compose&lt;/b&gt;&lt;/p&gt;&lt;p&gt;docker-compose.yaml&lt;/p&gt;&lt;p&gt;
  &lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Fhello-docker%2Fblob%2Fmaster%2Fdocker-compose.yaml&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&amp;amp;showFileMeta=on&amp;amp;showCopy=on&quot;&gt;&lt;/script&gt;
  &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Compose command&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #2b00fe; font-family: courier;&quot;&gt;docker-compose up -d&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Please find complete github code - &lt;a href=&quot;https://github.com/madan712/hello-docker&quot; target=&quot;_blank&quot;&gt;hello-docker&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javaxp.com/feeds/5826726449207055840/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8882377031456587900/5826726449207055840?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/5826726449207055840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/5826726449207055840'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2022/04/springboot-and-mysql-docker-image.html' title='Docker - Springboot and mysql image example'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh17ws6bmI1xbY0Qu4IAJgVTpQDxLLs2kaTC4JGxhpsk8Y3JbNYbFoq6egyCKpg_8claNnhtkfqAVCLMTNUYZ9Szo6u28JTkGhG1up9D4qSDqw7ChwEqE4tT6yQc9bbOi63MsdXn0JHYdR0mYg-AnmEraVf0868d-e1HKHr3CSV1CmBn3e1BYyhHNIO2A/s72-w400-h341-c/docker%20image.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-8285491501604071507</id><published>2022-02-09T21:33:00.005+05:30</published><updated>2022-02-09T21:33:56.238+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Game"/><category scheme="http://www.blogger.com/atom/ns#" term="react native"/><title type='text'>React native swipe gestures handler example</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;This is a simple &lt;a href=&quot;https://en.wikipedia.org/wiki/2048_(video_game)&quot; target=&quot;_blank&quot;&gt;2048 game&lt;/a&gt; demonstrates how to use gestures handler in react native&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; data-original-height=&quot;426&quot; data-original-width=&quot;240&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEi91oDRSBHokouFLlPC2But3sdSmpZ9w1Z7s0gzeKqf7npUkzlkGLn-IEYZ3fquSUGy354X56Je-zcIxtFn-8HDzt6LYp-1H4oMwfiRHndZK7_TWRLXJeEH5IWPkCk0VbmVZqqFys0gQnIEePU3_4FP9uiXJPiunSNS3Lh03Biup8t2myu2a5rXMNOf3g=s400&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;It is hosted in play store, feel free to install and see the demo&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://play.google.com/store/apps/details?id=com.javaxp.adfree2048&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;250&quot; data-original-width=&quot;646&quot; height=&quot;78&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhy8H9oW6F0ptTqoGFhbt2BLqvsIED5gqAeB0P4_m-kWGq1HLzhyjwckSRq_IlXx4wMJsZbASdpNAWP_mmDkazNB6TUXcBt8WIREpy1hhqcnQqCXkFsizQIr71CcC2XCp5ZZbKBjeJ7Do6a_-gmuB_aPAfbs65WMTGe6Tv_ASCdn-VgG33b48OtuLvk_A=w200-h78&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;It is using npm&amp;nbsp;&lt;a href=&quot;https://www.npmjs.com/package/react-native-swipe-gestures&quot; target=&quot;_blank&quot;&gt;react-native-swipe-gestures&lt;/a&gt; package to detect swipe. this component can be used handling swipe gestures in up, down, left and right direction.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Here is the complete github code link&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href=&quot;https://github.com/madan712/2048&quot; target=&quot;_blank&quot;&gt;https://github.com/madan712/2048&lt;/a&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Code snippet&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/madan712/1fb83102c9a15f62057f4567df488b7e.js&quot;&gt;&lt;/script&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javaxp.com/feeds/8285491501604071507/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8882377031456587900/8285491501604071507?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/8285491501604071507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/8285491501604071507'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2022/02/react-native-swipe-gestures-handler.html' title='React native swipe gestures handler example'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEi91oDRSBHokouFLlPC2But3sdSmpZ9w1Z7s0gzeKqf7npUkzlkGLn-IEYZ3fquSUGy354X56Je-zcIxtFn-8HDzt6LYp-1H4oMwfiRHndZK7_TWRLXJeEH5IWPkCk0VbmVZqqFys0gQnIEePU3_4FP9uiXJPiunSNS3Lh03Biup8t2myu2a5rXMNOf3g=s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-3054842162419099124</id><published>2022-01-30T02:12:00.004+05:30</published><updated>2022-02-03T02:29:06.963+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="react native"/><title type='text'>React native draggable and swipeable list</title><content type='html'>&lt;p&gt;This is a simple todo app demonstrates how to create a draggable and swipeable list in react native&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh312B6dtmzdtg5KfuTRS9nR_3kqACU5kwKBGHUdNs1sVP4BSro16176Nevi34yP_r9teWlaU3c5CUBHjM8S5YwGrrKRIbMubh8bI7Rl6s_80N1-j-Ox1hVcMYnnNh0VyvyjKjpFwAFP4E54H2gGS1PrOL2aeK2VtZt-HkkIq2dOBdGVWhTNY9G7fpxTA=s426&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;426&quot; data-original-width=&quot;240&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh312B6dtmzdtg5KfuTRS9nR_3kqACU5kwKBGHUdNs1sVP4BSro16176Nevi34yP_r9teWlaU3c5CUBHjM8S5YwGrrKRIbMubh8bI7Rl6s_80N1-j-Ox1hVcMYnnNh0VyvyjKjpFwAFP4E54H2gGS1PrOL2aeK2VtZt-HkkIq2dOBdGVWhTNY9G7fpxTA=s320&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;An open source todo app hosted in google play store. Feel free to download and play with it.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://play.google.com/store/apps/details?id=com.javaxp.todo&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;250&quot; data-original-width=&quot;646&quot; height=&quot;78&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiDP8ZQjTQpfI7iT2GihJ9z8Y5JTsEs19skkV_lQEbzXSC3L0qdE-YBVnBod5cBy1_FQFj7Azz1MBcmjt6X69_r1FpZdfQe6B45l68WSzXyBwq52G2xs6DkDYXuoU_NSb9g2OE42SXLI3NNd-7GHXZSTdusVSQ64xPrMF2YG9nhN0UiO8f-HRzX9Kh2Kw=w200-h78&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;It is using npm&amp;nbsp;&lt;a href=&quot;https://www.npmjs.com/package/react-native-draggable-flatlist&quot; target=&quot;_blank&quot;&gt;react-native-draggable-flatlist&lt;/a&gt; and&amp;nbsp;&lt;a href=&quot;https://www.npmjs.com/package/react-native-swipeable-item&quot; target=&quot;_blank&quot;&gt;react-native-swipeable-item&lt;/a&gt;&amp;nbsp;package&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Here is the complete github code link&lt;/p&gt;&lt;p&gt;&lt;span face=&quot;Roboto, Arial, sans-serif&quot; style=&quot;background-color: white; color: #333333; font-size: 14px;&quot;&gt;&lt;a target=&quot;_blank&quot; href=&quot;https://github.com/madan712/simple-todo-app&quot;&gt;https://github.com/madan712/simple-todo-app&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Code snippet&lt;/p&gt;&lt;p&gt;
&lt;script src=&quot;https://gist.github.com/madan712/4059e27253210ae8d3a059d6addadc8d.js&quot;&gt;&lt;/script&gt;
&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javaxp.com/feeds/3054842162419099124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8882377031456587900/3054842162419099124?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/3054842162419099124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/3054842162419099124'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2022/01/react-native-draggable-and-swipeable.html' title='React native draggable and swipeable list'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEh312B6dtmzdtg5KfuTRS9nR_3kqACU5kwKBGHUdNs1sVP4BSro16176Nevi34yP_r9teWlaU3c5CUBHjM8S5YwGrrKRIbMubh8bI7Rl6s_80N1-j-Ox1hVcMYnnNh0VyvyjKjpFwAFP4E54H2gGS1PrOL2aeK2VtZt-HkkIq2dOBdGVWhTNY9G7fpxTA=s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-6138259960070624054</id><published>2021-12-24T00:22:00.002+05:30</published><updated>2021-12-24T00:23:25.315+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Guest Post"/><title type='text'>Why Higher Learning Institution Prefer to Teach Java Than Python</title><content type='html'>&lt;p&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEipZyN_5kJir5jPLG0alK_R-HkVo8rdk80pMeJdW00mPddZBvByG-74sGk46IKokP8IKsXxOdSKf8uK6hZnLUxpzTZYFO7fGY5TIvXw4om7CXda5jhHUaPap9frgm6j5UCCzpSunhTTAmP4SaHNfHudmiLG5wwJdzamwFYpaqrdw8rAsJq3Gtvu_hiVqQ=s1275&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;590&quot; data-original-width=&quot;1275&quot; height=&quot;296&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEipZyN_5kJir5jPLG0alK_R-HkVo8rdk80pMeJdW00mPddZBvByG-74sGk46IKokP8IKsXxOdSKf8uK6hZnLUxpzTZYFO7fGY5TIvXw4om7CXda5jhHUaPap9frgm6j5UCCzpSunhTTAmP4SaHNfHudmiLG5wwJdzamwFYpaqrdw8rAsJq3Gtvu_hiVqQ=w640-h296&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Python and Java are two of the most widely used programming
languages. Due to its computability, Java is typically more efficient than
Python. Python&#39;s syntax is simpler and more succinct than Java&#39;s since it is
interpreted. Using less code than Java, it can do the same thing. However,
large number of students, programmers, professors in most reputable
universities spend much time training java.&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Much of Java&#39;s efficiency is due to its Just-In-Time (JIT)
compiler and its ability to handle concurrency. The JIT compiler is a component
of the Java Runtime Environment. Compiling byte-codes into native machine code
&quot;just in time&quot; to execute Java applications enhances their
performance. The Java Virtual Machine (JVM) directly calls the built code.
Compiling does not use a lot of resources since the code does not have to be
parsed. This could theoretically make a Java program as quick as a native
application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Another reason making java most popular among students
looking for &lt;a href=&quot;https://thepandapapers.com/articles/programming-assignment-help&quot; target=&quot;_blank&quot;&gt;programmingassignment help&lt;/a&gt; online is due to its user friendliness especially when
doing the coding part. Bugs, errors, and all other issues affecting the code
are clearly indicated in the runtime, not like in python. Programmer errors in
Python are not discovered until the code is executed. This might lead to
operational failures and a longer turnaround time, which is not ideal. Object
mutation is impossible in Java, although it is feasible in Python. This leads
to the creation of secure software. Fixing bugs is an hectic task, that may
make programmers and students look for programming help online and &lt;a href=&quot;https://thepandapapers.com/articles/programming-assignment-help&quot; target=&quot;_blank&quot;&gt;bestwebsites offering programming assignment help.&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Python may be more flexible and user-friendly than Java, but
Java is still the best &quot;formal&quot; language out there. It is statically
typed, has all of the OO implementation bells and whistles, and tends to
function in a manner that rewards proper program design. That makes it a great
choice for teaching at the college and university levels. Computer Science
students find it difficult to spend much time in the laptop while avoiding some
best moments as a college student. However, with good &lt;a href=&quot;https://thepandapapers.com/articles/programming-assignment-help&quot; target=&quot;_blank&quot;&gt;programmingassignment service&lt;/a&gt;, such as ThePandaPapers, students may now get
professional help with all sort of programming tasks, may it be java, sql, or
python. They have programming assignment experts&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javaxp.com/feeds/6138259960070624054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8882377031456587900/6138259960070624054?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/6138259960070624054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/6138259960070624054'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2021/12/why-higher-learning-institution-prefer.html' title='Why Higher Learning Institution Prefer to Teach Java Than Python'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEipZyN_5kJir5jPLG0alK_R-HkVo8rdk80pMeJdW00mPddZBvByG-74sGk46IKokP8IKsXxOdSKf8uK6hZnLUxpzTZYFO7fGY5TIvXw4om7CXda5jhHUaPap9frgm6j5UCCzpSunhTTAmP4SaHNfHudmiLG5wwJdzamwFYpaqrdw8rAsJq3Gtvu_hiVqQ=s72-w640-h296-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-4358134721733293046</id><published>2021-09-26T00:00:00.007+05:30</published><updated>2021-09-26T00:07:29.870+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cryptography"/><category scheme="http://www.blogger.com/atom/ns#" term="JWT"/><category scheme="http://www.blogger.com/atom/ns#" term="Maven"/><category scheme="http://www.blogger.com/atom/ns#" term="pom.xml"/><category scheme="http://www.blogger.com/atom/ns#" term="SpringBoot"/><title type='text'>Java JSON Web Tokens example</title><content type='html'>&lt;p&gt;&amp;nbsp;What is JSON Web Token?&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. For more details, &lt;a href=&quot;https://jwt.io/introduction&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWjZE6cGiCG671-THqivmiFVq9kpXhqHmNwdbuVcsn_5-5eqX0MDuxw39M7wkGUaIXp7bEbT-FnzsjI9f7-2JoHXBPVxIDFXawo3WSEJAqdAkaRS2Qw6PaB4kOk4WniUhVu1eTTNtJVbY/s1013/jwt+java.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;543&quot; data-original-width=&quot;1013&quot; height=&quot;344&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWjZE6cGiCG671-THqivmiFVq9kpXhqHmNwdbuVcsn_5-5eqX0MDuxw39M7wkGUaIXp7bEbT-FnzsjI9f7-2JoHXBPVxIDFXawo3WSEJAqdAkaRS2Qw6PaB4kOk4WniUhVu1eTTNtJVbY/w640-h344/jwt+java.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;In this example, User object is encrypted to jwt also validating it and decrypting token to user object again. For complete github source code, &lt;a href=&quot;https://github.com/madan712/test-jwt&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;&lt;p&gt;JwtTokenService.java&lt;/p&gt;
&lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Ftest-jwt%2Fblob%2Fmain%2Fsrc%2Fmain%2Fjava%2Fcom%2Fjavaxp%2Ftestjwt%2FJwtTokenService.java&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&amp;amp;showFileMeta=on&amp;amp;showCopy=on&quot;&gt;&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javaxp.com/feeds/4358134721733293046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8882377031456587900/4358134721733293046?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/4358134721733293046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/4358134721733293046'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2021/09/java-json-web-tokens-example.html' title='Java JSON Web Tokens example'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWjZE6cGiCG671-THqivmiFVq9kpXhqHmNwdbuVcsn_5-5eqX0MDuxw39M7wkGUaIXp7bEbT-FnzsjI9f7-2JoHXBPVxIDFXawo3WSEJAqdAkaRS2Qw6PaB4kOk4WniUhVu1eTTNtJVbY/s72-w640-h344-c/jwt+java.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-6123090637347650247</id><published>2020-06-13T17:11:00.000+05:30</published><updated>2020-06-13T17:14:29.800+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Eureka"/><category scheme="http://www.blogger.com/atom/ns#" term="Ribbon"/><category scheme="http://www.blogger.com/atom/ns#" term="Service discovery"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring Cloud"/><title type='text'>Client side load balancing using Eureka and Ribbon</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Traditional server side load balancer has some drawbacks. It requires an additional hop from client to load balancer and then load balancer to service. Also there is a burden to run and manage load balancer itself. Client side load balancer is the solution to overcome these problems. In this architecture there is an addition inbuilt load balancer component that resides inside client.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
In this example we will see how client side load balancer works with eureka discovery server.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH9ajfutJkFDmPsHNr2EPOT2IzLsbbqzv_h4HLs_VcMYK9lSP4lIAPf_QP8SzRJCMoNtW-h8zL9s6iATof39phwoj_N4IcOlhL1TxSwlgcpCmQhIFrxpiI5KtvMIUPdRH59FTOsBtpd6Q/s1600/Ribbon+request+flow.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;364&quot; data-original-width=&quot;676&quot; height=&quot;344&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH9ajfutJkFDmPsHNr2EPOT2IzLsbbqzv_h4HLs_VcMYK9lSP4lIAPf_QP8SzRJCMoNtW-h8zL9s6iATof39phwoj_N4IcOlhL1TxSwlgcpCmQhIFrxpiI5KtvMIUPdRH59FTOsBtpd6Q/s640/Ribbon+request+flow.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif; font-size: 13.2px;&quot;&gt;1. W&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif; font-size: 13.2px;&quot;&gt;hen service (discovery client) boots up it registers itself with discovery server. Multiple instances register itself with discovery server. Here&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif; font-size: 13.2px;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;spring.application.name&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;is use to identify a particular service&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif; font-size: 13.2px;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;2. Client application will also resister&amp;nbsp;itself to discovery client to find instance for load banacer&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;3. Now load balancer within client can find the service with the help of service name&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;Please find complete codes from github repository -&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; clear: both; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;&quot;&gt;
Discovery server code -&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; clear: both; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;&quot;&gt;
&lt;a href=&quot;https://github.com/madan712/discovery-server&quot; style=&quot;color: #888888; text-decoration-line: none;&quot; target=&quot;_blank&quot;&gt;https://github.com/madan712/discovery-server&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; clear: both; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; clear: both; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;&quot;&gt;
Ribbon service code -&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; clear: both; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;&quot;&gt;
&lt;a href=&quot;https://github.com/madan712/ribbon-service&quot; target=&quot;_blank&quot;&gt;https://github.com/madan712/ribbon-service&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; clear: both; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; clear: both; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;&quot;&gt;
&lt;span style=&quot;font-size: 13.2px;&quot;&gt;Ribbon client code -&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; clear: both; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;&quot;&gt;
&lt;a href=&quot;https://github.com/madan712/ribbon-client&quot; target=&quot;_blank&quot;&gt;https://github.com/madan712/ribbon-client&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; clear: both; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; clear: both; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;&quot;&gt;
&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;How to run this example -&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; clear: both; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; clear: both; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;&quot;&gt;
&lt;b&gt;Step 1&lt;/b&gt; - Start eureka discovery server, which will run on port 8761&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; clear: both; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;&quot;&gt;
&lt;a href=&quot;http://localhost:8761/&quot; target=&quot;_blank&quot;&gt;http://localhost:8761/&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; clear: both; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; clear: both; font-size: 13.2px;&quot;&gt;
&lt;b style=&quot;color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;&quot;&gt;Step 2&lt;/b&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt; - Start 2 instances of ribbon service on port 4444, 5555. Y&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif; font-size: 13.2px;&quot;&gt;ou can do that by passing&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;server.port&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: 13.2px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif; font-size: 13.2px;&quot;&gt;argument to start the services as shown below&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: 13.2px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #222222;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: 13.2px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: 13.2px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: 13.2px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;--server.port=2222&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: 13.2px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIY8ZreXCjRAJSZippZf503Wh2VCaIyOo_yxFlVP9qEwmzU8G7YlbB1emdNaGs5di6zC0aDw5UO_Ewp0_-EthYeDLGtjf40l3E013yZ9_L2tGkpjX-jcUBkWkmkgMoDSN9ttB6wBc2mBY/s1600/Eclipse+pass+server+port+as+program+argument.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;629&quot; data-original-width=&quot;772&quot; height=&quot;521&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIY8ZreXCjRAJSZippZf503Wh2VCaIyOo_yxFlVP9qEwmzU8G7YlbB1emdNaGs5di6zC0aDw5UO_Ewp0_-EthYeDLGtjf40l3E013yZ9_L2tGkpjX-jcUBkWkmkgMoDSN9ttB6wBc2mBY/s640/Eclipse+pass+server+port+as+program+argument.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: 13.2px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif; font-size: 13.2px;&quot;&gt;Verify 2 service are running in eureka&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;http://localhost:8761/&quot;&gt;http://localhost:8761/&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbIGhVZ47DBZDAYjLK0V8IDiFJFy-qOL3TxABM3yf1OQDwyO7orSpWTkVWNi2qqP3cDIA4i3Fu_arkL_zWU-tJt5qbKTq70g_U8kQSqbgfUNTJFM9k9XpIrrmt9yZY9XYJ6hH8Ptf41LE/s1600/Eureka+Ribbon+service.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;683&quot; data-original-width=&quot;1351&quot; height=&quot;322&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbIGhVZ47DBZDAYjLK0V8IDiFJFy-qOL3TxABM3yf1OQDwyO7orSpWTkVWNi2qqP3cDIA4i3Fu_arkL_zWU-tJt5qbKTq70g_U8kQSqbgfUNTJFM9k9XpIrrmt9yZY9XYJ6hH8Ptf41LE/s640/Eureka+Ribbon+service.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Step 3&lt;/b&gt; - Run Ribbon client which will run on default 8080 port&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
RestTemplate bean is created using&amp;nbsp;@LoadBalanced annotation&amp;nbsp;&lt;/div&gt;
&lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Fribbon-client%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Fcom%2Fjavaxp%2Fribbonclient%2FRibbonClientApplication.java&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&quot;&gt;&lt;/script&gt;

&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Ribbon service is discovered using service name&lt;/div&gt;
&lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Fribbon-client%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Fcom%2Fjavaxp%2Fribbonclient%2FController.java&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&quot;&gt;&lt;/script&gt;

&lt;div&gt;
&lt;br /&gt;
&lt;b&gt;Output -&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjH9WhkCs1hfRLOEphNUBQnBwgEjkDNF0Ab_xcebZ12xinBIQzP3N0rKYbBkDO-ZxW3Avb-1OIFIOJkC-mppKF_BAwXCFgy7veDuwEN7FU6lJZg_GLg9J5ilkfuvGwKE7aEatwvIfPkzUs/s1600/Ribbon+output.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;312&quot; data-original-width=&quot;675&quot; height=&quot;295&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjH9WhkCs1hfRLOEphNUBQnBwgEjkDNF0Ab_xcebZ12xinBIQzP3N0rKYbBkDO-ZxW3Avb-1OIFIOJkC-mppKF_BAwXCFgy7veDuwEN7FU6lJZg_GLg9J5ilkfuvGwKE7aEatwvIfPkzUs/s640/Ribbon+output.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;&quot;&gt;On subsequent request u can see response from different instance&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/6123090637347650247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/6123090637347650247'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2020/06/client-side-load-balancing-using-eureka.html' title='Client side load balancing using Eureka and Ribbon'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH9ajfutJkFDmPsHNr2EPOT2IzLsbbqzv_h4HLs_VcMYK9lSP4lIAPf_QP8SzRJCMoNtW-h8zL9s6iATof39phwoj_N4IcOlhL1TxSwlgcpCmQhIFrxpiI5KtvMIUPdRH59FTOsBtpd6Q/s72-c/Ribbon+request+flow.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-7379092468091885218</id><published>2020-06-07T01:22:00.002+05:30</published><updated>2020-06-07T01:24:37.692+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Eureka"/><category scheme="http://www.blogger.com/atom/ns#" term="Netflix"/><category scheme="http://www.blogger.com/atom/ns#" term="Service discovery"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring Cloud"/><category scheme="http://www.blogger.com/atom/ns#" term="Zuul"/><title type='text'>Server side load balancing using Eureka and Zuul</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Routing is an important part of a microservice architecture. In real time cloud application, service instances are added/removed dynamically based on requirement and availability in such scenario its very important to manage traffic load. In the following example you will see how to use Zuul API Gateway to enable sever side load balancing of your RESTful Web Services.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiX4qhfVLuvPxtZfFZS_txjs4xfAGnyq7loxtbca8ng_pqRlYKO0DD3z0E-AqaQksHARp_IdOpTVonT2X7KlI3WmMBj7VRTr9UgBq07MPGNX_j6U4xFpjqcfqqOcSn6mpy2fk3_PY_FbRA/s1600/Eureka+zuul+flow.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;444&quot; data-original-width=&quot;814&quot; height=&quot;348&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiX4qhfVLuvPxtZfFZS_txjs4xfAGnyq7loxtbca8ng_pqRlYKO0DD3z0E-AqaQksHARp_IdOpTVonT2X7KlI3WmMBj7VRTr9UgBq07MPGNX_j6U4xFpjqcfqqOcSn6mpy2fk3_PY_FbRA/s640/Eureka+zuul+flow.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
Request flow -&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
1. W&lt;span style=&quot;background-color: white; color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif; font-size: 13.2px;&quot;&gt;hen service boots up it registers itself with discovery server. Multiple instances register itself with discovery server. Here&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #222222;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;spring.application.name&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt; is use to identify a particular service&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif; font-size: 13.2px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif; font-size: 13.2px;&quot;&gt;2. Zuul gateway also registers itself with discovery server. Remember Zuul gateway is also a discovery client&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif; font-size: 13.2px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif; font-size: 13.2px;&quot;&gt;3. When client sends request to zuul gateway for a particular service, Zuul gateway queries discovery server to fetch available healthy instance of the service and then accordingly send request to that service.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
Please check previous example on &lt;a href=&quot;https://www.javaxp.com/2020/06/spring-cloud-service-discovery-example.html&quot; target=&quot;_blank&quot;&gt;Discovery Server&lt;/a&gt;.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
Discovery code -&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;a href=&quot;https://github.com/madan712/discovery-server&quot; target=&quot;_blank&quot;&gt;https://github.com/madan712/discovery-server&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;b&gt;&lt;/b&gt;&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;b&gt;Zuul Server&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
pom.xml&lt;/div&gt;
&lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Fzuul-server%2Fblob%2Fmaster%2Fpom.xml&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
application.properties&lt;/div&gt;
&lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Fzuul-server%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fresources%2Fapplication.properties&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
ZuulServerApplication.java&lt;/div&gt;
&lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Fzuul-server%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Fcom%2Fjavaxp%2Fzuulserver%2FZuulServerApplication.java&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;b&gt;Zuul Service&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
pom.xml&lt;/div&gt;
&lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Fzuul-service%2Fblob%2Fmaster%2Fpom.xml&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
application.properties&lt;/div&gt;
&lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Fzuul-service%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fresources%2Fapplication.properties&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
ServiceApplication.java&lt;/div&gt;
&lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Fzuul-service%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Fcom%2Fjavaxp%2Fzuulservice%2FServiceApplication.java&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
Controller.java&lt;/div&gt;
&lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Fzuul-service%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Fcom%2Fjavaxp%2Fzuulservice%2FController.java&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
Here is complete source code in Github&lt;/div&gt;
&lt;br /&gt;
&lt;a href=&quot;https://github.com/madan712/zuul-server&quot; target=&quot;_blank&quot;&gt;https://github.com/madan712/zuul-server&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://github.com/madan712/zuul-service&quot; target=&quot;_blank&quot;&gt;https://github.com/madan712/zuul-service&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Output -&lt;/b&gt;&lt;br /&gt;
1. Our discovery server is running on port 8761&lt;br /&gt;
&lt;a href=&quot;http://localhost:8761/&quot; target=&quot;_blank&quot;&gt;http://localhost:8761/&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhY52Nbc9lUdpBNROUvKyVysX35im7AwT6FXhgXDouxzNznt0nEzfwTXbQCzoIRogRVf8bz9v20zUajwq9bhx805tH1KQCTHftYFCAa_AelQRR4FZAr8xDgymBtXZQlQ96hIJ4RcnWY0DI/s1600/Zuul+services+in+eureka+server.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;687&quot; data-original-width=&quot;1341&quot; height=&quot;326&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhY52Nbc9lUdpBNROUvKyVysX35im7AwT6FXhgXDouxzNznt0nEzfwTXbQCzoIRogRVf8bz9v20zUajwq9bhx805tH1KQCTHftYFCAa_AelQRR4FZAr8xDgymBtXZQlQ96hIJ4RcnWY0DI/s640/Zuul+services+in+eureka+server.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
2. Start Zuul server, by default it will run on port 8080&lt;br /&gt;
&lt;br /&gt;
3. Starting 2 instances on zuul service on port 1111, 2222&lt;br /&gt;
&lt;b&gt;Note &lt;/b&gt;- you may need to pass&amp;nbsp;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;, courier, monospace;&quot;&gt;server.port&amp;nbsp;&lt;/span&gt;argument to start the services as shown below&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;--server.port=2222&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Now hit zuul url&lt;br /&gt;
&lt;a href=&quot;http://localhost:8080/zuul-service&quot; target=&quot;_blank&quot;&gt;http://localhost:8080/zuul-service&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2N0NEk-RsK6GJb5T34Sy2fPFQp_OoA3N_DPgSiHglvGnN7Me7c5TvgrN3JISyGxH_JstRMVr8yE26h_tMyc48SRkrEIc9E78X4o_RjGyXS7SQXqwisb1dWLNfpcrrLclvYzvdcS8ULuc/s1600/Zuul+output.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;399&quot; data-original-width=&quot;800&quot; height=&quot;318&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2N0NEk-RsK6GJb5T34Sy2fPFQp_OoA3N_DPgSiHglvGnN7Me7c5TvgrN3JISyGxH_JstRMVr8yE26h_tMyc48SRkrEIc9E78X4o_RjGyXS7SQXqwisb1dWLNfpcrrLclvYzvdcS8ULuc/s640/Zuul+output.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
On subsequent request u can see response from different instance&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/7379092468091885218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/7379092468091885218'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2020/06/server-side-load-balancing-using-eureka.html' title='Server side load balancing using Eureka and Zuul'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiX4qhfVLuvPxtZfFZS_txjs4xfAGnyq7loxtbca8ng_pqRlYKO0DD3z0E-AqaQksHARp_IdOpTVonT2X7KlI3WmMBj7VRTr9UgBq07MPGNX_j6U4xFpjqcfqqOcSn6mpy2fk3_PY_FbRA/s72-c/Eureka+zuul+flow.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-3309277975934264817</id><published>2020-06-03T18:04:00.003+05:30</published><updated>2021-09-25T17:21:33.396+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Eureka"/><category scheme="http://www.blogger.com/atom/ns#" term="Netflix"/><category scheme="http://www.blogger.com/atom/ns#" term="Service discovery"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring Cloud"/><category scheme="http://www.blogger.com/atom/ns#" term="SpringBoot"/><title type='text'>Spring cloud service discovery example</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Real time cloud application consist of a large number of micro services communicating with each other. Service instances are added/removed dynamically based on requirement and availability. Service discovery is the process of one service dynamically discovering the network location (IP address and port) of another service without hard coding their location.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGCSbnDEk3tTpGFuUb7kcRPkMzY_UO-s9IaIp_4AD0op-Sduo6qKYUPaYd5pjbiKoUVCfaAsd-ThMLRR_2MtgH6IdSCFXedWffcVMSwXJL2-mAS1j4_CucE9pHaOpkgHAY-5BX4vWPyhk/s1600/Spring+cloud+discovery+service+request+flow+diagram.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;396&quot; data-original-width=&quot;731&quot; height=&quot;345&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGCSbnDEk3tTpGFuUb7kcRPkMzY_UO-s9IaIp_4AD0op-Sduo6qKYUPaYd5pjbiKoUVCfaAsd-ThMLRR_2MtgH6IdSCFXedWffcVMSwXJL2-mAS1j4_CucE9pHaOpkgHAY-5BX4vWPyhk/s640/Spring+cloud+discovery+service+request+flow+diagram.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
Steps involved in service discovery&lt;br /&gt;
&lt;br /&gt;
1. &lt;b&gt;Service registers location&lt;/b&gt; - when service boots up it registers itself with discovery server&lt;br /&gt;
&lt;br /&gt;
2. &lt;b&gt;Client looks for service location&lt;/b&gt; - When client needs to hit a particular service first it goes to discovery server for its location&lt;br /&gt;
&lt;br /&gt;
3. &lt;b&gt;Discovery server sends back location&lt;/b&gt;&amp;nbsp;- Discovery server sends the active location of the particular service&lt;br /&gt;
&lt;br /&gt;
4. &lt;b&gt;Client request service at location&lt;/b&gt;&amp;nbsp;- This is a normal request to the service&lt;br /&gt;
&lt;br /&gt;
5. &lt;b&gt;Service sends response&lt;/b&gt;&amp;nbsp;- Service responds to client accordingly&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Example &lt;/b&gt;-&lt;br /&gt;
&lt;br /&gt;
Started eureka server on default port 8761 and Started 2 instances of Application service on 8081 and 8082&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihSgC5lMlP0nRMN_-3e7afVqfJRXAzwD9sUn54K5P3v3DENO8GiQULv2dweDOvRfNdtIziNesEySN7-u0B4eC0IlqviR_vRHnCFD-pa1IBJojfigPwRfX56VYrZaBcd6mmwfN-XwDihYY/s1600/eureka+server+console.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;671&quot; data-original-width=&quot;1344&quot; height=&quot;318&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihSgC5lMlP0nRMN_-3e7afVqfJRXAzwD9sUn54K5P3v3DENO8GiQULv2dweDOvRfNdtIziNesEySN7-u0B4eC0IlqviR_vRHnCFD-pa1IBJojfigPwRfX56VYrZaBcd6mmwfN-XwDihYY/s640/eureka+server+console.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;b&gt;Discovery Server&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
pom.xml&lt;br /&gt;
&lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Fdiscovery-server%2Fblob%2Fmaster%2Fpom.xml&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&quot;&gt;&lt;/script&gt;

application.properties&lt;br /&gt;
&lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Fdiscovery-server%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fresources%2Fapplication.properties&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&quot;&gt;&lt;/script&gt;

DiscoveryServerApplication.java&lt;br /&gt;
&lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Fdiscovery-server%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Fcom%2Fjavaxp%2Fdiscoveryserverdemo%2FDiscoveryServerDemoApplication.java&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&quot;&gt;&lt;/script&gt;

&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;Application Service&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
pom.xml&lt;br /&gt;
&lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Fdiscovery-application-service%2Fblob%2Fmaster%2Fpom.xml&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&quot;&gt;&lt;/script&gt;

application.properties&lt;br /&gt;
&lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Fdiscovery-application-service%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fresources%2Fapplication.properties&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&quot;&gt;&lt;/script&gt;

ServiceApplication.java&lt;br /&gt;
&lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Fdiscovery-application-service%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Fcom%2Fjavaxp%2Fdiscoveryapplicationservice%2FServiceApplication.java&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&quot;&gt;&lt;/script&gt;

Controller.java&lt;br /&gt;
&lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Fdiscovery-application-service%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Fcom%2Fjavaxp%2Fdiscoveryapplicationservice%2FController.java&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&quot;&gt;&lt;/script&gt;

&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;Client&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
pom.xml&lt;br /&gt;
&lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Fdiscovery-client%2Fblob%2Fmaster%2Fpom.xml&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&quot;&gt;&lt;/script&gt;

application.properties&lt;br /&gt;
&lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Fdiscovery-client%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fresources%2Fapplication.properties&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&quot;&gt;&lt;/script&gt;

DiscoveryClientApplication.java&lt;br /&gt;
&lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Fdiscovery-client%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Fcom%2Fjavaxp%2Fdiscoveryclient%2FDiscoveryClientApplication.java&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&quot;&gt;&lt;/script&gt;

Controller.java&lt;br /&gt;
&lt;script src=&quot;https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fmadan712%2Fdiscovery-client%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Fcom%2Fjavaxp%2Fdiscoveryclient%2FController.java&amp;amp;style=github&amp;amp;showBorder=on&amp;amp;showLineNumbers=on&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
Here is complete source code in&amp;nbsp;&lt;b&gt;Github&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://github.com/madan712/discovery-server&quot;&gt;https://github.com/madan712/discovery-server&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://github.com/madan712/discovery-application-service&quot;&gt;https://github.com/madan712/discovery-application-service&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://github.com/madan712/discovery-client&quot;&gt;https://github.com/madan712/discovery-client&lt;/a&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/3309277975934264817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/3309277975934264817'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2020/06/spring-cloud-service-discovery-example.html' title='Spring cloud service discovery example'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGCSbnDEk3tTpGFuUb7kcRPkMzY_UO-s9IaIp_4AD0op-Sduo6qKYUPaYd5pjbiKoUVCfaAsd-ThMLRR_2MtgH6IdSCFXedWffcVMSwXJL2-mAS1j4_CucE9pHaOpkgHAY-5BX4vWPyhk/s72-c/Spring+cloud+discovery+service+request+flow+diagram.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-465253141707055000</id><published>2020-05-31T15:47:00.000+05:30</published><updated>2020-06-02T23:52:10.824+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ActiveMQ"/><category scheme="http://www.blogger.com/atom/ns#" term="Apache"/><category scheme="http://www.blogger.com/atom/ns#" term="JMS"/><category scheme="http://www.blogger.com/atom/ns#" term="Maven"/><category scheme="http://www.blogger.com/atom/ns#" term="SpringBoot"/><title type='text'>Spring boot ActiveMQ example</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;ActiveMQ Setup&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Download the latest version of ActiveMQ from below link&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://activemq.apache.org/components/classic/download/&quot; target=&quot;_blank&quot;&gt;https://activemq.apache.org/components/classic/download/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglthiz-MOAVPT4W-OABElpQplVqBm9YgjeBw7uVfoNVrpnhSEeUS4TxmXUAjnZ3OqdecxEW961XOL6eUF-7eFQJimMU5iBePCDRgVbhGOJKqtQ_D0q33e4I1Kus4k2Wwh-yC2Dxj8t-ak/s1600/Download+apache+ActiveMQ.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;671&quot; data-original-width=&quot;1361&quot; height=&quot;314&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglthiz-MOAVPT4W-OABElpQplVqBm9YgjeBw7uVfoNVrpnhSEeUS4TxmXUAjnZ3OqdecxEW961XOL6eUF-7eFQJimMU5iBePCDRgVbhGOJKqtQ_D0q33e4I1Kus4k2Wwh-yC2Dxj8t-ak/s640/Download+apache+ActiveMQ.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
Extract the zip file, go to bin folder and start activemq server using activemq.bat&lt;br /&gt;
&lt;br /&gt;
In my case it is&lt;br /&gt;
apache-activemq-5.15.11/bin/win32/activemq.bat&lt;br /&gt;
&lt;br /&gt;
Verify ActiveMQ server is UP and running&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://localhost:8161/index.html&quot;&gt;http://localhost:8161/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGJIgWVCIxxbU41SRaYY2CzJBnCKu-_ygjHB0dBixa5SdKLmzIbxbiHM43XFLXK__SsRfD-QKIRK9sWZfPLAOPlovqnY-TvAP5Xq-qwedfldAHwBrkEavxbuN6r3cSdTsetC1vXckdWAE/s1600/ActiveMQ+server+index+page.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;456&quot; data-original-width=&quot;1359&quot; height=&quot;214&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGJIgWVCIxxbU41SRaYY2CzJBnCKu-_ygjHB0dBixa5SdKLmzIbxbiHM43XFLXK__SsRfD-QKIRK9sWZfPLAOPlovqnY-TvAP5Xq-qwedfldAHwBrkEavxbuN6r3cSdTsetC1vXckdWAE/s640/ActiveMQ+server+index+page.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
Note - You can change the default port 8161 by updating below file&lt;br /&gt;
apache-activemq-5.15.11/conf/jetty.xml&lt;br /&gt;
&lt;br /&gt;
Go to admin page&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://localhost:8161/admin/&quot;&gt;http://localhost:8161/admin/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Login with default credentials&lt;br /&gt;
&lt;br /&gt;
Username - admin&lt;br /&gt;
Password - admin&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA5ou5bFtcQorYOFwsO-mU0D21SEDKDsEOYldmmXe8OU09sHzfWosqg4NP5NEHqDPmST6mDI5t045tTwG2X0D30tLws0wYWFQ2FkqoOyddUU6al3RUj2HDZQmTq1eiksUFF9adNgTjbCM/s1600/ActiveMQ+admin+page.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;634&quot; data-original-width=&quot;1361&quot; height=&quot;298&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA5ou5bFtcQorYOFwsO-mU0D21SEDKDsEOYldmmXe8OU09sHzfWosqg4NP5NEHqDPmST6mDI5t045tTwG2X0D30tLws0wYWFQ2FkqoOyddUU6al3RUj2HDZQmTq1eiksUFF9adNgTjbCM/s640/ActiveMQ+admin+page.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Note - You can change default credentials by updating below file&lt;br /&gt;
apache-activemq-5.15.11/conf/jetty-realm.properties&lt;br /&gt;
&lt;br /&gt;
Here is how our data will flow&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsTR4jl5GNeRjrH7EFGDOH3hDZwJh-QNGLymAwTyLUsCaOhr8voOqjCPns2tPEJ1Bl6WMnkxJ8uKkiJqwStfcl8gI7s3tOT4tvwC8p_G0Nn1e-8vdfJ4nI_fSLb2GAyIsPEv7oRaUto1M/s1600/ActiveMQ+flow.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;311&quot; data-original-width=&quot;653&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsTR4jl5GNeRjrH7EFGDOH3hDZwJh-QNGLymAwTyLUsCaOhr8voOqjCPns2tPEJ1Bl6WMnkxJ8uKkiJqwStfcl8gI7s3tOT4tvwC8p_G0Nn1e-8vdfJ4nI_fSLb2GAyIsPEv7oRaUto1M/s1600/ActiveMQ+flow.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
Please see the self explanatory code below, in our example server will push a message (Object) to queue ever 2 seconds and client will read the message.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Server&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;pom.xml&lt;/b&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/e56ba46fddb4f70f522b09525e630ff3.js&quot;&gt;&lt;/script&gt;

&lt;b&gt;TestJmsServerApplication.java&lt;/b&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/9e5870b11f6e3e778338f9ad843959e9.js&quot;&gt;&lt;/script&gt;

&lt;b&gt;application.properties&lt;/b&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/945a17b58375bce72d41a8283fe67fce.js&quot;&gt;&lt;/script&gt;

&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Client&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;pom.xml&lt;/b&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/33f5850a1a0efde7085eaf8322d67375.js&quot;&gt;&lt;/script&gt;

&lt;b&gt;TestJmsClientApplication.java&lt;/b&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/f642e9f5a630a1641feaa802b66b6ec2.js&quot;&gt;&lt;/script&gt;

&lt;b&gt;Receiver.java&lt;/b&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/5e4259239dc7492ff31ac8f1a2eda3a7.js&quot;&gt;&lt;/script&gt;

&lt;b&gt;application.properties&lt;/b&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/945a17b58375bce72d41a8283fe67fce.js&quot;&gt;&lt;/script&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Download full source code from github&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://github.com/madan712/jms-server.git&quot; target=&quot;_blank&quot;&gt;https://github.com/madan712/jms-server.git&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://github.com/madan712/jms-client.git&quot; target=&quot;_blank&quot;&gt;https://github.com/madan712/jms-client.git&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/465253141707055000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/465253141707055000'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2020/05/spring-boot-activemq-example.html' title='Spring boot ActiveMQ example'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglthiz-MOAVPT4W-OABElpQplVqBm9YgjeBw7uVfoNVrpnhSEeUS4TxmXUAjnZ3OqdecxEW961XOL6eUF-7eFQJimMU5iBePCDRgVbhGOJKqtQ_D0q33e4I1Kus4k2Wwh-yC2Dxj8t-ak/s72-c/Download+apache+ActiveMQ.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-8939291287270436138</id><published>2019-07-28T22:39:00.003+05:30</published><updated>2022-01-09T23:06:14.007+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="ReactJs"/><category scheme="http://www.blogger.com/atom/ns#" term="Redux"/><title type='text'>React with Redux authorization workflow example (react-router-dom v6)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;This a simple React example which demonstrates how&amp;nbsp;&lt;/span&gt;to restrict access to routes to authenticated users.&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Complete source code can be found in GitHub -&lt;br /&gt;
&lt;a href=&quot;https://github.com/madan712/auth-workflow&quot; target=&quot;_blank&quot;&gt;https://github.com/madan712/auth-workflow&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Below packages are used in this example -&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;React router - React Router is used to manage navigation in react application&lt;/li&gt;
&lt;li&gt;Redux - Redux is used to manage state of react applications&lt;/li&gt;&lt;li&gt;react-router-dom v6 - React routing library&lt;/li&gt;
&lt;li&gt;react-bootstrap - React-Bootstrap is a complete re-implementation of the Bootstrap components using React&lt;/li&gt;
&lt;li&gt;react-redux-toastr - Used to show alert messages&lt;/li&gt;
&lt;li&gt;Webpack - Webpack is used to create prod ready build which can be used to deployed in production&lt;/li&gt;
&lt;li&gt;Babel - Babel is used to convert ECMAScript 2015+ code into a backwards compatible version of JavaScript in current and older browsers or environments&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;About the example&lt;/b&gt; - We have a landing page i.e public page which can be viewed by anyone. As this is a public page, user need not required to go through any sort of authorization&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhegA9xg67UqYHKxScpwduar2hrQvKI8a5-Q-1Z1wnTOt2NoJvrjfAx77rpz4LT6sQWqo5Y9kz8aQQk_5Bxe-Bt8f2a2b-Nyry5QDz1d_-YfwjHdy0Ac1Qm8dHqQG1zxNqj6QkT-tvQZzY/s1600/react+auth+flow+1.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;498&quot; data-original-width=&quot;772&quot; height=&quot;411&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhegA9xg67UqYHKxScpwduar2hrQvKI8a5-Q-1Z1wnTOt2NoJvrjfAx77rpz4LT6sQWqo5Y9kz8aQQk_5Bxe-Bt8f2a2b-Nyry5QDz1d_-YfwjHdy0Ac1Qm8dHqQG1zxNqj6QkT-tvQZzY/s640/react+auth+flow+1.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Our private page is a restricted page. If user clicks on private page link, user is taken to login page where user is asked to enter user name and password&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuvhRaellviPctDs2P6jwij7-mrRp44dbJuzx-wE7cG0GKPP-pdfFlPiT3NmN8lQ1sGf0jnrYHu7CxCkljdsRmCm9bSdyiFEKSNT9OO_VUh9rx_qI9ATiJQrtDJheJvfltqgu-tYVSifY/s1600/react+auth+flow+2.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;498&quot; data-original-width=&quot;772&quot; height=&quot;412&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuvhRaellviPctDs2P6jwij7-mrRp44dbJuzx-wE7cG0GKPP-pdfFlPiT3NmN8lQ1sGf0jnrYHu7CxCkljdsRmCm9bSdyiFEKSNT9OO_VUh9rx_qI9ATiJQrtDJheJvfltqgu-tYVSifY/s640/react+auth+flow+2.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;If user is a valid user i.e authorized user then only user can see the private page&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyWsdQLFW3qkqQl_-RpDhv8YOyik0zQJsGyniZfXs1HpWIq7RlDSsMoVtnwql2Y6nCM49shz2pRZsStgid9HJKujB4jMWGy2PEVtJL3HZd-NS4XmL0D8ocfpAZZtMcUo8yzmZmjapvtPo/s1600/react+auth+flow+4.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;498&quot; data-original-width=&quot;772&quot; height=&quot;412&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyWsdQLFW3qkqQl_-RpDhv8YOyik0zQJsGyniZfXs1HpWIq7RlDSsMoVtnwql2Y6nCM49shz2pRZsStgid9HJKujB4jMWGy2PEVtJL3HZd-NS4XmL0D8ocfpAZZtMcUo8yzmZmjapvtPo/s640/react+auth+flow+4.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;Steps to run the example -&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Courier New, Courier, monospace;&quot;&gt;&amp;gt;git clone&amp;nbsp;https://github.com/madan712/auth-workflow.git&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Courier New, Courier, monospace;&quot;&gt;&amp;gt;cd auth-workflow&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Courier New, Courier, monospace;&quot;&gt;auth-workflow&amp;gt;npm install&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Courier New, Courier, monospace;&quot;&gt;auth-workflow&amp;gt;npm start&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/8939291287270436138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/8939291287270436138'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2019/07/react-with-redux-authorization-workflow.html' title='React with Redux authorization workflow example (react-router-dom v6)'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhegA9xg67UqYHKxScpwduar2hrQvKI8a5-Q-1Z1wnTOt2NoJvrjfAx77rpz4LT6sQWqo5Y9kz8aQQk_5Bxe-Bt8f2a2b-Nyry5QDz1d_-YfwjHdy0Ac1Qm8dHqQG1zxNqj6QkT-tvQZzY/s72-c/react+auth+flow+1.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-302969220873784350</id><published>2019-06-29T21:32:00.001+05:30</published><updated>2019-06-30T15:08:34.747+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cryptography"/><category scheme="http://www.blogger.com/atom/ns#" term="Maven"/><category scheme="http://www.blogger.com/atom/ns#" term="MY SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="pom.xml"/><category scheme="http://www.blogger.com/atom/ns#" term="SpringBoot"/><title type='text'>Spring Boot + Jasypt example to encrypt database password in property file</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In this example we will see how to encrypted database password in property file (application.properties or application.yml). We will use Jasypt library for this purpose.&lt;br /&gt;
&lt;br /&gt;
Jasypt (Java Simplified Encryption) is a java library which allows the developer to add basic encryption capabilities to his/her projects with minimum effort, and without the need of having deep knowledge on how cryptography works.&lt;br /&gt;
&lt;br /&gt;
To know more about Jasypt, &lt;a href=&quot;http://www.jasypt.org/&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;. Go to Jasypt website and download the latest version of jasypt client. I am using&amp;nbsp;&lt;a href=&quot;https://www.dropbox.com/s/h2hdl32g31zvnau/jasypt-1.9.2-dist.zip?dl=0&quot; target=&quot;_blank&quot;&gt;jasypt-1.9.2-dist.zip&lt;/a&gt;. Once downloaded extract the zip file and go to folder &lt;b&gt;/jasypt-1.9.2/bin&lt;/b&gt; and execute the below command. Here input is your password or any other text that you want to encrypt and password is the secret key used by Jasypt to encode and decode the input.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;encrypt.bat input=&quot;dummy_password&quot; password=&quot;SECRET_KEY&quot;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAZc3tFrT3rn0aEOTTEp-z5nCKigcNa7y8JiNPQ_bDADjANZuF9O7holHugMq4iv2XuphyV7Gt-3o3tofsn_ejv4PjRZdjmE8aZ26zZ1bNOAI7075U6n66N3rJdOkw7s8Vbu829BXDE1A/s1600/jasypt+client.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;342&quot; data-original-width=&quot;677&quot; height=&quot;323&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAZc3tFrT3rn0aEOTTEp-z5nCKigcNa7y8JiNPQ_bDADjANZuF9O7holHugMq4iv2XuphyV7Gt-3o3tofsn_ejv4PjRZdjmE8aZ26zZ1bNOAI7075U6n66N3rJdOkw7s8Vbu829BXDE1A/s640/jasypt+client.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
To know about encrypting from the command line using Jasypt CLI Tools. &lt;a href=&quot;http://www.jasypt.org/cli.html&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Add below maven dependency in your &lt;b&gt;pom.xml&lt;/b&gt; file&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&amp;lt;dependency&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;groupId&amp;gt;com.github.ulisesbocchio&amp;lt;/groupId&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;artifactId&amp;gt;jasypt-spring-boot-starter&amp;lt;/artifactId&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;version&amp;gt;2.1.1&amp;lt;/version&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&amp;lt;/dependency&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;application.yml&lt;/b&gt;&lt;br /&gt;
Note - the encrypted password in parenthesis with keyword &lt;b&gt;ENC&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/c639efcef4dfa3965d178e32827634b4.js&quot;&gt;&lt;/script&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
There are various options by which you can feed the SECRET_KEY to your application&lt;br /&gt;
&lt;br /&gt;
- From java code you can set system property jasypt.encryptor.password as shown below. You can do this in a separate secure JAR file.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;System.setProperty(&quot;jasypt.encryptor.password&quot;, &quot;SECRET_KEY&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
- From command line you can pass system properties&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;$ Java -Djasypt.encryptor.password=SECRET_KEY Application&lt;/span&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/302969220873784350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/302969220873784350'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2019/06/spring-boot-jasypt-example-to-encrypted.html' title='Spring Boot + Jasypt example to encrypt database password in property file'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAZc3tFrT3rn0aEOTTEp-z5nCKigcNa7y8JiNPQ_bDADjANZuF9O7holHugMq4iv2XuphyV7Gt-3o3tofsn_ejv4PjRZdjmE8aZ26zZ1bNOAI7075U6n66N3rJdOkw7s8Vbu829BXDE1A/s72-c/jasypt+client.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-956362969824983034</id><published>2019-06-29T17:32:00.003+05:30</published><updated>2019-06-29T17:32:50.343+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="hibernate"/><category scheme="http://www.blogger.com/atom/ns#" term="Maven"/><category scheme="http://www.blogger.com/atom/ns#" term="MY SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="pom.xml"/><category scheme="http://www.blogger.com/atom/ns#" term="Simple Java Codes"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring"/><category scheme="http://www.blogger.com/atom/ns#" term="SpringBoot"/><title type='text'>My Sql + Spring Boot JPA - One to many, many to one example </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif; font-size: 13.2px;&quot;&gt;This is a simple spring boot JPA (hibernate) example. It will demonstrate how o&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;ne to many, many to one mapping can be done&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;&quot;&gt;
Below are the tables created in MySQL&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;create table department&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&amp;nbsp;department_id int not null auto_increment,primary key (department_id),&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&amp;nbsp;department_name&amp;nbsp; varchar(50) not null&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;create table employee&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&amp;nbsp;employee_id int not null auto_increment, primary key (employee_id),&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&amp;nbsp;employee_name varchar(50) not null,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&amp;nbsp;department_id int not null, foreign key (department_id) references department(department_id)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;b&gt;pom.xml&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/f32423a038d5f007631a3462047cb75a.js&quot;&gt;&lt;/script&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;b&gt;application.yml&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/630b06e21cdfae5694dfd57b6c697f63.js&quot;&gt;&lt;/script&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;b&gt;Employee.java&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/c875961c891af95b440192c5ba355e15.js&quot;&gt;&lt;/script&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;b&gt;Department.java&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/7675f2fc266d5536685ab9e41a5f42c8.js&quot;&gt;&lt;/script&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;
&lt;b style=&quot;color: #222222; font-family: arial, tahoma, helvetica, freesans, sans-serif; font-size: 13.2px;&quot;&gt;EmployeeRepository.java&lt;/b&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/091440a53c11a2fc7dce54d243d36341.js&quot;&gt;&lt;/script&gt;
&lt;b style=&quot;color: #222222; font-family: arial, tahoma, helvetica, freesans, sans-serif; font-size: 13.2px;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b style=&quot;color: #222222; font-family: arial, tahoma, helvetica, freesans, sans-serif; font-size: 13.2px;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;b&gt;DepartmentRepository.java&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/86b8a26cd787bd1e118196d864e3996a.js&quot;&gt;&lt;/script&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;b&gt;Application.java&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/cf93b1d1a60b0afdb73834520b58472a.js&quot;&gt;&lt;/script&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #222222; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;freesans&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/956362969824983034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/956362969824983034'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2019/06/my-sql-spring-boot-jpa-one-to-many-many.html' title='My Sql + Spring Boot JPA - One to many, many to one example '/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-6339339347422479100</id><published>2019-06-28T02:12:00.001+05:30</published><updated>2019-06-28T02:12:41.007+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSV File"/><category scheme="http://www.blogger.com/atom/ns#" term="MY SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="pom.xml"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring"/><category scheme="http://www.blogger.com/atom/ns#" term="SpringBoot"/><title type='text'>Java - Export database table to CSV file</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;&quot;&gt;This is a sample springboot application with bare minimum code to export&amp;nbsp;database tables to CSV file&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;pom.xml&lt;/b&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/12a4b036cc3f5aecfadb6435f6fab36a.js&quot;&gt;&lt;/script&gt;
&lt;br /&gt;
&lt;b&gt;application.yml&lt;/b&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/630b06e21cdfae5694dfd57b6c697f63.js&quot;&gt;&lt;/script&gt;
&lt;br /&gt;
&lt;b&gt;Application.java&lt;/b&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/d890822770530ae908b1d91395b1c016.js&quot;&gt;&lt;/script&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/6339339347422479100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/6339339347422479100'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2019/06/java-export-database-table-to-csv-file.html' title='Java - Export database table to CSV file'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-9212865597108404843</id><published>2019-06-28T01:42:00.000+05:30</published><updated>2019-06-28T01:42:19.947+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSV File"/><category scheme="http://www.blogger.com/atom/ns#" term="MY SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Python - Export database table to csv file</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;script src=&quot;https://gist.github.com/madan712/f27ac3b703a541abbcd63871a4a56636.js&quot;&gt;&lt;/script&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/9212865597108404843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/9212865597108404843'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2019/06/python-export-database-table-to-csv-file.html' title='Python - Export database table to csv file'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8882377031456587900.post-5356330906052128049</id><published>2019-06-28T00:51:00.000+05:30</published><updated>2019-06-28T00:53:40.332+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Maven"/><category scheme="http://www.blogger.com/atom/ns#" term="MY SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="pom.xml"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring"/><category scheme="http://www.blogger.com/atom/ns#" term="SpringBoot"/><title type='text'>Java - Export database tables to an excel file</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
This is a sample springboot application with bare minimum code to export&amp;nbsp;database tables to an excel file&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;pom.xml&lt;/b&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/154c85fdbfb1fa9de5112ae91813ce57.js&quot;&gt;&lt;/script&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;application.yml&lt;/b&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/630b06e21cdfae5694dfd57b6c697f63.js&quot;&gt;&lt;/script&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;Application.java&lt;/b&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/madan712/1bdaee47739d3bd3c60ed98ceb259765.js&quot;&gt;&lt;/script&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/5356330906052128049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8882377031456587900/posts/default/5356330906052128049'/><link rel='alternate' type='text/html' href='http://www.javaxp.com/2019/06/java-export-database-tables-to-excel.html' title='Java - Export database tables to an excel file'/><author><name>Madan</name><uri>http://www.blogger.com/profile/05020140911511710072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>