Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7895785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:43:38+00:00 2026-06-03T07:43:38+00:00

when I read the Durable Subscribers and High-Water Marks in zmq guide, it said

  • 0

when I read the “Durable Subscribers and High-Water Marks” in zmq guide, it said “The HWM causes ØMQ to drop messages it can’t put onto the queue”, but no messages lost when I ran the example. Hit ctrl+c to terminate the durasub.py and then continue it.

the example from the zmq in python.Other languages are the same.

durasub.py

import zmq                                              
import time                                             

context = zmq.Context()                                 


subscriber = context.socket(zmq.SUB)                    
subscriber.setsockopt(zmq.IDENTITY, "Hello")            
subscriber.setsockopt(zmq.SUBSCRIBE, "")                
subscriber.connect("tcp://localhost:5565")              


sync = context.socket(zmq.PUSH)                         
sync.connect("tcp://localhost:5564")                    
sync.send("")                                           


while True:                                             
    data = subscriber.recv()                            
    print data                                          
    if data == "END":                                   
        break                                           

durapub.py

import zmq                                        
import time                                       

context = zmq.Context()                           


sync = context.socket(zmq.PULL)                   
sync.bind("tcp://*:5564")                         

publisher = context.socket(zmq.PUB)               
publisher.bind("tcp://*:5565")                    

publisher.setsockopt(zmq.HWM, 2)                  

sync_request = sync.recv()                        

for n in xrange(10):                              
    msg = "Update %d" % n                         
    publisher.send(msg)                           
    time.sleep(1)                                 

publisher.send("END")                             
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T07:43:40+00:00Added an answer on June 3, 2026 at 7:43 am

    The suggestion above is valid, but doesn’t properly address the problem in this particular code.

    The real problem here is that in durapub.py you call publisher.setsockopt(zmq.HWM, 2) AFTER calling publisher.bind. You should call setsockopt BEFORE bind or connect.

    Please refer to 0MQ API documentation for setsockopt:

    Caution: All options, with the exception of ZMQ_SUBSCRIBE, ZMQ_UNSUBSCRIBE and ZMQ_LINGER, only take effect for subsequent socket bind/connects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read on the facebook documentation ( here ) that you can force a
Read about the z-index issue and tried anything, but just can't seem to fix
read -p Please Enter a Message: message How can I add a line break
I read how this can be made to work using forward declarations. class A
I read (and am currently using this) that I can use a long whenever
I read about OpenBTS it's really amazing... but I was wondering if we can
I read this previous post . Can any one say what the exact difference
Read about Server push here . I want to push data to client from
Read on before you say this is a duplicate, it's not. (as far as
Read (skimmed enough to get coding) through Erlang Programming and Programming Erlang . One

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.