Couldn’t connect to the STOMP server.
Timed-out while establishing connection to the STOMP server.
No longer connected to the STOMP server.
STOMP Client.
Parameters: |
|
---|
Couldn’t connect to the STOMP server.
Timed-out while establishing connection to the STOMP server.
No longer connected to the STOMP server.
Abort transaction.
In the case of ActiveMQ, you could do this:
>>> stomp.abort({'transaction':'<randomish_hash_like_thing>'})
Acknowledge receipt of a message
Param : | A stompy.frame.Frame instance. |
---|
Example
>>> while True:
... frame = stomp.receive_frame()
... stomp.ack(frame)
Begin transaction.
You will need to pass any headers your STOMP server likes.
destination is required
In the case of ActiveMQ, you could do this:
>>> stomp.begin({'transaction':'<randomish_hash_like_thing>'})
Commit transaction.
You will need to pass any headers your STOMP server likes.
destination is required
In the case of ActiveMQ, you could do this:
>>> stomp.commit({'transaction':'<randomish_hash_like_thing>'})
Connect to STOMP server.
Parameters: |
|
---|
Disconnect from the server.
Alias to receive_frame() with nonblocking=True.
Get a frame from the STOMP server
Parameters: |
|
---|
Note that you must be subscribed to one or more destinations. Use subscribe() to subscribe to a topic/queue.
Example: Blocking
>>> while True:
... frame = stomp.receive_frame()
... print(frame.headers['message-id'])
... stomp.ack(frame)
Example: Non-blocking
>>> frame = stomp.recieve_frame(nonblocking=True)
>>> if frame:
... process_message(frame)
... else:
... # no messages yet.
Send message to STOMP server
You’ll need to pass the body and any other headers your STOMP server likes.
destination is required
In the case of ActiveMQ with persistence, you could do this:
>>> for i in xrange(1,1000):
... stomp.send({'destination': '/queue/foo',
... 'body': 'Testing',
... 'persistent': 'true'})
Send a custom frame to the STOMP server
Parameters: |
|
---|
Example
>>> from stompy import Frame
>>> frame = Frame().build_frame({
... "command": "DISCONNECT",
... "headers": {},
... })
>>> stomp.send_frame(frame)
Subscribe to a given destination
You will need to pass any headers your STOMP server likes.
destination is required
In the case of ActiveMQ, you could do this:
>>> stomp.subscribe({'destination':'/queue/foo',
... 'ack':'client'})
DEPRECATED The queue or topic currently subscribed to.
Unsubscribe from a given destination
You will need to pass any headers your STOMP server likes.
destination is required
>>> stomp.unsubscribe({'destination':'/queue/foo'})