-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Questions
Do not use this issue tracker to ask questions, instead use one of these channels. Questions will likely be closed without notice.
Version
Which version(s) did you encounter this bug ?
4.4.5
Context
In StompClientConnectionImpl class when an unsubscribe call is received, it is removed from client cache "List subscriptions" before sending the UNSUBSCRIBE frame. When this call is failed at server side, client cache doesn't have the subscription due to which we are receiving events and we cannot make another unsubscribe call as StompClientConnectionImpl would return an IllegalArgumentException
vertx-stomp/src/main/java/io/vertx/ext/stomp/impl/StompClientConnectionImpl.java
Lines 357 to 361 in 5522779
| if (maybeSubscription.isPresent()) { | |
| final Subscription subscription = maybeSubscription.get(); | |
| subscriptions.remove(subscription); | |
| send(new Frame(Command.UNSUBSCRIBE, headers, null), receiptHandler); | |
| return this; |
Same goes for subscribe as well.
vertx-stomp/src/main/java/io/vertx/ext/stomp/impl/StompClientConnectionImpl.java
Lines 313 to 326 in 5522779
| subscriptions.add(new Subscription(destination, id, handler)); | |
| headers.put(Frame.DESTINATION, destination); | |
| if (!headers.containsKey(Frame.ID)) { | |
| headers.put(Frame.ID, id); | |
| } | |
| Frame frame = new Frame(Command.SUBSCRIBE, headers, null); | |
| send(frame, ar -> { | |
| if (receiptHandler != null) { | |
| receiptHandler.handle(ar.map(id)); | |
| } | |
| }); |