02 Feb 2023

feedDZone Java Zone

Part I: Creating Custom API Endpoints in Salesforce With Apex

Part One: SOAP-Based APIs

Simple Object Access Protocol (SOAP) is a messaging protocol based on requests and responses using an XML format. Although some legacy systems still use SOAP over SMTP, the transport method typically used for SOAP requests is HTTP. As an API protocol, SOAP is platform-and language-agnostic, allowing for two applications running on completely different systems to communicate with one another.

This post is part of a two-part series covering how to create custom API endpoints in Salesforce with APEX. In Part One, we'll walk through how to create a SOAP-based API endpoint for other applications to use when communicating with your Salesforce org.

02 Feb 2023 1:18pm GMT

Remote Debugging Dangers and Pitfalls

This is the last part of the debugging series. To learn the rest, you'll need to get the book "Practical Debugging at Scale: Cloud Native Debugging in Kubernetes and Production" or the course. One of the most frequently asked questions I receive is: can we do these things in VS Code?

The answer is, unfortunately, no. But I elaborate on the debugging capabilities of VS Code in this video: "16 Missing Features in the VS Code Debugger" on YouTube. I'll do a blog post that covers that next week.

02 Feb 2023 1:37am GMT

01 Feb 2023

feedDZone Java Zone

How and Why You Should Start Automating DevOps

DevOps is not new. Every business in the IT world knows it is the right software development methodology. Indeed, DevOps has enticed the world with its promise of high-quality product delivery at a faster pace. Despite the clear promise of DevOps, many businesses are failing to realize its complete potential. While cultural inertia and skillset sparsity are some of the reasons, the inability to completely automate the DevOps lifecycle remains the greatest impediment for businesses to drive full value from their DevOps investments. Integration of DevOps and automation is what leads to a more efficient software development lifecycle (SDLC). So, let's understand what it is all about automating DevOps and how you can start automating your DevOps processes.

What Is DevOps Automation?

Automation is the fundamental principle of DevOps. In fact, "automating everything" is the ultimate objective of the DevOps methodology. So, DevOps automation is the process of automating nearly every repetitive and manual task across the DevOps SDLC, from design and development to deployment and release management.

01 Feb 2023 11:20pm GMT

Asynchronous HTTP Requests With RxJava

Let's say we develop a service that has to interact with other components. Unfortunately, those components are slow and blocking.

It may be a legacy service that is very slow or some blocking API that we must use. Regardless, we have no control over it. In this post, we will call two APIs. One of them will block for two seconds and another for five seconds.

01 Feb 2023 8:23pm GMT

Architectural Miscalculation and Hibernate Problem "Type UUID but Expression Is of Type Bytea"

Nowadays, it is difficult to find a service that works on its own and does not communicate with other services, especially modern systems that are built on a microservice architecture. In this regard, there are difficulties in obtaining data from one or another service since not all the data necessary for the operation of the service is stored in one database, and you cannot simply make a "join." I want to talk about one of these problems and its solution in this article.

Case Description

A huge number of projects use Spring + Hibernate. This bundle gives an advantage in development speed, reducing the amount of code and blah blah blah. But there are also disadvantages.

01 Feb 2023 6:35pm GMT

Top 5 Java REST API Frameworks

The Java programming language is a high-level, object-oriented language that enables developers to create robust, reusable code. Java is known for its portability and platform independence, which means that Java code can run on any system that supports the Java Runtime Environment (JRE).

James Gosling originally developed Java at Sun Microsystems in 1995. Since then, the language has undergone several changes and has become one of the world's most widely used programming languages. According to estimation, there are more than nine million developers worldwide using Java for a variety of purposes.

01 Feb 2023 1:34pm GMT

30 Jan 2023

feedDZone Java Zone

Express Hibernate Queries as Type-Safe Java Streams

As much as the JPA Criteria builder is expressive, JPA queries are often equally verbose, and the API itself can be unintuitive to use, especially for newcomers. In the Quarkus ecosystem, Panache is a partial remedy for these problems when using Hibernate. Still, I find myself juggling the Panache's helper methods, preconfigured enums, and raw strings when composing anything but the simplest of queries. You could claim I am just inexperienced and impatient or, instead, acknowledge that the perfect API is frictionless to use for everyone. Thus, the user experience of writing JPA queries can be further improved in that direction.

Introduction

One of the remaining shortcomings is that raw strings are inherently not type-safe, meaning my IDE rejects me the helping hand of code completion and wishes me good luck at best. On the upside, Quarkus facilitates application relaunches in a split second to issue quick verdicts on my code. And nothing beats the heart-felt joy and genuine surprise when I have composed a working query on the fifth, rather than the tenth, attempt...

30 Jan 2023 4:17pm GMT

How To Create and Edit Excel XLSX Documents in Java

For more than three decades - practically an eon in tech years - Excel has greased the wheels of businesses and aspiring individuals around the world. In the US alone, more than 700,000 companies are estimated to use Excel, and worldwide the number of unique Excel users hovers at just over a billion - about 1/8th of the global population.

However, with a fast-developing era of subscription-based, point-and-click enterprise SaaS data solutions well underway, it's becoming clear that using Excel in the "traditional" sense is less obviously efficient than it once was. Clicking on the Excel desktop icon, selecting "New Workbook" and formatting a unique document from a blank page or template is just enough of a resource commitment to put you behind the eight ball by today's lightning-fast project delivery standards. The mundane, predictable nature of Excel's usage has, for well over a decade, begged for and received the same form of intervention which much of the restless tech community constantly marches toward: automation.

30 Jan 2023 1:55am GMT

27 Jan 2023

feedDZone Java Zone

Real-Time Stream Processing With Hazelcast and StreamNative

One of the most useful features of real-time stream processing is to combine the strengths and advantages of various technologies to provide a unique developer experience and an efficient way of processing data in real-time at scale. Hazelcast is a real-time distributed computation and storage platform for consistently low latency queries, aggregation, and stateful computation against real-time event streams and traditional data sources. Apache Pulsar is a real-time multitenant geo-replicated distributed pub-sub messaging and streaming platform for real-time workloads, handling millions of events per hour.

However, real-time stream processing is not an easy task, especially when combining multiple live streams with large volumes of data stored in external data storages to provide context and instant results. When it comes to usage, Hazelcast can be used for the following things:

27 Jan 2023 4:16pm GMT

26 Jan 2023

feedDZone Java Zone

The Quest for REST

Since I started working for Apache APISIX, I have tried to deepen my understanding of REST via various means. Did you read my review of the "API Design Patterns" book?

In the current literature, REST is generally promoted as the best thing since sliced bread. Yet, it comes with lots of challenges. In 2010(!), Martin Fowler wrote a post on the glory of REST. He lists three steps for an API to become truly REST:

26 Jan 2023 7:14pm GMT

Fraud Detection With Apache Kafka, KSQL, and Apache Flink

Fraud detection becomes increasingly challenging in a digital world across all industries. Real-time data processing with Apache Kafka became the de facto standard to correlate and prevent fraud continuously before it happens. This article explores case studies for fraud prevention from companies such as Paypal, Capital One, ING Bank, Grab, and Kakao Games that leverage stream processing technologies like Kafka Streams, KSQL, and Apache Flink.

Fraud Detection and the Need for Real-Time Data

Fraud detection and prevention is the adequate response to fraudulent activities in companies (like fraud, embezzlement, and loss of assets because of employee actions).

26 Jan 2023 7:08pm GMT

Upgrade Guide To Spring Data Elasticsearch 5.0

Recently, I wrote the article, "Pagination With Spring Data Elasticsearch 4.4," but we already have new Spring Data Elasticsearch 5.0 and Spring Boot 3.0 releases. There are several changes and issues we should consider when doing the upgrade.

The goal of this article is to highlight changes when upgrading the sat-elk project with these technologies:

26 Jan 2023 6:11pm GMT

25 Jan 2023

feedDZone Java Zone

A Brief Overview of the Spring Cloud Framework

The concept of distributed applications is certainly not new. Whoever has a long IT career certainly remembers a number of different technologies implementing distributed components even in the early years. Nowadays, is all about microservices. They are a new form by which we consider today the concept of distributed computing.

Their peculiarity is that their communications are based essentially on REST and messaging protocols, which have the advantage of being widely spread standards. The core concept is essentially the same, having pieces of the whole system completely independent one from the other and running each in its own process.

25 Jan 2023 2:13am GMT

24 Jan 2023

feedDZone Java Zone

Spring Cloud: How To Deal With Microservice Configuration (Part 1)

Configuring a software system in a monolithic approach does not pose particular problems. To make the configuration properties available to the system, we can store them in a file inside an application folder, in some place in the filesystem, or as OS environment variables. Microservice configuration is a more complex subject. We have to deal with a number, which can be huge, of totally independent services, each with its own configuration. We could even face a scenario in which several instances of the same service need different configuration values.

In such a situation, a way to centralize and simplify configuration management would be of great importance. Spring Cloud has its own module to solve these problems, named Spring Cloud Config. This module provides an implementation of a server that exposes an API to retrieve the configuration information, usually stored in some remote repository like Git, and, at the same time, it gives us the means to implement the client side meant to consume the services of that API.

24 Jan 2023 8:35pm GMT

22 Jan 2023

feedDZone Java Zone

Microservices Discovery With Eureka

Gaining complexity in a microservices system certainly isn't for the faint of heart (though neither is complexity in monoliths!). When there are many services that need to communicate with one another, we might need to coordinate multiple services communicating with multiple other services. We also might code for varying environments such as local, development server, or the cloud.

How do services know where to find one another? How can we avoid problems when a service is unavailable? How do we handle requests when we scale up or down certain parts of our system?

22 Jan 2023 8:57pm GMT

How to Create a Real-Time Scalable Streaming App Using Apache NiFi, Apache Pulsar, and Apache Flink SQL

Building streaming applications can be a difficult task - often, just figuring out how to get started can be overwhelming. In this article, we'll cover how and when to use NiFi with Pulsar and Flink and how to get started. Apache NiFi, Apache Pulsar, and Apache Flink are robust, powerful open-source platforms that enable running any size application at any scale. This enables us to take our quickly developed prototype and deploy it as an unbreakable clustered application ready for internet-scale production workloads of any size.

Using a drag-and-drop tool can help reduce that difficulty and allow us to get the data flowing. By utilizing Apache NiFi, we can quickly go from ideation to data streaming as live events in our Pulsar topics. Once we have a stream, building applications via SQL becomes a much more straightforward premise. The ability to rapidly prototype, iterate, test, and repeat are critical in modern cloud applications.

22 Jan 2023 8:34pm GMT