stompgem / stomp

A ruby gem for sending and receiving messages from a Stomp protocol compliant message queue. Includes: failover logic, ssl support.
http://stomp.github.com
Apache License 2.0
152 stars 80 forks source link

Is there any method to check if subscription is present? #169

Open sudeeptarlekar opened 3 years ago

sudeeptarlekar commented 3 years ago

Right now when we call unsubscribe on stomp client, if subscription is not present client raises an error. So is there any way or method by which we can check if subscription is present before calling the unsubscribe method?

Sample code.

$ stomp_client.subscriber?('/topic/xyz') # or stomp_client.subscriber?('/queue/XYZ')
=> true # or false

If this sounds good idea then I can create quick PR. Thoughts?

gmallard commented 3 years ago

At present what you are doing is the best that can be done.

Send the PR please.