-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00255f7
commit 049131a
Showing
11 changed files
with
357 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
integration-tests/smallrye-reactive-messaging-pubsub/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#Maven | ||
target/ | ||
pom.xml.tag | ||
pom.xml.releaseBackup | ||
pom.xml.versionsBackup | ||
release.properties | ||
# Eclipse | ||
.project | ||
.classpath | ||
.settings/ | ||
bin/ | ||
|
||
# IntelliJ | ||
.idea | ||
*.ipr | ||
*.iml | ||
*.iws | ||
|
||
# NetBeans | ||
nb-configuration.xml | ||
|
||
# Visual Studio Code | ||
.vscode | ||
.factorypath | ||
|
||
# OSX | ||
.DS_Store | ||
|
||
# Vim | ||
*.swp | ||
*.swo | ||
|
||
# patch | ||
*.orig | ||
*.rej | ||
|
28 changes: 28 additions & 0 deletions
28
integration-tests/smallrye-reactive-messaging-pubsub/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Quarkiverse - Google Cloud Services - Integration Tests - Smallrye Reactive Messaging PubSub | ||
|
||
**WARNING: this extension is experimental and rely on the experimental | ||
[smallrye-reactive-messaging-gcp-pubsub](https://github.com/smallrye/smallrye-reactive-messaging/tree/master/smallrye-reactive-messaging-gcp-pubsub) | ||
extension.** | ||
|
||
To test it you first need to create a topic named `test-topic` | ||
|
||
You can create one with `gcloud`: | ||
|
||
``` | ||
gcloud pubsub topics create test-topic | ||
``` | ||
|
||
As PubSub mandates the usage of the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to define its credentials, | ||
you need to set this one instead of relying on the `quarkus.google.cloud.service-account-location` property. | ||
|
||
``` | ||
export GOOGLE_APPLICATION_CREDENTIALS=<your-service-account-file> | ||
``` | ||
|
||
You can then use `gcloud` to send a message to the topic: | ||
|
||
``` | ||
gcloud pubsub topics publish test-topic --message SGVsbG8gV29ybGQ= | ||
``` | ||
|
||
NOTE: `SGVsbG8gV29ybGQ=` is `Hello World` in BASE64. |
102 changes: 102 additions & 0 deletions
102
integration-tests/smallrye-reactive-messaging-pubsub/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<?xml version="1.0"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<parent> | ||
<groupId>io.quarkiverse.googlecloudservices</groupId> | ||
<artifactId>quarkus-google-cloud-services-integration-tests-parent</artifactId> | ||
<version>0.12.0-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>quarkus-google-cloud-services-smallrye-reactive-messaging-pubsub-it</artifactId> | ||
<name>Quarkus - Google Cloud Services - Integration Tests - Smallrye Reactive messaging Pub/Sub</name> | ||
|
||
<properties> | ||
<native.surefire.skip>${skipTests}</native.surefire.skip> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkiverse.googlecloudservices</groupId> | ||
<artifactId>smallrye-reactive-messaging-pubsub</artifactId> | ||
<version>0.12.0-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-arc</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-junit5</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-maven-plugin</artifactId> | ||
<version>${quarkus.version}</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>build</goal> | ||
<goal>generate-code</goal> | ||
<goal>generate-code-tests</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>${compiler-plugin.version}</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<systemPropertyVariables> | ||
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager> | ||
<maven.home>${maven.home}</maven.home> | ||
</systemPropertyVariables> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<profiles> | ||
<profile> | ||
<id>native</id> | ||
<activation> | ||
<property> | ||
<name>native</name> | ||
</property> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<version>${surefire-plugin.version}</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>integration-test</goal> | ||
<goal>verify</goal> | ||
</goals> | ||
<configuration> | ||
<systemPropertyVariables> | ||
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path> | ||
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager> | ||
<maven.home>${maven.home}</maven.home> | ||
</systemPropertyVariables> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<properties> | ||
<quarkus.package.type>native</quarkus.package.type> | ||
</properties> | ||
</profile> | ||
</profiles> | ||
</project> |
12 changes: 12 additions & 0 deletions
12
...va/io/quarkiverse/googlecloudservices/smallrye/reactivemessaging/pubsub/it/TestTopic.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.quarkiverse.googlecloudservices.smallrye.reactivemessaging.pubsub.it; | ||
|
||
import java.util.Base64; | ||
|
||
import org.eclipse.microprofile.reactive.messaging.Incoming; | ||
|
||
public class TestTopic { | ||
@Incoming("my-topic") | ||
public void test(String str) { | ||
System.out.println("Receive => " + new String(Base64.getDecoder().decode(str))); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...ration-tests/smallrye-reactive-messaging-pubsub/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
gcp-pubsub-project-id=test-project | ||
|
||
# Google Cloud Pub/Sub source (we read from it) | ||
mp.messaging.incoming.my-topic.connector=smallrye-gcp-pubsub | ||
mp.messaging.incoming.my-topic.topic=test-topic | ||
mp.messaging.incoming.my-topic.subscription=test-topic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<groupId>io.quarkiverse.googlecloudservices</groupId> | ||
<artifactId>quarkus-smallrye-reactive-messaging-pubsub-parent</artifactId> | ||
<version>0.12.0-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>smallrye-reactive-messaging-pubsub-deployment</artifactId> | ||
<name>Quarkus - Google Cloud Services - Smallrye Reactive Messaging PubSub - Deployment</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-core-deployment</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkiverse.googlecloudservices</groupId> | ||
<artifactId>quarkus-google-cloud-pubsub-deployment</artifactId> | ||
<version>0.12.0-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkiverse.googlecloudservices</groupId> | ||
<artifactId>smallrye-reactive-messaging-pubsub</artifactId> | ||
<version>0.12.0-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-smallrye-reactive-messaging-deployment</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<annotationProcessorPaths> | ||
<path> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-extension-processor</artifactId> | ||
<version>${quarkus.version}</version> | ||
</path> | ||
</annotationProcessorPaths> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
13 changes: 13 additions & 0 deletions
13
...s/smallrye/reactivemessaging/pubsub/deployement/SmallryeReactiveMessagingPubsubSteps.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.quarkiverse.googlecloudservices.smallrye.reactivemessaging.pubsub.deployement; | ||
|
||
import io.quarkus.deployment.annotations.BuildStep; | ||
import io.quarkus.deployment.builditem.FeatureBuildItem; | ||
|
||
public class SmallryeReactiveMessagingPubsubSteps { | ||
private static final String FEATURE = "smallrye-reactive-messaging-pubsub"; | ||
|
||
@BuildStep | ||
public FeatureBuildItem feature() { | ||
return new FeatureBuildItem(FEATURE); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<groupId>io.quarkiverse.googlecloudservices</groupId> | ||
<artifactId>quarkus-google-cloud-services-parent</artifactId> | ||
<version>0.12.0-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>quarkus-smallrye-reactive-messaging-pubsub-parent</artifactId> | ||
<name>Quarkus - Google Cloud Services - Smallrye Reactive Messaging PubSub</name> | ||
<packaging>pom</packaging> | ||
|
||
<modules> | ||
<module>runtime</module> | ||
<module>deployment</module> | ||
</modules> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<groupId>io.quarkiverse.googlecloudservices</groupId> | ||
<artifactId>quarkus-smallrye-reactive-messaging-pubsub-parent</artifactId> | ||
<version>0.12.0-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>smallrye-reactive-messaging-pubsub</artifactId> | ||
<name>Quarkus - Google Cloud Services - Smallrye Reactive Messaging PubSub - Runtime</name> | ||
<description>Connect to PubSub with Reactive Messaging</description> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkiverse.googlecloudservices</groupId> | ||
<artifactId>quarkus-google-cloud-pubsub</artifactId> | ||
<version>0.12.0-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.smallrye.reactive</groupId> | ||
<artifactId>smallrye-reactive-messaging-gcp-pubsub</artifactId> | ||
<version>3.13.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-smallrye-reactive-messaging</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.smallrye.reactive</groupId> | ||
<artifactId>smallrye-reactive-messaging-provider</artifactId> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-core</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>javax.annotation</groupId> | ||
<artifactId>javax.annotation-api</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-bootstrap-maven-plugin</artifactId> | ||
<version>${quarkus.version}</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>extension-descriptor</goal> | ||
</goals> | ||
<phase>compile</phase> | ||
<configuration> | ||
<deployment>${project.groupId}:${project.artifactId}-deployment:${project.version} | ||
</deployment> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<annotationProcessorPaths> | ||
<path> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-extension-processor</artifactId> | ||
<version>${quarkus.version}</version> | ||
</path> | ||
</annotationProcessorPaths> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |