Question

Using the jzmq wrapper:

scala> import org.zeromq.ZMQ import org.zeromq.ZMQ

scala> val context = ZMQ.context(1)
context: org.zeromq.ZMQ.Context = org.zeromq.ZMQ$Context@56d58984

scala> val socket = context.socket(ZMQ.REP)
socket: org.zeromq.ZMQ.Socket = org.zeromq.ZMQ$Socket@2a5a0f9

scala> socket.getHWM()
res6: Long = -1

scala> socket.setHWM(200)

scala> socket.getHWM()
res8: Long = -1

This seems to be depreacted in version 3:

https://github.com/zeromq/jzmq/blob/750f2eecaa4c71adf86c156fab5840a2f614d4ea/src/org/zeromq/ZMQ.java#L895-900

Anyone knows why? and what's the alternative to set a HWM using jzqm + zmq3?

Was it helpful?

Solution

Have a look at: http://zeromq.org/docs:3-1-upgrade

In zeromq 3.2 HWM has been split into send and receive high water mark: ZMQ_SNDHWM and ZMQ_RCVHWM.

The functions you are looking for in jzmq are:

long    getRcvHWM()
long    getSndHWM()
void    setRcvHWM(long rcvHWM)
void    setSndHWM(long sndHWM) 

OTHER TIPS

The CZMQ binding simulates the old HWM option, and other bindings might do the same.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top