GithubHelp home page GithubHelp logo

Comments (9)

PaulGale avatar PaulGale commented on July 24, 2024 2

from stomp.

samba4vineti avatar samba4vineti commented on July 24, 2024 1

To add to this thread, would appreciate if we can have an example of how multiple subscribers should be registered on a topic. Do we need to create separate STOMP client for each subscriber for the same topic or would just a subscription suffice ?

from stomp.

gmallard avatar gmallard commented on July 24, 2024

Hi -

First: this is really a question for the AMQ developers. STOMP clients have nothing to do with how (or even if) durability is implemented.

Second - I can recreate what you are seeing. But ...... it is a race condition I think. At the end of your code (above) do a

sleep 10

And when the program exits, then look at the AMQ admin screens. With a suitable sleep, I get all messages received by all consumers.

As far as I can tell, all of this is working as designed.

Note that AMQ creates a durable sub. client if you do not specify one on CONNECT. You can see this in the admin screens.

from stomp.

samba4vineti avatar samba4vineti commented on July 24, 2024

Hi,

Thanks a lot for your response and appreciate it much.
FYI : sleep would not work in a production environment and hence looking for alternate solutions.
Few Qs :

  • Could you throw some light on whether these are two separate threads that are reading from their individual sockets ?
  • When we have 2 subscribers on a topic, do we need to create separate Stomp::Client connections OR create one Stomp:Client and subscriber the second Subscriber on the Client ? Would appreciate if you can share a sample code ?

from stomp.

samba4vineti avatar samba4vineti commented on July 24, 2024

Thanks Paul. Yes we are using ActiveMQ. Thanks a lot for calling out the pre-fetch size.

from stomp.

PaulGale avatar PaulGale commented on July 24, 2024

from stomp.

samba4vineti avatar samba4vineti commented on July 24, 2024

Paul, havent tested the change yet. Made the change to our larger codebase and is in the build pipeline. Havent run the above code either. Will confirm once we test the above unit test or have an opportunity to run the prod codebase.

from stomp.

sudeeptarlekar avatar sudeeptarlekar commented on July 24, 2024

We tried passing activemq.prefetchSize as the header value while subscribing to the topic and found that after adding the value we are able to receive correct number of messages from both client.

Thanks for helping us out here @PaulGale

from stomp.

gmallard avatar gmallard commented on July 24, 2024

Thanks much Paul. Great suggestion.

Regarding making this the default:

I would entertain a modification where the clients asks for this to be the default. Say yet another option in the Connect hash.

I do not want it across the board. There is no sense spamming Rabbit MQ (e.g.) with AMQ specific headers.

@sudeeptarlekar - With no objections I will close this issue in the next few days.

from stomp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.