Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Reactive Messaging to version 2.2.0 and Integrate health support #10831

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<smallrye-context-propagation.version>1.0.13</smallrye-context-propagation.version>
<smallrye-reactive-streams-operators.version>1.0.13</smallrye-reactive-streams-operators.version>
<smallrye-converter-api.version>1.1.0</smallrye-converter-api.version>
<smallrye-reactive-messaging.version>2.1.1</smallrye-reactive-messaging.version>
<smallrye-reactive-messaging.version>2.2.0</smallrye-reactive-messaging.version>
<swagger-ui.version>3.28.0</swagger-ui.version>
<jakarta.activation.version>1.2.1</jakarta.activation.version>
<jakarta.annotation-api.version>1.3.5</jakarta.annotation-api.version>
Expand Down Expand Up @@ -3601,6 +3601,11 @@
<artifactId>smallrye-reactive-messaging-api</artifactId>
<version>${smallrye-reactive-messaging.version}</version>
</dependency>
<dependency>
<groupId>io.smallrye.reactive</groupId>
<artifactId>smallrye-reactive-messaging-health</artifactId>
<version>${smallrye-reactive-messaging.version}</version>
</dependency>
<dependency>
<groupId>io.smallrye.reactive</groupId>
<artifactId>smallrye-reactive-messaging-mqtt</artifactId>
Expand Down
1 change: 0 additions & 1 deletion docs/src/main/asciidoc/amqp.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ amqp-password=quarkus
# Configure the AMQP connector to write to the `prices` address
mp.messaging.outgoing.generated-price.connector=smallrye-amqp
mp.messaging.outgoing.generated-price.address=prices
mp.messaging.outgoing.generated-price.durable=true

# Configure the AMQP connector to read from the `prices` queue
mp.messaging.incoming.prices.connector=smallrye-amqp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
amqp-port=5672

mp.messaging.outgoing.source.connector=smallrye-amqp
mp.messaging.outgoing.source.durable=true

mp.messaging.incoming.in.connector=smallrye-amqp
mp.messaging.incoming.in.address=source
Expand Down
4 changes: 4 additions & 0 deletions extensions/smallrye-reactive-messaging/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-reactive-messaging</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-health-spi</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-mutiny-reactive-streams-operators-deployment</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.quarkus.smallrye.reactivemessaging.deployment;

import io.quarkus.runtime.annotations.ConfigItem;
import io.quarkus.runtime.annotations.ConfigPhase;
import io.quarkus.runtime.annotations.ConfigRoot;

@ConfigRoot(name = "reactive-messaging", phase = ConfigPhase.BUILD_TIME)
public class ReactiveMessagingBuildTimeConfig {
/**
* Whether or not an health check is published in case the smallrye-health extension is present.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the in case... part true? AFAICS, you always drag the smallrye-health dependency.

Copy link
Member Author

@cescoffier cescoffier Jul 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It only depends on the SPI, not on the extension itself.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You sure? smallrye-reactive-messaging-health doesn't depend on health?

Because if you don't have health, I'm surprised this can work: https://github.com/quarkusio/quarkus/pull/10831/files#diff-0e5b3cb2b027d18a3e49591822e8c947R310 . You would need to use a string for the class name as there's a good chance you wouldn't be able to load the checks if health is not present.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smallrye-reactive-messaging-health depends on microprofile health not on the quarkus extension.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/quarkusio/quarkus/pull/10831/files#diff-0e5b3cb2b027d18a3e49591822e8c947R310 refers to classes from reactive messaging (in a specific module that depends on microprofile health).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just re-tested it does not pull quarkus-health, it's up to the user to use it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed this with @cescoffier on Zulip. Let's merge as is even if not entirely consistent with the other SmallRye extensions.

*/
@ConfigItem(name = "health.enabled", defaultValue = "true")
public boolean healthEnabled;
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,16 @@
import io.quarkus.gizmo.MethodCreator;
import io.quarkus.gizmo.MethodDescriptor;
import io.quarkus.gizmo.ResultHandle;
import io.quarkus.smallrye.health.deployment.spi.HealthBuildItem;
import io.quarkus.smallrye.reactivemessaging.runtime.QuarkusMediatorConfiguration;
import io.quarkus.smallrye.reactivemessaging.runtime.QuarkusWorkerPoolRegistry;
import io.quarkus.smallrye.reactivemessaging.runtime.ReactiveMessagingConfiguration;
import io.quarkus.smallrye.reactivemessaging.runtime.SmallRyeReactiveMessagingLifecycle;
import io.quarkus.smallrye.reactivemessaging.runtime.SmallRyeReactiveMessagingRecorder;
import io.smallrye.reactive.messaging.Invoker;
import io.smallrye.reactive.messaging.annotations.Blocking;
import io.smallrye.reactive.messaging.health.SmallRyeReactiveMessagingLivenessCheck;
import io.smallrye.reactive.messaging.health.SmallRyeReactiveMessagingReadinessCheck;

/**
*
Expand Down Expand Up @@ -302,6 +305,14 @@ public void transform(AnnotationsTransformer.TransformationContext ctx) {
}
}

@BuildStep
public void enableHealth(ReactiveMessagingBuildTimeConfig buildTimeConfig, BuildProducer<HealthBuildItem> producer) {
producer.produce(
new HealthBuildItem(SmallRyeReactiveMessagingLivenessCheck.class.getName(), buildTimeConfig.healthEnabled));
producer.produce(
new HealthBuildItem(SmallRyeReactiveMessagingReadinessCheck.class.getName(), buildTimeConfig.healthEnabled));
}

@BuildStep
@Record(STATIC_INIT)
public void build(SmallRyeReactiveMessagingRecorder recorder, RecorderContext recorderContext,
Expand Down
26 changes: 26 additions & 0 deletions extensions/smallrye-reactive-messaging/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,32 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.smallrye.reactive</groupId>
<artifactId>smallrye-reactive-messaging-health</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>
<exclusion>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</exclusion>
<exclusion>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.annotation.versioning</artifactId>
</exclusion>
<exclusion>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ amqp-username=artemis
amqp-password=artemis

mp.messaging.outgoing.people-out.connector=smallrye-amqp
mp.messaging.outgoing.people-out.durable=true
mp.messaging.outgoing.people-out.address=people
mp.messaging.incoming.people-in.connector=smallrye-amqp
mp.messaging.incoming.people-in.durable=true
Expand Down