Skip to content

Commit 00538d9

Browse files
committed
Allow id?
1 parent 132cb6e commit 00538d9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

stomp.nim

+5-1
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ proc send*( c: StompClient,
469469
proc subscribe*( c: StompClient,
470470
destination: string,
471471
ack = "auto",
472+
id: string = nil,
472473
headers: seq[ tuple[name: string, value: string] ] = @[] ): void =
473474
## Subscribe to messages at **destination**.
474475
##
@@ -482,7 +483,10 @@ proc subscribe*( c: StompClient,
482483
if not c.connected: raise newException( StompError, "Client is not connected." )
483484
c.socksend( "SUBSCRIBE" & CRLF )
484485
c.socksend( "destination:" & destination & CRLF )
485-
c.socksend( "id:" & $c.subscriptions.len & CRLF )
486+
if id.isNil:
487+
c.socksend( "id:" & $c.subscriptions.len & CRLF )
488+
else:
489+
c.socksend( "id:" & id & CRLF )
486490
if ack == "client" or ack == "client-individual":
487491
c.socksend( "ack:" & ack & CRLF )
488492
else:

stomp.nimble

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Package
22

3-
version = "0.1.2"
3+
version = "0.1.3"
44
author = "Mahlon E. Smith <[email protected]>"
55
description = "A pure-nim implementation of the STOMP protocol for machine messaging."
66
license = "MIT"

0 commit comments

Comments
 (0)