W/o Durability
(in-package :socket) (let ((stream (make-socket :remote-host "localhost" :remote-port 61613))) (format stream "CONNECT~%~%~C" #\null) (force-output stream) ; Skip the CONNECT frame (loop for line = (read-line stream) until (string= line #\null)) (format stream "SUBSCRIBE~%destination:/topic/SampleTopic~%ack:auto~%~%~C" #\null) (force-output stream) ; Seek to the body of the MESSAGE frame (loop for line = (read-line stream) until (string= line "")) (print (read-line stream)) (format stream "DISCONNECT~%~%~C" #\null) )
W/ Durability
(in-package :socket) (let ((stream (make-socket :remote-host "localhost" :remote-port 61613))) (format stream "CONNECT~%client-id:SampleClient~%~%~C" #\null) (force-output stream) ; Skip the CONNECT frame (loop for line = (read-line stream) until (string= line #\null)) (format stream "SUBSCRIBE~%destination:/topic/SampleTopic~%ack:auto~%activemq.subscriptionName:SampleSubscription~%~%~C" #\null) (force-output stream) ; Seek to the body of the MESSAGE frame (loop for line = (read-line stream) until (string= line "")) (print (read-line stream)) (format stream "DISCONNECT~%~%~C" #\null) )