Skip to content

Commit

Permalink
Merge pull request #48 from ozangunalp/future_compatibility_quarkus_3.7
Browse files Browse the repository at this point in the history
Ensure future compatibility with Quarkus 3.7
  • Loading branch information
ozangunalp authored Feb 1, 2024
2 parents 345151d + 619e716 commit 612442b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 14 deletions.
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<assertj-core.version>3.24.2</assertj-core.version>
<weld.version>5.1.2.Final</weld.version>
<testcontainers-solace.version>1.18.3</testcontainers-solace.version>
<slf4j-log4j12.version>2.0.7</slf4j-log4j12.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -76,6 +77,12 @@
<version>${assertj-core.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j-log4j12.version}</version>
<scope>test</scope>
</dependency>

</dependencies>
</dependencyManagement>
Expand Down
6 changes: 6 additions & 0 deletions quarkus-solace-client/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>io.quarkus</groupId>
Expand Down
6 changes: 6 additions & 0 deletions quarkus-solace-messaging-connector/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@
</dependencies>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.solace.quarkus.samples;

import java.nio.charset.StandardCharsets;
import java.util.concurrent.CompletionStage;

import jakarta.enterprise.context.ApplicationScoped;

import org.eclipse.microprofile.reactive.messaging.*;

import com.solace.quarkus.messaging.incoming.SolaceInboundMessage;
import com.solace.messaging.receiver.InboundMessage;
import com.solace.quarkus.messaging.incoming.SolaceInboundMetadata;
import com.solace.quarkus.messaging.outgoing.SolaceOutboundMetadata;

import io.quarkus.logging.Log;
Expand All @@ -19,7 +17,7 @@ public class HelloConsumer {
/**
* Publishes message to topic hello/foobar which is subscribed by queue.foobar
*
* @see #consumeMessage(SolaceInboundMessage)
* @see #consumeMessage(InboundMessage)
* @return
*/
@Outgoing("hello-out")
Expand All @@ -35,11 +33,8 @@ Multi<Message<String>> publishMessage() {
* @param p
*/
@Incoming("hello-in")
@Acknowledgment(Acknowledgment.Strategy.MANUAL)
CompletionStage<Void> consumeMessage(SolaceInboundMessage<?> p) {
Log.infof("Received message: %s from topic: %s", new String(p.getMessage().getPayloadAsBytes(), StandardCharsets.UTF_8),
p.getMessage().getDestinationName());
return p.ack();
void consumeMessage(InboundMessage p) {
Log.infof("Received message: %s from topic: %s", p.getPayloadAsString(), p.getDestinationName());
}

/**
Expand All @@ -52,12 +47,12 @@ CompletionStage<Void> consumeMessage(SolaceInboundMessage<?> p) {
*/
@Incoming("dynamic-destination-in")
@Outgoing("dynamic-destination-out")
Message<?> consumeAndPublishToDynamicTopic(SolaceInboundMessage<?> p) {
Log.infof("Received message: %s from topic: %s", new String(p.getMessage().getPayloadAsBytes(), StandardCharsets.UTF_8),
p.getMessage().getDestinationName());
Message<?> consumeAndPublishToDynamicTopic(Message<?> p) {
SolaceInboundMetadata metadata = p.getMetadata(SolaceInboundMetadata.class).get();
Log.infof("Received message: %s from topic: %s", metadata.getPayloadAsString(), metadata.getDestinationName());
SolaceOutboundMetadata outboundMetadata = SolaceOutboundMetadata.builder()
.setApplicationMessageId("test")
.setDynamicDestination("hello/foobar/" + p.getMessage().getApplicationMessageId())
.setDynamicDestination("hello/foobar/" + metadata.getApplicationMessageId())
.createPubSubOutboundMetadata();
return p.addMetadata(outboundMetadata);
}
Expand Down

0 comments on commit 612442b

Please sign in to comment.