How can I set clientID in the stompest client.

493 views
Skip to first unread message

Derek Howlett

unread,
Mar 31, 2014, 7:49:36 PM3/31/14
to stom...@googlegroups.com, Richard Cullen
Hi stompest forum,

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

nikipore

unread,
Apr 2, 2014, 5:09:22 PM4/2/14
to stom...@googlegroups.com, Richard Cullen
This question is probably better directed to the ActiveMQ forum. According to the ActiveMQ documentation, the header is called client-id. Have you tried that one?

Cheers,
Jan
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages