#NEWLINE# def do_subscribe( self , args ) : #NEWLINE# #INDENT# args = args . split ( ) #NEWLINE# if ( len ( args ) < 1 ) : #NEWLINE# #INDENT# self . __error ( 'Expecting: subscribe <destination> [ack]' ) #NEWLINE# return #NEWLINE# #UNINDENT# name = args [ 0 ] #NEWLINE# if ( name in self . __subscriptions ) : #NEWLINE# #INDENT# self . __error ( ( 'Already subscribed to %s' % name ) ) #NEWLINE# return #NEWLINE# #UNINDENT# ack_mode = 'auto' #NEWLINE# if ( len ( args ) >= 2 ) : #NEWLINE# #INDENT# ack_mode = args [ 1 ] #NEWLINE# #UNINDENT# sid = self . __subscription_id #NEWLINE# self . __subscription_id += 1 #NEWLINE# self . __sysout ( ( 'Subscribing to "%s" with acknowledge set to "%s", id set to "%s"' % ( name , ack_mode , sid ) ) ) #NEWLINE# self . conn . subscribe ( destination = name , ack = ack_mode , id = sid ) #NEWLINE# self . __subscriptions [ name ] = SubscriptionInfo ( sid , ack_mode )