Giter VIP home page Giter VIP logo

Comments (7)

theduderog avatar theduderog commented on June 2, 2024

Yes, please. You can fork the project and then create a pull request on github so that I can incorporate your changes. Please include a unit test.

from stompest.

dlibby00 avatar dlibby00 commented on June 2, 2024

I don't see any examples of testing the previous commands:

CONNECT, DISCONNECT, SEND, SUBCRIBE, ACK

as sent by the async StompClient.

Am I missing something?

from stompest.

theduderog avatar theduderog commented on June 2, 2024

The async tests (async_stomp_client_integration_test.py and async_stomp_client_test.py) test all of the those commands but admittedly indirectly. simple_stomp_test.py has some cases like "test_connect_writes_correct_frame" which are very direct test cases.

What use cases are you solving with UNSUBCRIBE? Is it ok that it won't get sent to the broker on shutdown? If you just want to call it on demand to unsub from a queue or topic then it might be simple enough that you don't need much testing.

from stompest.

dlibby00 avatar dlibby00 commented on June 2, 2024

I needed to implement the ability to send a message and wait for a response. My original solution was to register a new subscriber on a queue with a selector of the form:

"JMSCorrelationID = '%s'" % (correlationId)

since these subscribers are inherently one off (the correlationId is also a UUID) I obviously needed a way to remove these consumers after the message was received (or a timeout occurred) and the UNSUBSCRIBE command was the way to do it.

We have since discovered that creating one off consumers like this is a good way to make ActiveMQ fall over and die so we have switched to temporary queues as response queues and no longer need the UNSUBSCRIBE command.

We will however need the transaction commands BEGIN, COMMIT, and ABORT.

So I figured I would just add methods to async for all of them which will also complete the stomp protocol.

I'll figure out a way to write tests along the lines of the "test_*_writes_correct_frame" in simple.py for the async client.

from stompest.

theduderog avatar theduderog commented on June 2, 2024

Oh, ok. One other thing you may be interested in are SEND receipts (http://stomp.codehaus.org/Protocol ). I didn't implement them but they might be a good idea of you really want to be sure that the broker received a message you sent. I noticed with the example program that I wrote that if it exited too quickly, the messages were not enqueue. I think Twisted buffers bytes to be written to a socket and if you stop the reactor too soon they may not get sent.

In the Twisted Producer example, replace this "reactor.callLater(1, reactor.stop)" with reactor.stop() and you'll see what I mean.

from stompest.

dlibby00 avatar dlibby00 commented on June 2, 2024

Here's a dumb question:

Is there a way to run all of the tests under the tests/ directory in a single shot?

from stompest.

theduderog avatar theduderog commented on June 2, 2024

Yes, from the top-level directory, you can run python ./setup.py test

from stompest.

Related Issues (3)

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.