I am using stompest with activeMQ and testing with the Kaazing WebSocket Gateway.
I've been looking for a way to create a durable subscription from a stompest python client and have had some good success. The trick is to set activemq.subscriptionName in the client.subscribe call. The Active Durable topic subscriber is created, as shown in the activeMQ control panel http://localhost:8161/admin/subscribers.jsp
The final step is that I want to control the Client ID which is used, but I can't find a way to set it. it is always set to the name of my Macbook.
Any help appreciated.
my code looks like as follows :-
from stompest.config import StompConfig
from stompest.protocol import StompSpec
from stompest.sync import Stomp
CONFIG = StompConfig('tcp://localhost:61613')
TOPIC = '/topic/events.golf'
if __name__ == '__main__':
client = Stomp(CONFIG)
client.connect()
client.ID = 'client'
client.subscribe(TOPIC,
{
StompSpec.ACK_HEADER: StompSpec.ACK_CLIENT_INDIVIDUAL,
'activemq.clientIdentifier': 'client1',
'activemq.subscriptionName': 'lvc_events.golf',
'activemq.ID': 'client1'
})
while True:
frame = client.receiveFrame()
print 'Got %s' % frame.info()
client.ack(frame)
client.disconnect()
Best Regards
Derek