Skip to content

jexxa-projects/Jexxa

Repository files navigation

Maven Central License

CodeQL Codacy Badge Quality Gate Status Java 17 LTS CI

Jexxa—A Ports and Adapters Framework for Java

Jexxa is a lightweight framework to simplify the implementation of durable business applications using Domain Driven Design. It is no general purpose framework such as Spring. Instead, it focuses on the separation of your bounded contexts using microservices with a ports and adapters (aka hexagonal) architecture.

Jexxa stresses the following aspects in particular:

  • Technology-agnostic: The framework is designed to avoid technology-specific dependencies in your domain core. See here for more information.
  • Visible flow of control: Simplified navigation through your business application. Checkout this tutorial for more information.
  • Aligned team development: The framework is tailored to the needs and development of teams developing business applications. See Jexxa's General Design Decisions for more information.

In addition, Jexxa offers the following production-proven features:

  • Integrated driving and driven adapters: RMI over REST, JMS, JDBC, in memory DB (IMDB).
  • Integrated resilient microservice patterns such as transactional outbox.
  • Integrated architectural tests to validate ports and adapters rules, pattern consistency, and pattern language.

General information

Built With

Apart from some other great open source libraries, Jexxa mainly utilises the following libraries and frameworks:

Quickstart

Start programming

Below, you see a simple Hello World example that is described in detail here:

public final class HelloJexxa
{
    // Our business logic ;-)
    public String greetings()                 { return "Hello Jexxa"; }

    public static void main(String[] args)    {
        //Create your jexxaMain for this application
        var jexxaMain = new JexxaMain(HelloJexxa.class);

        jexxaMain
                // Bind a REST adapter to expose parts of the application
                // Get greetings: http://localhost:7501/HelloJexxa/greetings
                .bind(RESTfulRPCAdapter.class).to(HelloJexxa.class)  
                  
                // Run Jexxa and all bindings until Ctrl-C is pressed
                .run();
    }
}

Add Dependencies

Whenever possible, Jexxa is developed against standard APIs. This allows a business application to use the preferred technology stacks. Therefore, our HelloJexxa application needs two dependencies: jexxa-web and a logger that fulfills your requirements, such as slf4j-simple.

Maven:

<dependencies>
    <dependency>
       <groupId>io.jexxa</groupId>
       <artifactId>jexxa-web</artifactId>
       <version>8.0.1</version>
    </dependency>
    
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>2.0.13</version>
    </dependency>
</dependencies>

Gradle:

compile "io.jexxa:jexxa-web:8.0.1"
compile "org.slf4j:slf4j-simple:2.0.13"

Configure your Jexxa application

By default, a Jexxa application looks for the following properties file. For more information, please refer to the reference guide.

resources/jexxa-application.properties

Available properties are described here.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Copyright and license

Code and documentation copyright 2020–2024 Michael Repplinger. Code released under the Apache 2.0 License(see TLDR legal for details). Docs released under Creative Commons.