Skip to content

Commit

Permalink
Return old subscribe method without headers
Browse files Browse the repository at this point in the history
  • Loading branch information
NaikSoftware committed Nov 27, 2016
1 parent 4664650 commit 125acb5
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ public void disconnect() {
mConnected = false;
}

public Observable<StompMessage> topic(String destinationPath) {
return topic(destinationPath, null);
}

public Observable<StompMessage> topic(String destinationPath, List<StompHeader> headerList) {
return Observable.<StompMessage>create(subscriber -> {
Set<Subscriber<? super StompMessage>> subscribersSet = mSubscribers.get(destinationPath);
Expand Down Expand Up @@ -183,9 +187,7 @@ private void subscribePath(String destinationPath, List<StompHeader> headerList)
headers.add(new StompHeader(StompHeader.ID, topicId));
headers.add(new StompHeader(StompHeader.DESTINATION, destinationPath));
headers.add(new StompHeader(StompHeader.ACK, DEFAULT_ACK));
for(StompHeader header : headerList){
headers.add(header);
}
if (headerList != null) headers.addAll(headerList);
send(new StompMessage(StompCommand.SUBSCRIBE,
headers, null));
}
Expand Down

0 comments on commit 125acb5

Please sign in to comment.