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
Reactive messaging fails when using PublisherBuilder or ProcessorBuilder #4587
Comments
Fixed this locally and indeed I get the expected behavior now. |
@misl looks like you're ready to prepare a PR (and add a test!) :). |
Exactly what @gsmet said 😁 |
PR should be easy, except for the test :-( I think the current tests are very limited. This makes me wonder what the test coverage is. Is there any test coverage information available? |
The library itself has plenty of tests. The Quarkus integrations has fewer but that's the point, to improve that :) |
@misl you could add something existing to the integration test, no? |
This issue applies to Kafka too |
I created the following pull request: #4628 Unfortunately no additional unittest. I tried various ways of triggering the error. This indeed resulted in |
@misl Which unit test are you talking about? |
Would it not be possible to add a test like the ones we have at: https://github.com/quarkusio/quarkus/tree/master/extensions/smallrye-reactive-messaging/deployment/src/test/java/io/quarkus/smallrye/reactivemessaging ? |
@geoand I had a look at those. Initially I thought the coverage was not too well, but this turned out to be wrong. Coverage is quite good it is mostly error conditions that lack coverage. I also looked at smalrye message provider to see if I could steal/copy a unittest. But it appears unittests here and at smallrye do not use any subclasses of (MicroProfile) I tried to introduce a subclass of @Incoming("processed-wrapped-a")
@Outgoing("processed-wrapped-b")
public PublisherBuilder<SubClassedMessage<String>> filterWrapped(PublisherBuilder<Message<byte[]>> input) {
return input
.map( item -> SubClassedMessage.of( new String(item.getPayload()) ) )
.filter(item -> item.getPayload().length() > 4);
} But this also allowed me to only use the subclass on the The alternative I see would be adding testcases the smallrye messaging Kafka, Amqp and Mqtt extensions. Since those modules do use a subclass of |
@misl thanks for the great update! Lets see what @cescoffier wants to do about tests. |
#4587: Reversed isAssignableFrom arguments
When switching from Quarkus 0.23.2 to 0.24.0 my application resulted in the following error:
While looking around with the debugger I noticed
ProcessorMediator.processMethodReturningAPublisherBuilderOfPayloadsAndConsumingPayloads()
is being called. This message tried to invoke the handler with just the payload instead of the surroundingMessage
object. The reason for thisProduction.STREAM_OF_PAYLOAD
is being configured instead ofSTREAM_OF_MESSAGE
.My handler looks like this:
Initially I thought this was an issue somewhere in SmallRye messaging. That's why I created an issue there. However further investigation lead to the Quarkus reactive messaging extension.
It appears that
QuarkusMediatorConfigurationUtil.JandexGenericTypeAssignable.check()
results inNotAssignable
whereAssignable
is expected. Especially the following part:argumentClass.isAssignableFrom(target)
. This basicaly results inAmqpMessage.isAssignalbleFrom(Message)
orMqttMessage.isAssignalbleFrom(Message)
Should it not be the other way around?
target.isAssignableFrom(argumentClass)
I ran into it using Mqtt but I think it applies to Amqp as well.
The text was updated successfully, but these errors were encountered: