-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from SolaceLabs/tracing
Client Side Tracing & OAuth implementation
- Loading branch information
Showing
41 changed files
with
7,019 additions
and
47 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
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
128 changes: 128 additions & 0 deletions
128
integration-tests/solace-client-oauth-integration-tests/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,128 @@ | ||
<?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"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.solace.quarkus</groupId> | ||
<artifactId>quarkus-solace-integration-tests-parent</artifactId> | ||
<version>${revision}${sha1}${changelist}</version> | ||
</parent> | ||
|
||
<artifactId>solace-client-oauth-integration-tests</artifactId> | ||
<name>Quarkus Solace Client - OAuth Integration Tests</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-resteasy-reactive-jackson</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.solace.quarkus</groupId> | ||
<artifactId>quarkus-solace-client</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-smallrye-health</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-junit5</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.testcontainers</groupId> | ||
<artifactId>testcontainers</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.rest-assured</groupId> | ||
<artifactId>rest-assured</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.awaitility</groupId> | ||
<artifactId>awaitility</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<version>3.24.2</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>build</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>test-jar</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<id>native-image</id> | ||
<activation> | ||
<property> | ||
<name>native</name> | ||
</property> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<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> |
60 changes: 60 additions & 0 deletions
60
...olace-client-oauth-integration-tests/src/main/java/com/solace/quarkus/SolaceConsumer.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,60 @@ | ||
package com.solace.quarkus; | ||
|
||
import java.util.List; | ||
import java.util.concurrent.CopyOnWriteArrayList; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.enterprise.event.Observes; | ||
|
||
import com.solace.messaging.MessagingService; | ||
import com.solace.messaging.config.MissingResourcesCreationConfiguration; | ||
import com.solace.messaging.receiver.DirectMessageReceiver; | ||
import com.solace.messaging.receiver.PersistentMessageReceiver; | ||
import com.solace.messaging.resources.Queue; | ||
import com.solace.messaging.resources.TopicSubscription; | ||
|
||
import io.quarkus.runtime.ShutdownEvent; | ||
|
||
@ApplicationScoped | ||
public class SolaceConsumer { | ||
|
||
private final DirectMessageReceiver directReceiver; | ||
private final PersistentMessageReceiver persistentReceiver; | ||
List<String> direct = new CopyOnWriteArrayList<>(); | ||
List<String> persistent = new CopyOnWriteArrayList<>(); | ||
|
||
public SolaceConsumer(MessagingService solace) { | ||
directReceiver = solace.createDirectMessageReceiverBuilder() | ||
.withSubscriptions(TopicSubscription.of("hello/direct")) | ||
.build().start(); | ||
persistentReceiver = solace.createPersistentMessageReceiverBuilder() | ||
.withMissingResourcesCreationStrategy( | ||
MissingResourcesCreationConfiguration.MissingResourcesCreationStrategy.CREATE_ON_START) | ||
.withSubscriptions(TopicSubscription.of("hello/persistent")) | ||
.build(Queue.durableExclusiveQueue("hello/persistent")).start(); | ||
|
||
directReceiver.receiveAsync(h -> consumeDirect(h.getPayloadAsString())); | ||
persistentReceiver.receiveAsync(h -> consumePersistent(h.getPayloadAsString())); | ||
} | ||
|
||
public void shutdown(@Observes ShutdownEvent event) { | ||
directReceiver.terminate(1); | ||
persistentReceiver.terminate(1); | ||
} | ||
|
||
public void consumeDirect(String message) { | ||
direct.add(message); | ||
} | ||
|
||
public void consumePersistent(String message) { | ||
persistent.add(message); | ||
} | ||
|
||
public List<String> direct() { | ||
return direct; | ||
} | ||
|
||
public List<String> persistent() { | ||
return persistent; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...ace-client-oauth-integration-tests/src/main/java/com/solace/quarkus/SolaceCustomizer.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 com.solace.quarkus; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
|
||
import com.solace.messaging.MessagingServiceClientBuilder; | ||
|
||
@ApplicationScoped | ||
public class SolaceCustomizer implements MessagingServiceClientCustomizer { | ||
@Override | ||
public MessagingServiceClientBuilder customize(MessagingServiceClientBuilder builder) { | ||
return builder; | ||
} | ||
} |
Oops, something went wrong.