You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code should work as is? It works fine using standard "core" Vertx classes.
I was working on a larger project trying to use the new Mutiny classes and ran into this issue.
So, to isolate the problem I made this very simple example just to make sure I wasn't doing anything wrong.
Version
Which version(s) did you encounter this bug ?
4.3.0 vertx
2.22.0 Mutiny bindings
Context
When trying to use the EvenBus to send a Buffer instance it throws an error.
Exception in thread "main" java.lang.RuntimeException: java.lang.NoSuchMethodException: io.vertx.mutiny.core.buffer.Buffer.<init>()
at io.vertx.core.impl.ClusterSerializableUtils.copy(ClusterSerializableUtils.java:29)
at io.vertx.core.eventbus.impl.codecs.ClusterSerializableCodec.transform(ClusterSerializableCodec.java:65)
at io.vertx.core.eventbus.impl.codecs.ClusterSerializableCodec.transform(ClusterSerializableCodec.java:22)
at io.vertx.core.eventbus.impl.MessageImpl.<init>(MessageImpl.java:65)
at io.vertx.core.eventbus.impl.MessageImpl.copyBeforeReceive(MessageImpl.java:71)
at io.vertx.core.eventbus.impl.EventBusImpl.deliverMessageLocally(EventBusImpl.java:375)
at io.vertx.core.eventbus.impl.EventBusImpl.sendLocally(EventBusImpl.java:341)
at io.vertx.core.eventbus.impl.EventBusImpl.sendOrPub(EventBusImpl.java:329)
at io.vertx.core.eventbus.impl.OutboundDeliveryContext.execute(OutboundDeliveryContext.java:109)
at io.vertx.core.eventbus.impl.DeliveryContextBase.next(DeliveryContextBase.java:72)
at io.vertx.core.eventbus.impl.OutboundDeliveryContext.next(OutboundDeliveryContext.java:28)
at io.vertx.core.eventbus.impl.EventBusImpl.sendOrPubInternal(EventBusImpl.java:422)
at io.vertx.core.eventbus.impl.EventBusImpl.sendOrPubInternal(EventBusImpl.java:428)
at io.vertx.core.eventbus.impl.EventBusImpl.publish(EventBusImpl.java:164)
at io.vertx.core.eventbus.impl.EventBusImpl.publish(EventBusImpl.java:159)
at io.vertx.mutiny.core.eventbus.EventBus.publish(EventBus.java:224)
Do you have a reproducer?
Example:
This code fails using the Mutiny versions, but works properly with the standard 'core' versions.
import io.vertx.mutiny.core.Vertx;
import io.vertx.mutiny.core.buffer.Buffer;
/**
*
* @author tmulle
*/
public class Main {
public static void main(String[] args) throws InterruptedException {
Vertx v = Vertx.vertx();
v.eventBus().consumer("testing", message -> System.out.println("Got it!: " + message.body()));
v.eventBus().publish("testing", Buffer.buffer("HEllo BUFFER"));
Thread.sleep(5000);
v.close();
}
}
Steps to reproduce
Run example code above
...
...
...
Extra
JDK11/JDK17 on Silicon Mac M1 MAX
So I took a look at my original dependencies in my pom and I was using:
Realizing that the Mutiny might be pulling in vertx-core I commented it out and now I get a different error when running the 'Mutiny' version. The core version works correctly still.
If I leave both dependencies, then I get the original error of NoSuchMethodException which I am now assuming is a version mismatch between vertx-core and mutiny-vertx
Error I get now:
Exception in thread "main" java.lang.IllegalArgumentException: No message codec for type: class io.vertx.mutiny.core.buffer.Buffer
at io.vertx.core.eventbus.impl.CodecManager.lookupCodec(CodecManager.java:101)
at io.vertx.core.eventbus.impl.EventBusImpl.createMessage(EventBusImpl.java:232)
at io.vertx.core.eventbus.impl.EventBusImpl.publish(EventBusImpl.java:148)
at io.vertx.core.eventbus.impl.EventBusImpl.publish(EventBusImpl.java:143)
at io.vertx.mutiny.core.eventbus.EventBus.publish(EventBus.java:225)
The text was updated successfully, but these errors were encountered:
Questions
This code should work as is? It works fine using standard "core" Vertx classes.
I was working on a larger project trying to use the new Mutiny classes and ran into this issue.
So, to isolate the problem I made this very simple example just to make sure I wasn't doing anything wrong.
Version
Which version(s) did you encounter this bug ?
4.3.0 vertx
2.22.0 Mutiny bindings
Context
When trying to use the EvenBus to send a Buffer instance it throws an error.
Do you have a reproducer?
Example:
This code fails using the Mutiny versions, but works properly with the standard 'core' versions.
Steps to reproduce
Extra
So I took a look at my original dependencies in my pom and I was using:
Realizing that the Mutiny might be pulling in
vertx-core
I commented it out and now I get a different error when running the 'Mutiny' version. Thecore
version works correctly still.If I leave both dependencies, then I get the original error of
NoSuchMethodException
which I am now assuming is a version mismatch betweenvertx-core
andmutiny-vertx
Error I get now:
The text was updated successfully, but these errors were encountered: