CDI Lite, MicroProfile, Helidon, Micronaut and Serverless--an airhacks.fm podcast

Subscribe to airhacks.fm podcast via: spotify| iTunes| RSS

The #149 airhacks.fm episode with Graeme Rocher (@graemerocher) about:
optimizing CDI for serverless with CDI Lite, Micronaut - Helidon cooperation and move fast, follow standards and sometimes break things with MicroProfile
is available for

Hosting Web Components on Amazon S3

Static assets like e.g. html,css or JavaScript files can be directly deployed to Amazon S3 with the AWS Cloud Development Kit (CDK) in Java.

You will have to create the S3 bucket first:


public class CDKStack extends Stack {

public CDKStack(final Construct scope, final String id, final StackProps props) {
    super(scope, id, props);

    var bucket = Bucket.Builder.create(this, id+"-bucket").
                    bucketName("wc-on-s3-with-airhacks").
                    publicReadAccess(true).
                    websiteIndexDocument("index.html").
                build();

...and then deploy the website from a folder:


    BucketDeployment.Builder.create(this, id+"-deployment").
        sources(List.of(Source.asset("./website/src/"))).
        destinationBucket(bucket).
    build();

The website's URL becomes available after a successful deployment: mvn package && cdk deploy with the following output:


CfnOutput.Builder.create(this, id + "-url").value(bucket.getBucketWebsiteUrl()).build();

In a production system, you could use AWS CloudFront for global caching. The SSL certificate is available via AWS ACM, and a nicer domain name can be registered and configured with AWS Route 53.

The example website in the screencast was taken from: github.com/AdamBien/bce.design and the "streamlined CDK starter" is available from: github.com/AdamBien/aws-cdk-plain.

See it in action:

A Serial Duke Choice Award Winner--an airhacks.fm podcast

Subscribe to airhacks.fm podcast via: spotify| iTunes| RSS

The #148 airhacks.fm episode with Mohamed Taman (@_tamanm) about:
early serverside Java, mission critical projects with Java EE, Jakarta EE and MicroProfile for United Nations and eFinance, and the Duke Choice Awards
is available for

Infrastructure as Java Code (IaJC): Setting AWS System Manager Parameter

Static assets like e.g. html,css or JavaScript files can be directly deployed to Amazon S3 with the AWS Cloud Development Kit (CDK) in Java.

You will have to create the S3 bucket first:


public class CDKStack extends Stack {

public CDKStack(final Construct scope, final String id, final StackProps props) {
    super(scope, id, props);

    var bucket = Bucket.Builder.create(this, id+"-bucket").
                    bucketName("wc-on-s3-with-airhacks").
                    publicReadAccess(true).
                    websiteIndexDocument("index.html").
                build();

...and then deploy the website from a folder:


    BucketDeployment.Builder.create(this, id+"-deployment").
        sources(List.of(Source.asset("./website/src/"))).
        destinationBucket(bucket).
    build();

The website's URL becomes available after a successful deployment: mvn package && cdk deploy with the following output:


CfnOutput.Builder.create(this, id + "-url").value(bucket.getBucketWebsiteUrl()).build();

In a production system, you could use AWS CloudFront for global caching. The SSL certificate is available via AWS ACM, and a nicer domain name created with AWS Route 53.

The example website in the screencast is: github.com/AdamBien/bce.design and the "streamlined CDK starter" github.com/AdamBien/aws-cdk-plain:

See it in action:

Why are you not using [the language of the year] instead of Java?

Over the years, I get asked frequently: "Why are you not using [the language of the year] instead of Java?" At my very first serverside project, I had to justify myself for using Java instead of Perl. In the early Java years, I got frequent questions about whether we should switch to Python, later Jython.

I collected the languages for the question Why are you not using (...) instead of Java? in chronological order:

  1. Perl (~1994)
  2. python (~1995)
  3. jython (~1997)
  4. Groovy (~2004)
  5. Scala (~2004+)
  6. Ruby on Rails / jRuby (~2006)
  7. CoffeeScript (~2010)
  8. Ceylon (~2011)
  9. Clojure (~2012)
  10. Dart (~2013)
  11. TypeScript (~2014+)
  12. Kotlin (2017+)

Because of the high project workload, I never managed to learn anything else than Java and JavaScript. Therefore we never had to migrate to anything else. However, if I had to pick one language from the list above, I guess Python would be the most useful one to know.

I'm already curious about the next programming language of the year 2021+.

Maybe it is going to be the compact and expressive COW-language (2006 blog post)?

Accessing AWS Systems Manager / Parameter Store's Configuration from Quarkus

The Parameter Store is part of the AWS Systems Manager (SSM) and provides a centralized store to manage your configuration data, whether plain-text data such as database strings or secrets such as passwords.

Quarkus ships with SSM Client which provides access to SSM:

The SSM was accessed in the JAX-RS resource:


import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import software.amazon.awssdk.services.ssm.SsmClient;
import software.amazon.awssdk.services.ssm.model.GetParameterRequest;

@Path("/hello")
public class GreetingResource {

@Inject
SsmClient client;

@GET
@Produces(MediaType.TEXT_PLAIN)
public String hello() {
    var req = GetParameterRequest.builder().name("greetings").build();
    return this.client.getParameter(req).parameter().value();
    }
}
Configuration (local development, remote cloud access)

application.properties:


quarkus.ssm.aws.region=eu-central-1
quarkus.ssm.aws.credentials.profile-provider.profile-name=default

The credentials were maintained in ~/.aws/credentials:


[default]
aws_access_key_id = ACCESKEYF435AERf4
aws_secret_access_key = secretpui8mnlkuasdfeaxae534

Additional dependencies:


<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-amazon-ssm</artifactId>
</dependency>
<dependency>
    <groupId>software.amazon.awssdk</groupId>
    <artifactId>url-connection-client</artifactId>
</dependency>

A Soldering, Agile, Geek Lawyer using Java and Quarkus--an airhacks.fm podcast

Subscribe to airhacks.fm podcast via: spotify| iTunes| RSS

The #147 airhacks.fm episode with Lawrence R. Peterson about:
soldering computers, automating a law firm, CourtOverflowException, Pascal, C, C++, Java, and Quarkus / AWS cloud migrations
is available for

Serverless, RESTful Searches, Jakarta EE Servers, AWS, Continuous Testing, Siemens Airhook and Continuous Testing with Quarkus--or 88th airhacks.tv

The 88th airhacks.tv (and the second from https://youtube.com/c/bienadam/):

"Clouds, Serverless, RESTful Searches, Jakarta EE Servers, Security Exceptions, AWS, Continuous Testing, Siemens Airhook and Continuous Testing with Quarkus"
is available:

See you every first Monday of the month at https://airhacks.tv 8pm CET (UTC+1:00).

Show is also announced at: meetup.com/airhacks.

Any questions left? Ask now: https://gist.github.com/AdamBien/69e6531c873f03ed449e840d04b265ba and get the answers at the next airhacks.tv.

J4K 2021: The Future is Now: Overview of Next Generation Cloud Java Runtimes

Live from "A Virtual Conference for Java Developers on Kubernetes", j4k.io, with the abstract:

"In recent years, Java runtimes started to optimize their behavior for the clouds. The complexity shifted from runtime to build time. In this session, I will explain the "Boring APIs, Kickass Runtime" approach of Helidon, Micronaut, Quarkus and Payara and the real-world impact on cloud deployments."

Clouds, Serverless, RESTful Searches, Jakarta EE Servers, Security Exceptions, Continuous Testing and Siemens Airhook--or 88th airhacks.tv

The questions and topics: https://gist.github.com/AdamBien/8b2b52ca341285c15de7d4a9257f3f54 for the 88th airhacks.tv live on youtube https://www.youtube.com/c/bienadam/live:

  1. Mid-Year 2021+ Observations and Predictions
  2. the serverless Siemens Airhook:
  3. Clouds, serverless and distributed computing
  4. AWS Graviton and Helidon
  5. Quarkus, Helidon, Micronaut vs. classic Jakarta EE Application Servers in the clouds
  6. Throwing authentication exceptions
  7. REST-ful searches
  8. Continuous Testing with Quarkus [blog comment]

Online Workshops
...the last 150 posts
...the last 10 comments
License