Skip to content

Commit 5e6da51

Browse files
authored
Merge branch 'master' into feat/document-headers-method-level-protocol-listeners
2 parents 17e405a + 3876881 commit 5e6da51

File tree

58 files changed

+1273
-47
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1273
-47
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: springwolf-bindings
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types: [ opened, synchronize, ready_for_review ]
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 10
15+
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
binding: [ "googlepubsub", "sns", "sqs" ]
20+
21+
env:
22+
binding: springwolf-bindings/springwolf-${{ matrix.binding }}-binding
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Set up JDK
28+
uses: actions/setup-java@v4
29+
with:
30+
distribution: 'temurin'
31+
java-version: '17'
32+
33+
- name: Setup Gradle
34+
uses: gradle/actions/setup-gradle@v3
35+
36+
- name: Check formatting (before running tests) on binding
37+
run: ./gradlew -p ${{ env.binding }} spotlessCheck
38+
39+
- name: Run unit tests
40+
run: ./gradlew -p ${{ env.binding }} test
41+
42+
- name: Run build, check, analyzeDependencies on binding
43+
run: ./gradlew -p ${{ env.binding }} build
44+
45+
- name: Publish package
46+
if: github.ref == 'refs/heads/master'
47+
run: ./gradlew -p ${{ env.binding }} publish
48+
env:
49+
ORG_GRADLE_PROJECT_SNAPSHOT: true
50+
51+
ORG_GRADLE_PROJECT_SIGNINGKEY: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGKEY}}
52+
ORG_GRADLE_PROJECT_SIGNINGPASSWORD: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD}}
53+
54+
ORG_GRADLE_PROJECT_MAVEN_URL: https://s01.oss.sonatype.org/content/repositories/snapshots/
55+
ORG_GRADLE_PROJECT_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
56+
ORG_GRADLE_PROJECT_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ springwolf-add-ons/build/
44
springwolf-core/build/
55
springwolf-examples/build/
66
springwolf-plugins/build/
7+
springwolf-bindings/build/
78
springwolf-ui/build/
89
springwolf-add-ons/springwolf-common-model-converters/build/
910
springwolf-examples/springwolf-amqp-example/build/
@@ -14,6 +15,7 @@ springwolf-plugins/springwolf-amqp-plugin/build/
1415
springwolf-plugins/springwolf-cloud-stream-plugin/build/
1516
springwolf-plugins/springwolf-kafka-plugin/build/
1617
springwolf-plugins/springwolf-sqs-plugin/build/
18+
springwolf-bindings/springwolf-sqs-binding/build/
1719

1820
.gradle/
1921
.idea/

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,20 @@ More details in the documentation.
7575
| [Kafka](https://github.com/springwolf/springwolf-core/tree/master/springwolf-plugins/springwolf-kafka-plugin) | [Kafka Example](https://github.com/springwolf/springwolf-core/tree/master/springwolf-examples/springwolf-kafka-example) | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-kafka?color=green&label=springwolf-kafka&style=plastic) | ![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/io.github.springwolf/springwolf-kafka?label=springwolf-kafka&server=https%3A%2F%2Fs01.oss.sonatype.org&style=plastic) |
7676

7777
<details>
78-
<summary>Click to expand all artifacts and add-ons</summary>
78+
<summary>Click to expand all artifacts, bindings and add-ons</summary>
7979

8080
| Artifact | Current version | SNAPSHOT version |
8181
|----------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
8282
| [AsyncAPI implementation](https://github.com/springwolf/springwolf-core/tree/master/springwolf-asyncapi) | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-asyncapi?color=green&label=springwolf-asyncapi&style=plastic) | ![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/io.github.springwolf/springwolf-asyncapi?label=springwolf-asyncapi&server=https%3A%2F%2Fs01.oss.sonatype.org&style=plastic) |
8383
| [Core](https://github.com/springwolf/springwolf-core/tree/master/springwolf-core) | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-core?color=green&label=springwolf-core&style=plastic) | ![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/io.github.springwolf/springwolf-core?label=springwolf-core&server=https%3A%2F%2Fs01.oss.sonatype.org&style=plastic) |
8484
| [UI](https://github.com/springwolf/springwolf-core/tree/master/springwolf-ui) | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-ui?color=green&label=springwolf-ui&style=plastic) | ![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/io.github.springwolf/springwolf-ui?label=springwolf-ui&server=https%3A%2F%2Fs01.oss.sonatype.org&style=plastic) |
8585

86+
| Bindings | Current version | SNAPSHOT version |
87+
|-------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
88+
| [AWS SNS Binding](https://github.com/springwolf/springwolf-core/tree/master/springwolf-bindings/springwolf-sns-binding) | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-sns-binding?color=green&label=springwolf-sns-binding&style=plastic) | ![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/io.github.springwolf/springwolf-sns-binding?label=springwolf-sns-binding&server=https%3A%2F%2Fs01.oss.sonatype.org&style=plastic) |
89+
| [AWS SQS Binding](https://github.com/springwolf/springwolf-core/tree/master/springwolf-bindings/springwolf-sqs-binding) | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-sqs-binding?color=green&label=springwolf-sqs-binding&style=plastic) | ![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/io.github.springwolf/springwolf-sqs-binding?label=springwolf-sqs-binding&server=https%3A%2F%2Fs01.oss.sonatype.org&style=plastic) |
90+
91+
8692
| Add-on | Current version | SNAPSHOT version |
8793
|-------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
8894
| [Common Model Converter](https://github.com/springwolf/springwolf-core/tree/master/springwolf-add-ons/springwolf-common-model-converters) | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-common-model-converters?color=green&label=springwolf-common-model-converters&style=plastic) | ![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/io.github.springwolf/springwolf-common-model-converters?label=springwolf-common-model-converters&server=https%3A%2F%2Fs01.oss.sonatype.org&style=plastic) |

dependencies.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ext {
3131

3232
avroVersion = '1.11.3'
3333

34-
awaitilityVersion = '4.2.0'
34+
awaitilityVersion = '4.2.1'
3535

3636
commonsLang3Version = '3.14.0'
3737

@@ -40,12 +40,12 @@ ext {
4040
kafkaAvroSerializerVersion = '7.6.0'
4141

4242
kafkaClientsVersion = '3.6.1'
43-
kafkaStreamsVersion = '3.6.1'
43+
kafkaStreamsVersion = '3.7.0'
4444

4545
kafkaProtobufSerializerVersion = '7.6.0'
4646

4747
jacksonVersion = '2.16.2'
48-
jacksonDatatypeProtobufVersion = '0.9.14'
48+
jacksonDatatypeProtobufVersion = '0.9.15'
4949

5050
jakartaAnnotationApiVersion = '2.1.1'
5151
jakartaValidationApiVersion = '3.0.2'

settings.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
rootProject.name = 'springwolf-core'
1+
rootProject.name = 'springwolf'
22

33
include(
44
'springwolf-asyncapi',
@@ -15,6 +15,9 @@ include(
1515
'springwolf-examples:springwolf-kafka-example',
1616
'springwolf-examples:springwolf-sns-example',
1717
'springwolf-examples:springwolf-sqs-example',
18+
'springwolf-bindings:springwolf-sns-binding',
19+
'springwolf-bindings:springwolf-sqs-binding',
20+
'springwolf-bindings:springwolf-googlepubsub-binding',
1821
'springwolf-ui',
1922
'springwolf-add-ons:springwolf-common-model-converters',
2023
'springwolf-add-ons:springwolf-generic-binding',
@@ -27,3 +30,4 @@ project(':springwolf-plugins:springwolf-jms-plugin').name = 'springwolf-jms'
2730
project(':springwolf-plugins:springwolf-kafka-plugin').name = 'springwolf-kafka'
2831
project(':springwolf-plugins:springwolf-sns-plugin').name = 'springwolf-sns'
2932
project(':springwolf-plugins:springwolf-sqs-plugin').name = 'springwolf-sqs'
33+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
plugins {
2+
id 'java-library'
3+
4+
id 'org.springframework.boot'
5+
id 'io.spring.dependency-management'
6+
id 'ca.cutterslade.analyze'
7+
}
8+
9+
dependencies {
10+
api project(":springwolf-asyncapi")
11+
api project(":springwolf-core")
12+
13+
implementation "org.springframework:spring-context"
14+
implementation "org.springframework:spring-core"
15+
implementation "org.springframework.boot:spring-boot-autoconfigure"
16+
17+
implementation "org.apache.commons:commons-lang3:${commonsLang3Version}"
18+
19+
testImplementation "org.assertj:assertj-core:${assertjCoreVersion}"
20+
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}"
21+
22+
testRuntimeOnly "org.junit.jupiter:junit-jupiter:${junitJupiterVersion}"
23+
}
24+
25+
jar {
26+
enabled = true
27+
archiveClassifier = ''
28+
}
29+
bootJar.enabled = false
30+
31+
java {
32+
withJavadocJar()
33+
withSourcesJar()
34+
}
35+
36+
publishing {
37+
publications {
38+
mavenJava(MavenPublication) {
39+
pom {
40+
name = 'springwolf-googlepubsub-binding'
41+
description = 'Automated JSON API documentation for Google PubSub Bindings'
42+
}
43+
}
44+
}
45+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
package io.github.springwolf.bindings.googlepubsub.annotations;
3+
4+
import java.lang.annotation.ElementType;
5+
import java.lang.annotation.Inherited;
6+
import java.lang.annotation.Retention;
7+
import java.lang.annotation.RetentionPolicy;
8+
import java.lang.annotation.Target;
9+
10+
/**
11+
* {@code @GooglePubSubAsyncChannelBinding} is a method-level annotation.
12+
* It configures the channel binding for the Google pubsub protocol.
13+
* @see io.github.springwolf.asyncapi.v3.bindings.googlepubsub.GooglePubSubChannelBinding
14+
*/
15+
@Retention(RetentionPolicy.RUNTIME)
16+
@Target(value = {ElementType.METHOD, ElementType.ANNOTATION_TYPE})
17+
@Inherited
18+
public @interface GooglePubSubAsyncChannelBinding {
19+
String type() default "googlepubsub";
20+
21+
String messageRetentionDuration() default "";
22+
23+
GooglePubsubAsyncMessageStoragePolicy messageStoragePolicy() default @GooglePubsubAsyncMessageStoragePolicy;
24+
25+
GooglePubSubAsyncSchemaSetting schemaSettings();
26+
27+
String bindingVersion() default "0.2.0";
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
package io.github.springwolf.bindings.googlepubsub.annotations;
3+
4+
import io.github.springwolf.asyncapi.v3.bindings.googlepubsub.GooglePubSubSchemaSettings;
5+
6+
import java.lang.annotation.ElementType;
7+
import java.lang.annotation.Inherited;
8+
import java.lang.annotation.Retention;
9+
import java.lang.annotation.RetentionPolicy;
10+
import java.lang.annotation.Target;
11+
12+
/**
13+
* @see GooglePubSubSchemaSettings
14+
*/
15+
@Retention(RetentionPolicy.RUNTIME)
16+
@Target(value = {ElementType.METHOD})
17+
@Inherited
18+
public @interface GooglePubSubAsyncSchemaSetting {
19+
/**
20+
* Mapped to {@link GooglePubSubSchemaSettings#getEncoding()}
21+
*/
22+
String encoding() default "";
23+
24+
/**
25+
* Mapped to {@link GooglePubSubSchemaSettings#getName()}
26+
*/
27+
String name() default "";
28+
29+
/**
30+
* Mapped to {@link GooglePubSubSchemaSettings#getFirstRevisionId()}
31+
*/
32+
String firstRevisionId() default "";
33+
34+
/**
35+
* Mapped to {@link GooglePubSubSchemaSettings#getLastRevisionId()}
36+
*/
37+
String lastRevisionId() default "";
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
package io.github.springwolf.bindings.googlepubsub.annotations;
3+
4+
import java.lang.annotation.ElementType;
5+
import java.lang.annotation.Inherited;
6+
import java.lang.annotation.Retention;
7+
import java.lang.annotation.RetentionPolicy;
8+
import java.lang.annotation.Target;
9+
10+
@Retention(RetentionPolicy.RUNTIME)
11+
@Target(value = {ElementType.METHOD, ElementType.ANNOTATION_TYPE})
12+
@Inherited
13+
public @interface GooglePubsubAsyncMessageStoragePolicy {
14+
String[] allowedPersistenceRegions() default {};
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
package io.github.springwolf.bindings.googlepubsub.configuration;
3+
4+
import io.github.springwolf.bindings.googlepubsub.scanners.channels.GooglePubSubChannelBindingProcessor;
5+
import io.github.springwolf.core.asyncapi.scanners.bindings.BindingProcessorPriority;
6+
import io.github.springwolf.core.configuration.properties.SpringwolfConfigConstants;
7+
import org.springframework.boot.autoconfigure.AutoConfiguration;
8+
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
9+
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
10+
import org.springframework.context.annotation.Bean;
11+
import org.springframework.core.annotation.Order;
12+
13+
/**
14+
* Autoconfiguration for the springwolf Google PubSub Binding.
15+
*/
16+
@AutoConfiguration
17+
@ConditionalOnProperty(name = SpringwolfConfigConstants.SPRINGWOLF_ENABLED, havingValue = "true", matchIfMissing = true)
18+
public class SpringwolfGooglePubSubBindingAutoConfiguration {
19+
20+
@Bean
21+
@Order(value = BindingProcessorPriority.PROTOCOL_BINDING)
22+
@ConditionalOnMissingBean
23+
public GooglePubSubChannelBindingProcessor googlePubSubChannelBindingProcessor() {
24+
return new GooglePubSubChannelBindingProcessor();
25+
}
26+
}

0 commit comments

Comments
 (0)