-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
unsubscribe socketclient #14
Comments
Hello @krunalbhavsar, |
Yes, It's an issue with subscription name but It doesn't accept the same string string I used to subscribe specific channel. For example:
Here unsubcribe responds me an error: No subscription matched As I analyzed from Subscribe and receive messages, subscription (a subscribe method) returns a string (subscription channel id) from server, that we need to store somewhere at client side (in our project/code) and we need to use the same string to unsubscribe. This is not an iOS (swift) code but a sample that available in above link and we implemented in web application:
So, is this only the method/possible way, for subscription and unsubscription. If yes, then we do not have any value returning to Can you please provide a sample code block, guiding me, how can I successfully unsubscribe from destination topic. I've almost implemented this library 'StompClientLib' in my project and everything works fine except 'unsubcribe'. As an alternate solution to this issue, I disconnect client from server and reconnect again + subscribe all other destinations again. And this is not a proper way to handle but I have only this solution at this time. Thanks you for your response. Please help to find out solution for this problem. Krunal |
@krunalbhavsar Hello again, |
With this code, I can subscribe correctly.
But when I try to unsubscribe, using the same destination string, it replies with an error.
:( |
Here I found a proper (working) solution: https://stackoverflow.com/questions/48472473/stompclientlib-unsubscribe-socketclient/48769453#48769453
|
@krunalbhavsar I'm glad to find the working solution. I will add it to the ReadME part. |
socketClient?.unsubscribe(destination: "destination string is same as subscribe destination string")
Unsubscription of destination gives following error:
"org.apache.activemq.transport.stomp.ProtocolException: No subscription matched.\r\tat org.apache.activemq.transport.stomp.ProtocolConverter.onStompUnsubscribe(ProtocolConverter.java:734)\r\tat org.apache.activemq.transport.stomp.ProtocolConverter.onStompCommand(ProtocolConverter.java:262)\r\tat org.apache.activemq.transport.ws.AbstractStompSocket.processStompFrame(AbstractStompSocket.java:151)\r\tat org.apache.activemq.transport.ws.jetty9.StompSocket.onWebSocketText(StompSocket.java:96)\r\tat org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onTextMessage(JettyListenerEventDriver.java:128)\r\tat org.eclipse.jetty.websocket.common.message.SimpleTextMessage.messageComplete(SimpleTextMessage.java:69)\r\tat org.eclipse.jetty.websocket.common.events.AbstractEventDriver.appendMessage(AbstractEventDriver.java:64)\r\tat org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onTextFrame(JettyListenerEventDriver.java:122)\r\tat org.eclipse.jetty.websocket.common.events.AbstractEventDriver.incomingFrame(AbstractEventDriver.java:160)\r\tat org.eclipse.jetty.websocket.common.WebSocketSession.incomingFrame(WebSocketSession.java:309)\r\tat org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame(ExtensionStack.java:214)\r\tat org.eclipse.jetty.websocket.common.Parser.notifyFrame(Parser.java:220)\r\tat org.eclipse.jetty.websocket.common.Parser.parse(Parser.java:258)\r\tat org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:628)\r\tat org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:476)\r\tat org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)\r\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)\r\tat org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)\r\tat java.lang.Thread.run(Unknown Source)\r")
The text was updated successfully, but these errors were encountered: