Partner – Lightrun – NPI EA (cat=Sping)

We rely on other people’s code in our own work. Every

It might be the language you’re writing in, the framework you’re building on, or some esoteric piece of software that does one thing so well you never found the need to implement it yourself.

The problem is, of course, when things fall apart in production - debugging the implementation of a 3rd party library you have no intimate knowledge of is, to say the least, tricky.

Lightrun is a new kind of debugger.

It's one geared specifically towards real-life production environments. Using Lightrun, you can drill down into running applications, including 3rd party dependencies, with real-time logs, snapshots, and metrics.

Learn more in this quick, 5-minute Lightrun tutorial :

Essential List of Spring Boot Annotations and Their Use Cases

Partner – Jmix Haulmont – NPI EA (cat= Architecture)
announcement - icon

Building or modernizing a Java enterprise web app has always been a long process, historically. Not even remotely quick.

That's the main goal of Jmix is to make the process quick without losing flexibility - with the open-source RAD platform enabling fast development of business applications.

Critically, it has very minimal impact on your server's performance, with most of the profiling work done separately - so it needs no server changes, agents or separate services.

Simply put, a single Java or Kotlin developer can now quickly implement an entire modular feature, from DB schema, data model, fine-grained access control, business logic, BPM, all the way to the UI.

Jmix supports both developer experiences – visual tools and coding , and a host of super useful plugins as well:

>> Try out Jmix

Partner – AEGIK AB – NPI EA (tag = SQL)
announcement - icon

Slow MySQL query performance is all too common. Of course it is. A good way to go is, naturally, a dedicated profiler that actually understands the ins and outs of MySQL.

The Jet Profiler was built for MySQL only , so it can do things like real-time query performance, focus on most used tables or most frequent queries, quickly identify performance issues and basically help you optimize your queries.

Critically, it has very minimal impact on your server's performance, with most of the profiling work done separately - so it needs no server changes, agents or separate services.

Basically, you install the desktop application, connect to your MySQL server , hit the record button, and you'll have results within minutes:

out the Profiler

Partner – DBSchema – NPI EA (tag = SQL)
announcement - icon

DbSchema is a super-flexible database designer, which can take you from designing the DB with your team all the way to safely deploying the schema .

The way it does all of that is by using a design model , a database-independent image of the schema, which can be shared in a team using GIT and compared or deployed on to any database.

And, of course, it can be heavily visual, allowing you to interact with the database using diagrams, visually compose queries, explore the data, generate random data, import data or build HTML5 database reports.

Take a look at DBSchema

Partner – CAST AI – NPI EA (tag = kubernetes)
announcement - icon

The Kubernetes ecosystem is huge and quite complex, so it’s easy to forget about costs when trying out all of the exciting tools.

To avoid overspending on your Kubernetes cluster, definitely have a look at the free K8s cost monitoring tool from the automation platform CAST AI. You can view your costs in real time, allocate them, calculate burn rates for projects, spot anomalies or spikes, and get insightful reports you can share with your team.

Connect your cluster and start monitoring your K8s costs right away:

Kubernetes cost monitoring

Course – LSS (cat=Security/Spring Security)

I just announced the new Learn Spring Security course, including the full material focused on the new OAuth2 stack in Spring Security 5:

>> CHECK OUT THE COURSE
Course – LS (cat=Java)

Get started with Spring 5 and Spring Boot 2, through the Learn Spring course:

> CHECK OUT THE COURSE

1. Overview

When it comes to SSL connections, we should be using TLSv1.2. Indeed, it's the default SSL protocol for Java 8.

And while Java 7 supports TLSv1.2, the default is TLS v1.0, which is too weak these days.

In this tutorial, we'll discuss various options to configure Java 7 to use TLSv1.2.

2. Using Java VM Arguments

If we are using Java 1.7.0_95 or later, we can add the jdk.tls.client.protocols property as a java command-line argument to support TLSv1.2:

java -Djdk.tls.client.protocols=TLSv1.2 <Main class or the Jar file to run>

But Java 1.7.0_95 is available only to the customers who purchased support from Oracle . So, we'll review other options below to enable TLSv1.2 on Java 7.

3. Using SSLSocket

In this first example, we'll enable TLSv1.2 using SSLSocketFactory .

First, we can create a default SSLSocketFactory object by calling the SSLSocketFactory# getDefault factory method.

Then, we simply pass our host and port to SSLSocket# createSocket :

SSLSocketFactory socketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
SSLSocket sslSocket = (SSLSocket) socketFactory.createSocket(hosturl, port);

The default SSLSocket created above doesn't have any SSL protocols associated with it. We can associate the SSL protocols to our SSLSocket in a couple of ways.

In the first approach, we can pass an array of supported SSL protocols to the setEnabledProtocols method on our SSLSocket instance :

sslSocket.setEnabledProtocols(new String[] {"TLSv1.2"});

Alternatively, we can use SSLParameters , using the same array:

SSLParameters params = new SSLParameters();
params.setProtocols(new String[] {"TLSv1.2"});
sslSocket.setSSLParameters(params);

4. Using SSLContext

Setting the SSLSocket directly changes only the one connection. We can use SSLContext to change the way we create the SSLSocketFactory.

So, instead of using SSLSocketFactory#getInstance , let's do SSLContext#getInstance, giving it “ TLSv1.2 ” as a parameter. We can just get our SSLSocketFactory from that now:

SSLContext sslContext = SSLContext.getInstance("TLSv1.2");
sslContext.init(null, null, new SecureRandom());
SSLSocketFactory socketFactory = sslContext.getSocketFactory();
SSLSocket socket = (SSLSocket) socketFactory.createSocket(url, port);

As a quick side note, always remember to use SecureRandom when working with SSL.

5. Using HttpsURLConnection

Of course, we aren't always creating sockets directly. Oftentimes, we are at the application protocol level.

So, finally, let's see how to enable TLSv1.2 on HttpsURLConnection .

First, we'll need an instance of URL . Let's imagine that we are connecting to https://example.org :

URL url = new URL("https://" + hosturl + ":" + port);

Now, we can set up our SSLContext as before:

SSLContext sslContext = SSLContext.getInstance("TLSv1.2"); 
sslContext.init(null, null, new SecureRandom());

Then, our last steps are to create the connection and supply it with an SSLSocketFactory :

HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
connection.setSSLSocketFactory(sslContext.getSocketFactory());

6. Conclusion

In this quick article, we showed a few ways to enable TLSv1.2 on Java 7.

The code samples used in this article are available over on GitHub .

Partner – AEGIK AB – NPI EA (tag = SQL)
announcement - icon

Slow MySQL query performance is all too common. Of course it is. A good way to go is, naturally, a dedicated profiler that actually understands the ins and outs of MySQL.

The Jet Profiler was built for MySQL only , so it can do things like real-time query performance, focus on most used tables or most frequent queries, quickly identify performance issues and basically help you optimize your queries.

Critically, it has very minimal impact on your server's performance, with most of the profiling work done separately - so it needs no server changes, agents or separate services.

Basically, you install the desktop application, connect to your MySQL server , hit the record button, and you'll have results within minutes:

out the Profiler

Course – LSS (cat=Security/Spring Security)

I just announced the new Learn Spring Security course, including the full material focused on the new OAuth2 stack in Spring Security 5:

>> CHECK OUT THE COURSE
Course – LS (cat=Java)

Get started with Spring 5 and Spring Boot 2, through the Learn Spring course:

>> CHECK OUT THE COURSE
res – Security (video) (cat=Security/Spring Security)