Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Devoxx UK - Java Life is Short

Devoxx UK - Java Life is Short

Kevin Dubois

May 11, 2023
Tweet

More Decks by Kevin Dubois

Other Decks in Programming

Transcript

  1. @kevindubois #DevoxxUK
    Java, Life is Short!
    Kevin Dubois,
    Principal Developer Advocate, Red Hat

    View Slide

  2. @kevindubois #DevoxxUK
    Productivity
    & Developer Joy…
    with Open Source

    View Slide

  3. @kevindubois #DevoxxUK
    Disclaimer
    This is an opinionated talk. There are many ways and
    tools that can help you be more productive.
    This is a session about my personal experiences &
    recommendations.
    (And my firm belief that Quarkus is awesome :D )

    View Slide

  4. @kevindubois #DevoxxUK
    Kevin Dubois
    ● Developer Advocate at Red Hat
    ● 18+ years of experience writing and delivering software
    ● Speak English, Dutch, French, Italian
    ● Passionate about improving Dev Experience with Open Source
    @[email protected]
    youtube.com/@thekevindubois
    linkedin.com/in/kevindubois
    github.com/kdubois

    View Slide

  5. @kevindubois #DevoxxUK
    https://openjdk.org/projects/amber/ + https://openjdk.org/jeps/445

    View Slide

  6. @kevindubois #DevoxxUK
    $ javac HelloWorld.java
    $ java HelloWorld
    Hello World

    View Slide

  7. @kevindubois #DevoxxUK
    $ jbang init Main.java
    $ jbang Main.java
    https://jbang.dev

    View Slide

  8. @kevindubois #DevoxxUK
    $ jbang init --template=cli hello.java
    https://jbang.dev

    View Slide

  9. @kevindubois #DevoxxUK
    GPT
    jbang --preview init cat.java “Print a cat”
    jbang --preview init cli.java "create a currency converter"
    https://jbang.dev

    View Slide

  10. @kevindubois #DevoxxUK
    Managing multiple (Java) versions
    Legacy project running Java 8
    “Newer projects”: Java 11
    “State of the art”: Java 17
    “Experimentation”: Java 20/21
    Vendor supported: Java 17
    GraalVM: 22

    View Slide

  11. @kevindubois #DevoxxUK
    https://sdkman.io
    sdk list java
    sdk install java 11.0.19-open
    sdk install java 17.0.6-tem
    sdk use java 17.0.6-tem
    ….
    sdk install maven
    sdk install jbang
    sdk upgrade jbang
    sdk install quarkus 3.0.1.Final

    View Slide

  12. @kevindubois #DevoxxUK
    Code.
    Compile.
    Deploy.
    Run & Test.
    Repeat.

    View Slide

  13. @kevindubois #DevoxxUK
    https://quarkus.io/get-started/

    View Slide

  14. @kevindubois #DevoxxUK
    https://testcontainers.org

    View Slide

  15. @kevindubois #DevoxxUK
    Dev Services
    https://quarkus.io/guides/dev-services

    View Slide

  16. @kevindubois #DevoxxUK
    Developer Flow
    Outer
    loop
    Inner
    loop
    Pull/Merge Request
    Production
    Build /
    Package
    Code
    Push
    Debug
    Code
    Review Build
    Deploy
    Security
    Tests
    Compliance
    Inner loop Outer loop
    Developer
    Test

    View Slide

  17. @kevindubois #DevoxxUK
    Containers!
    Cloud!
    Kubernetes!
    Serverless!

    View Slide

  18. @kevindubois #DevoxxUK

    View Slide

  19. @kevindubois #DevoxxUK
    quarkus image build

    https://www.kevindubois.com/2023/04/25/build-java-container-images-in-seconds-using-quarkus-cli/
    podman-desktop.io

    View Slide

  20. @kevindubois #DevoxxUK
    Deploying

    View Slide

  21. @kevindubois #DevoxxUK
    https://developers.redhat.com/developer-sandbox

    View Slide

  22. @kevindubois #DevoxxUK
    apiVersion: v1
    kind: Service
    metadata:
    name: code-with-quarkus
    spec:
    ports:
    - name: https
    port: 443
    protocol: TCP
    targetPort: 8443
    - name: http
    port: 80
    protocol: TCP
    targetPort: 8080
    selector:
    app.kubernetes.io/name:
    code-with-quarkus
    app.kubernetes.io/version:
    1.0.0-SNAPSHOT
    type: ClusterIP
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    name: code-with-quarkus
    spec:
    replicas: 1
    selector:
    matchLabels:
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
    app.kubernetes.io/name: code-with-quarkus
    template:
    spec:
    containers:
    - env:
    - name: KUBERNETES_NAMESPACE
    valueFrom:
    fieldRef:
    fieldPath: metadata.namespace
    image: quay.io/kevindubois/code-with-quarkus:1.0.0
    imagePullPolicy: Always
    name: code-with-quarkus
    ports:
    - containerPort: 8080
    name: http
    protocol: TCP
    - containerPort: 8443
    name: https
    protocol: TCP
    serviceAccountName: code-with-quarkus

    View Slide

  23. @kevindubois #DevoxxUK
    $ quarkus extension add kubernetes
    $ quarkus deploy
    $ kn service create code-with-quarkus --image=quay.io/kevindubois/qwq:1.0

    View Slide

  24. @kevindubois #DevoxxUK
    https://microprofile.io/

    View Slide

  25. @kevindubois #DevoxxUK
    Release aftercare

    View Slide

  26. @kevindubois #DevoxxUK
    Observability

    View Slide

  27. @kevindubois #DevoxxUK
    https://opentelemetry.io/
    https://github.com/kdubois/quarkus-observability

    View Slide

  28. @kevindubois #DevoxxUK
    Metrics
    https://micrometer.io/
    https://github.com/kdubois/quarkus-observability

    View Slide

  29. @kevindubois #DevoxxUK
    Releasing Distributed Apps

    View Slide

  30. @kevindubois #DevoxxUK
    JReleaser
    https://jreleaser.org
    https://github.com/kdubois/quarkus-jreleaser

    View Slide

  31. @kevindubois #DevoxxUK
    project :
    name: quarkus-knative
    version : 1.0.0-SNAPSHOT
    description : Quarkus Knative Demo App
    longDescription : Demo App demonstrating using Quarkus with Knative
    authors :
    - Kevin Dubois
    license : Apache-2.0
    links:
    homepage : https://github.com/kdubois/quarkus-knative
    java:
    groupId : com.redhat.developer.demo
    version : 17
    artifactId : quarked
    inceptionYear : 2023
    release :
    github:
    overwrite : true
    changelog :
    formatted : ALWAYS
    preset: conventional-commits
    contributors :
    format: '- {{contributorName}}{{#contributorUsernameAsLink}} ({{.}}){{/contributorUsernameAsLink}}'
    assemble :
    javaArchive :
    quarked :
    active: ALWAYS
    formats : [ ZIP ]
    fileSets :
    - input: '.'
    includes : [ 'LICENSE' ]
    mainJar :
    path: target/{{distributionName}}-{{projectVersion}}-runner.jar

    View Slide

  32. @kevindubois #DevoxxUK
    jreleaser init
    jreleaser assemble
    jreleaser full-release
    https://jreleaser.org
    https://github.com/kdubois/quarkus-jreleaser
    ./mvnw -Pnative,dist package
    ./mvnw -Prelease jreleaser:full-release -Djreleaser.select.current.platform

    View Slide

  33. @kevindubois #DevoxxUK

    View Slide

  34. @kevindubois #DevoxxUK
    Start exploring in the OpenShift Sandbox.
    Learn containers, Kubernetes, and OpenShift in your browser.
    developers.redhat.com/developer-sandbox
    Try Red Hat's products and technologies
    without setup or configuration.

    View Slide

  35. @kevindubois #DevoxxUK
    https://red.ht/modernize-enterprise-java

    View Slide

  36. @kevindubois #DevoxxUK
    https://speakerdeck.com/kdubois/devoxx-uk-java-life-is-short

    View Slide

  37. @kevindubois #DevoxxUK
    Thank you!
    @[email protected]
    youtube.com/@thekevindubois
    linkedin.com/in/kevindubois
    github.com/kdubois
    Don’t forget to rate this session :)
    🙏

    View Slide