vertx.eventBus()
.send(netSocket.writeHandlerID(), "4TEST");
SEVERE: Failed to handleMessage. address: 5a56a125-fc81-4e36-a3b1-cbb10ed2b161
java.lang.ClassCastException: java.lang.String cannot be cast to io.vertx.core.buffer.Buffer
at io.vertx.core.net.impl.NetSocketImpl.lambda$new$1(NetSocketImpl.java:95)
at io.vertx.core.eventbus.impl.HandlerRegistration.deliver(HandlerRegistration.java:212)
at io.vertx.core.eventbus.impl.HandlerRegistration.handle(HandlerRegistration.java:189)
at io.vertx.core.eventbus.impl.EventBusImpl.lambda$deliverToHandler$3(EventBusImpl.java:538)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:344)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:16
vertx.eventBus()
.send(netSocket.writeHandlerID(), Buffer.buffer("4TEST"));
java.lang.IllegalArgumentException: No message codec for type: class io.vertx.reactivex.core.buffer.Buffer
at io.vertx.core.eventbus.impl.CodecManager.lookupCodec(CodecManager.java:90)
at io.vertx.core.eventbus.impl.clustered.ClusteredEventBus.createMessage(ClusteredEventBus.java:203)
at io.vertx.core.eventbus.impl.EventBusImpl.send(EventBusImpl.java:110)
at io.vertx.core.eventbus.impl.EventBusImpl.send(EventBusImpl.java:95)
at chhil.vertx.example2.TCPServer.lambda$3(TCPServer.java:108)
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/53c57a5f-60e7-415a-833d-21f2a9e4927a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
For the code snippet 1 that you have shared, there seems to be no address to handle the message. netSocket.writeHandlerID() is dynamic, and event bus looks for an already registered address to send the message to.
For the code snippet 2, you can send String/JsonObject as messages, so you have to get String/JsonObject from the buffer -> Buffer.buffer(“4TEST”).toString() as an example.
SEVERE: Unhandled exception
java.lang.ClassCastException: java.lang.String cannot be cast to io.vertx.core.buffer.Buffer
at io.vertx.core.net.impl.NetSocketImpl.lambda$new$1(NetSocketImpl.java:95)
at io.vertx.core.eventbus.impl.HandlerRegistration.deliver(HandlerRegistration.java:212)
at io.vertx.core.eventbus.impl.HandlerRegistration.handle(HandlerRegistration.java:189)
at io.vertx.core.eventbus.impl.EventBusImpl.lambda$deliverToHandler$3(EventBusImpl.java:538)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:344)
On 19 Jan 2018, at 11:19, murtuza chhil <chi...@gmail.com> wrote:
Do these writeHandlerIDs work for verticles across jvms and across machines boundaries in a cluster?-chhil
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/1e027638-7a29-450f-831a-8e9258df7d31%40googlegroups.com.