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 to SmallRye Reactive Messaging 1.1.0 #7059

Merged

Conversation

cescoffier
Copy link
Member

This version brings a new set of features:

  • Metadata propagation
  • New Emitter support (part of the spec, the old one is deprecated but still supported)
  • @Stream has been removed (already deprecated)

@cescoffier
Copy link
Member Author

@kenfinnigan @geoand @mkouba There is something where I'm not quite sure: the metric support.
SR Reactive Messaging defines a metric (defined in the spec) : https://github.com/smallrye/smallrye-reactive-messaging/blob/master/smallrye-reactive-messaging-provider/src/main/java/io/smallrye/reactive/messaging/metrics/MetricDecorator.java (1 metric per channel).

In the PR, I just add this bean if the metric capability is enabled. Is there anything else required?

@geoand
Copy link
Contributor

geoand commented Feb 7, 2020

I don't really know about metrics, so either the aforementioned people can help out or @jmartisk can chime in

@geoand
Copy link
Contributor

geoand commented Feb 7, 2020

I like it, 👍

@jmartisk
Copy link
Contributor

jmartisk commented Feb 7, 2020

IIUC the MetricDecorator puts the metrics into the application metric registry, I think vendor registry would be more correct for this, as these are not declared directly by an application. That can be achieved by injecting it together with @org.eclipse.microprofile.metrics.annotation.RegistryType(type=VENDOR)

EDIT: or rather base! The RM spec does not say explicitly (maybe it should), but Metrics spec says that generally metrics defined by other MP specs should go into base

Also we usually introduce a config property like quarkus.EXTENSION.metrics.enabled to enable metrics for a particular extension and the default value is false, see https://github.com/quarkusio/quarkus/blob/master/extensions/agroal/runtime/src/main/java/io/quarkus/agroal/runtime/AgroalBuildTimeConfig.java#L40 so that metrics for each extension have to be enabled separately

@jmartisk
Copy link
Contributor

jmartisk commented Feb 7, 2020

Also if the set of channels (and therefore metrics) is known already at build time, the processor could optionally emit MetricBuildItem-s to get the metrics registered eagerly during build. But this currently can be done only for vendor registry, so if these should go into base then we will need to improve the metric registration mechanism to allow that too :)

@cescoffier
Copy link
Member Author

@jmartisk Thanks!

So, unfortunately right now the set of channels is not known at build time. But I really want to go in this direction (it requires a bit more code and configuration analysis, nothing very hard).

I will add the flag to enable and disable the metric, that makes sense! So, we expose them only if 1. the metric capability is enabled 2. the extension metrics are enabled. Am I right?

@jmartisk
Copy link
Contributor

jmartisk commented Feb 7, 2020

So, we expose them only if 1. the metric capability is enabled 2. the extension metrics are enabled. Am I right?

Yes.

@jmartisk
Copy link
Contributor

jmartisk commented Feb 7, 2020

Hm, if the TCKs already expect them in default (which is application), then I suppose we'll have to leave them there.. This has unfortunately only very recently been clarified in the MP Metrics spec (https://github.com/eclipse/microprofile-metrics/blob/master/spec/src/main/asciidoc/architecture.adoc#required-base-metrics) - this will be in the upcoming 2.3 version:

The base scope is used for, and only for, any metrics that are defined in MicroProfile specifications. Metrics in the base scope are intended to be portable between different MicroProfile-compatible runtimes.

So I would suggest the next version of RM spec should move them to base

@cescoffier
Copy link
Member Author

@jmartisk Actually, the spec has not been released with these changes yet... So, there is still time to fix it :-). Let me create an issue in the spec (will ping you from there).

@jmartisk
Copy link
Contributor

jmartisk commented Feb 7, 2020

@cescoffier Oh, that's good news then :) sure.

@geoand
Copy link
Contributor

geoand commented Feb 7, 2020

The TCK failures seem related

@kenfinnigan
Copy link
Member

For the TCKs, I think https://github.com/quarkusio/quarkus/blob/master/tcks/microprofile-reactive-messaging/pom.xml#L36 needs to add the Metrics extension, as by default it's not brought in through a required dependency

@cescoffier
Copy link
Member Author

The TCK failure is expected, the failing tests have been removed from the TCK, it was not correct.

@cescoffier
Copy link
Member Author

I've applied a workaround for the TCK.

cescoffier added a commit to cescoffier/quarkus that referenced this pull request Feb 10, 2020
@cescoffier
Copy link
Member Author

About the metrics change, let's wait until it's part of the upstream specification. It is going to happen soon I believe.

Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

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

LGTM but let's get an approval from @kenfinnigan and @jmartisk as well :)

…eactive Messaging 1.1.0

* @stream has been removed
* The Emitter is now part of the spec
* The old emitter, channel and on overflow are now deprecated
We test both the old emitter support and the new one.
… metrics

This follows the common convention used by the other extensions
…sions of Emitter, Channel and OnOverflow

Also renamed the tests classes to follow the same convention.
First the TCK is checking the metrics support - so need metrics
Then, some method signatures are now considered invalid (harmful) and the upcoming version of the TCK contains fixes for these tests. For now skip these.
* Mention the deprecation of the SmallRye Emitter / Channel / OnOverflow classes
* Update code snippet (import statements)
This avoids a depending on metrics directly.
@cescoffier cescoffier force-pushed the features/update-reactive-messaging branch from b30a826 to 35f8c8f Compare February 17, 2020 14:28
@kenfinnigan kenfinnigan merged commit 46d40bc into quarkusio:master Feb 18, 2020
@cescoffier cescoffier deleted the features/update-reactive-messaging branch February 26, 2020 08:19
@gsmet gsmet added this to the 1.3.0 milestone Feb 28, 2020
luca-digrazia pushed a commit to luca-digrazia/DatasetCommitsDiffSearch that referenced this pull request Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants