Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple subscription to topics #20

Closed
abhaytambe opened this issue Mar 15, 2018 · 4 comments
Closed

Multiple subscription to topics #20

abhaytambe opened this issue Mar 15, 2018 · 4 comments
Assignees
Labels

Comments

@abhaytambe
Copy link

abhaytambe commented Mar 15, 2018

Looks like the client fails to subscribe successfully to multiple topics. We receive a 1002 error code back on subscribing to the second topic.
i.e. Let's say, we have two topics to subscribe to, 'Topic ABC' and 'Topic DEF'. The client subscribes to topic 'Topic ABC' successfully, but we get a 1002 error back and the connection closes as soon as I subscribe to 'Topic DEF'. If we reverse the order of subscription, then the client subscribes to topic 'Topic DEF' successfully but fails while subscribing to second topic 'Topic ABC'.

This clearly confirms that there is an issue while subscribing to more than one topics

@abhaytambe
Copy link
Author

abhaytambe commented Mar 15, 2018

The issue lies in the 'StompClientLib' class, subscribe to destination header should have 'StompCommands.commandHeaderDestinationId' header with a unique value per subscription.
Please refer to the documentation from STOMP
https://stomp.github.io/stomp-specification-1.2.html#SUBSCRIBE

@WrathChaos WrathChaos self-assigned this Mar 16, 2018
@WrathChaos WrathChaos added the Bug label Mar 16, 2018
@WrathChaos
Copy link
Owner

Hello @abhaytambe I'm going to solve it in a week, thank you so much for feedback :) Also, remember that always welcome to PR :)

@deeksha-Goyal
Copy link

Hi WrathChaos!
Line No: 372 is creating issue.
let headers = [StompCommands.commandHeaderDestination: destination, StompCommands.commandHeaderAck: ack, StompCommands.commandHeaderDestinationId: ""]

I changed above mentioned line in StompClientLib.swift file to this :
let headers = [StompCommands.commandHeaderDestination: destination, StompCommands.commandHeaderAck: ack, StompCommands.commandHeaderDestinationId: destination]
This solved the issue for me. I hope it is correct logically also. Could you please verify it.

@WrathChaos
Copy link
Owner

Hello @abhaytambe,
I've updated the lib with your logic. Thank you so much for this contribution. Please try the new version : 1.2.4
Have fun!

@WrathChaos WrathChaos added Fixed and removed Bug labels Oct 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants