Skip to content

Commit

Permalink
Merge 4235861 into 244d4d9
Browse files Browse the repository at this point in the history
  • Loading branch information
cescoffier authored Aug 24, 2023
2 parents 244d4d9 + 4235861 commit 257b6d2
Show file tree
Hide file tree
Showing 19 changed files with 45 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.smallrye.reactive.messaging.json;
package io.smallrye.reactive.messaging.json.jackson;

import jakarta.annotation.Priority;
import jakarta.enterprise.context.ApplicationScoped;
Expand All @@ -7,6 +7,8 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import io.smallrye.reactive.messaging.json.JsonMapping;

@ApplicationScoped
@Priority(value = JsonMapping.DEFAULT_PRIORITY)
public class JacksonMapping implements JsonMapping {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.smallrye.reactive.messaging.json;
package io.smallrye.reactive.messaging.json.jackson;

import static org.assertj.core.api.Assertions.assertThat;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.smallrye.reactive.messaging.json;
package io.smallrye.reactive.messaging.json.jackson;

import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.smallrye.reactive.messaging.json;
package io.smallrye.reactive.messaging.json.jackson;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Produces;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.smallrye.reactive.messaging.json;
package io.smallrye.reactive.messaging.json.jackson;

public class Person {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.smallrye.reactive.messaging.json;
package io.smallrye.reactive.messaging.json.jackson;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.smallrye.reactive.messaging.json;
package io.smallrye.reactive.messaging.json.jackson;

import jakarta.enterprise.context.ApplicationScoped;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package io.smallrye.reactive.messaging.json;
package io.smallrye.reactive.messaging.json.jackson;

import com.fasterxml.jackson.annotation.JsonProperty;

import io.smallrye.reactive.messaging.json.JsonMapping;

/**
* Test object to use in {@link JsonMapping} implementation.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import io.smallrye.config.SmallRyeConfigProviderResolver;
import io.smallrye.config.inject.ConfigExtension;
import io.smallrye.reactive.messaging.jms.JmsConnector;
import io.smallrye.reactive.messaging.json.JacksonMapping;
import io.smallrye.reactive.messaging.json.ObjectMapperProvider;
import io.smallrye.reactive.messaging.json.jackson.JacksonMapping;
import io.smallrye.reactive.messaging.json.jackson.ObjectMapperProvider;
import io.smallrye.reactive.messaging.providers.MediatorFactory;
import io.smallrye.reactive.messaging.providers.connectors.ExecutionHolder;
import io.smallrye.reactive.messaging.providers.connectors.WorkerPoolRegistry;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package io.smallrye.reactive.messaging.json;
package io.smallrye.reactive.messaging.json.jsonb;

import jakarta.annotation.Priority;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import jakarta.json.bind.Jsonb;

import io.smallrye.reactive.messaging.json.JsonMapping;

@ApplicationScoped
@Priority(value = JsonMapping.DEFAULT_PRIORITY + 1)
public class JsonBMapping implements JsonMapping {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.smallrye.reactive.messaging.json;
package io.smallrye.reactive.messaging.json.jsonb;

import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.smallrye.reactive.messaging.json;
package io.smallrye.reactive.messaging.json.jsonb;

import static org.assertj.core.api.Assertions.assertThat;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.smallrye.reactive.messaging.json;
package io.smallrye.reactive.messaging.json.jsonb;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Produces;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.smallrye.reactive.messaging.json;
package io.smallrye.reactive.messaging.json.jsonb;

public class Person {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.smallrye.reactive.messaging.json;
package io.smallrye.reactive.messaging.json.jsonb;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.smallrye.reactive.messaging.json;
package io.smallrye.reactive.messaging.json.jsonb;

import jakarta.enterprise.context.ApplicationScoped;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package io.smallrye.reactive.messaging.json;
package io.smallrye.reactive.messaging.json.jsonb;

import jakarta.json.bind.annotation.JsonbProperty;

import io.smallrye.reactive.messaging.json.JsonMapping;

/**
* Test object to use in {@link JsonMapping} implementation.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import io.smallrye.config.SmallRyeConfigProviderResolver;
import io.smallrye.config.inject.ConfigExtension;
import io.smallrye.reactive.messaging.jms.JmsConnector;
import io.smallrye.reactive.messaging.json.JsonBMapping;
import io.smallrye.reactive.messaging.json.JsonBProvider;
import io.smallrye.reactive.messaging.json.jsonb.JsonBMapping;
import io.smallrye.reactive.messaging.json.jsonb.JsonBProvider;
import io.smallrye.reactive.messaging.providers.MediatorFactory;
import io.smallrye.reactive.messaging.providers.connectors.ExecutionHolder;
import io.smallrye.reactive.messaging.providers.connectors.WorkerPoolRegistry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ private void awaitAndVerify() {
.pollInterval(Duration.ofSeconds(1))
.until(() -> connector.getReadiness().isOk());

await()
.pollInterval(Duration.ofSeconds(1))
.until(() -> connector.getLiveness().isOk());

bean.publish();

await().until(() -> bean.messages().size() >= 3);
Expand Down Expand Up @@ -155,23 +159,36 @@ public void publish() {
emitter.send(MqttMessage
.of("/app/hello/mqtt-" + LocalDate.now().toString() + "/greeting", "hello from dynamic topic 1",
MqttQoS.EXACTLY_ONCE));
nap(10);
emitter.send(MqttMessage
.of("/app/hello/mqtt-" + LocalDate.now().toString() + "/greeting", "hello from dynamic topic 2",
MqttQoS.EXACTLY_ONCE));
nap(10);
emitter.send(MqttMessage
.of("/app/hello/mqtt-" + LocalDate.now().toString() + "/greeting", "hello from dynamic topic 3",
MqttQoS.EXACTLY_ONCE));
nap(15);
emitter.send(MqttMessage
.of("$/app/hello/mqtt-" + LocalDate.now().toString() + "/greeting", "hello from dynamic topic 4",
MqttQoS.EXACTLY_ONCE));
nap(10);
emitter.send(MqttMessage
.of("$/app/hello/mqtt-" + LocalDate.now().toString() + "/greeting", "hello from dynamic topic 5",
MqttQoS.EXACTLY_ONCE));
nap(5);
emitter.send(MqttMessage
.of("$/app/hello/mqtt-" + LocalDate.now().toString() + "/greeting", "hello from dynamic topic 6",
MqttQoS.EXACTLY_ONCE));
}

private void nap(int duration) {
try {
Thread.sleep(duration);
} catch (Exception ignored) {
// ignored.
}
}

@Incoming("in")
public CompletionStage<Void> received(MqttMessage<byte[]> message) {
messages.add(message);
Expand Down

0 comments on commit 257b6d2

Please sign in to comment.