Skip to content

Commit

Permalink
GH-??? - Initial prototype to automatically externalize events.
Browse files Browse the repository at this point in the history
We now provide an SPI to plug custom implementations to externalize events that match an EventExternalizationConfiguration (EEC) into messaging technology. The first implementation of that API is based on Spring Kafka to consume a KafkaTemplate and translate events into Kafka messages.
  • Loading branch information
odrotbohm committed Jul 18, 2023
1 parent 6211ad4 commit 990d800
Show file tree
Hide file tree
Showing 30 changed files with 1,340 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright 2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.modulith;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.core.annotation.AliasFor;

/**
* Marks domain events as to be externalized.
*
* @author Oliver Drotbohm
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.TYPE })
public @interface Externalized {

/**
* The logical target name. Will default to a strategy defined by configuration if empty.
*
* @return
* @see #target()
*/
@AliasFor("target")
String value() default "";

/**
* The logical target name. Will default to a strategy defined by configuration if empty.
*
* @return
* @see #value()
*/
@AliasFor("value")
String target() default "";
}
2 changes: 2 additions & 0 deletions spring-modulith-events/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
<name>Spring Modulith - Events</name>

<modules>
<module>spring-modulith-events-api</module>
<module>spring-modulith-events-core</module>
<module>spring-modulith-events-jpa</module>
<module>spring-modulith-events-jdbc</module>
<module>spring-modulith-events-mongodb</module>
<module>spring-modulith-events-jackson</module>
<module>spring-modulith-events-kafka</module>
</modules>

<profiles>
Expand Down
35 changes: 35 additions & 0 deletions spring-modulith-events/spring-modulith-events-api/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.springframework.modulith</groupId>
<artifactId>spring-modulith-events</artifactId>
<version>1.1.0-SNAPSHOT</version>
</parent>

<name>Spring Modulith - Events - API</name>
<artifactId>spring-modulith-events-api</artifactId>

<properties>
<module.name>org.springframework.modulith.events.api</module.name>
</properties>

<dependencies>

<dependency>
<groupId>org.springframework.modulith</groupId>
<artifactId>spring-modulith-api</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>

</dependencies>

</project>
Loading

0 comments on commit 990d800

Please sign in to comment.