# ZMQ CONFLATE Option

**URL:** https://discourse.julialang.org/t/zmq-conflate-option/94800
**Category:** General Usage
**Tags:** zmq
**Created:** [February 17, 2023, 5:38pm UTC](https://discourse.julialang.org/t/zmq-conflate-option/94800 "2023-02-17T17:38:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![hanshinlee77](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hanshinlee77/32/32867_2.png) [@hanshinlee77](https://discourse.julialang.org/u/hanshinlee77)
#### Post date: [February 17, 2023, 5:38pm UTC](https://discourse.julialang.org/t/zmq-conflate-option/94800/1 "2023-02-17T17:38:28Z")

</div>

Hi,

I am using ZMQ.jl for a PUB-SUB socket operation. Occasionally, the operation gets into a situation where the subscriber becomes slow and as a result the messages from the publisher accumulates in the subscriber’s buffer. Ideally, I would like to discard old messages so that the subscriber only gets the last message sent.

After some googling, there is an option called CONFLATE, but I do not find it in ZMQ.jl. I do have the latest ZMQ.jl (v1.2.2).

Does anyone know whether this option is implemented and if so how I can use this option?

Thanks,  
Hanshin

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [February 17, 2023, 5:57pm UTC](https://discourse.julialang.org/t/zmq-conflate-option/94800/2 "2023-02-17T17:57:27Z")

</div>

There’s no high-level interface for it in ZMQ.jl, though in principle you could call `zmq_setsockopt` directly via `ccall`.

I just pushed a draft PR that adds a `conflate` property to the `ZMQ.Socket` type that you can get/set, however: [add ZMQ\_CONFLATE by stevengj · Pull Request #222 · JuliaInterop/ZMQ.jl · GitHub](https://github.com/JuliaInterop/ZMQ.jl/pull/222) … try it out and let us know if it works for you.

---

<div class="post-metadata">

### Author: ![hanshinlee77](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hanshinlee77/32/32867_2.png) [@hanshinlee77](https://discourse.julialang.org/u/hanshinlee77)
#### Post date: [February 21, 2023, 4:43pm UTC](https://discourse.julialang.org/t/zmq-conflate-option/94800/3 "2023-02-21T16:43:20Z")

</div>

Thanks very much. I appreciate adding this. I will try it out!
