[zeromq-dev] jzmq-api XSUB socket subscribable
Klemen Živkovič
klemen.zivkovic at gmail.com
Sat Jun 18 22:04:32 CEST 2016
I am trying to make XSUB socket subscribable so I could go around this
IllegalArgumentException("subscription flag") I am getting in xsend method
of XSub.class
I tried using this to make socket subscribe - but somehow cannot do it:
SocketBuilder builder = ctx.buildSocket(SocketType.XSUB)
.asSubscribable()
.subscribe("".getBytes());
socket =builder.connect(this.halRCompUri);
I get:
Exception in thread "main" java.lang.ClassCastException:
org.zeromq.jzmq.sockets.XSubSocketBuilder cannot be cast to
org.zeromq.api.Subscribable
at
org.zeromq.jzmq.sockets.SocketBuilder.asSubscribable(SocketBuilder.java:294)
at com.kz.pipeCutter.BBB.BBBHalRComp.getSocket(BBBHalRComp.java:150)
at com.kz.pipeCutter.BBB.BBBHalRComp.<init>(BBBHalRComp.java:50)
at com.kz.pipeCutter.BBB.BBBHalRComp.main(BBBHalRComp.java:183)
Is it possible at all to send data from XSUB type socket?
According to https://github.com/zeromq/rfc/blob/master/29/README.md it
should be possible -
"
The XSUB Socket Type
The XSUB socket type extends the SUB socket with the ability to send
messages and subscription commands upstream to publishers
"
So any example how to do this through jzmq-api ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160618/8a64e89c/attachment.htm>
More information about the zeromq-dev
mailing list