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

Support UNSUBSCRIBE for a durable STOMP subscription [SPR-15131] #19697

Closed
spring-projects-issues opened this issue Jan 11, 2017 · 4 comments
Closed
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jan 11, 2017

Jon Kranes opened SPR-15131 and commented

For Artemis ActiveMQ, durable subscriptions in STOMP are implemented by adding the header "durable-subscription-name" in the SUBSCRIBE and UNSUBSCRIBE frames. Using current Spring it is possible to add the header when subscribing, but once the subscription is created there does not seem to be any way to unsubscribe from the durable subscription (other than manually constructing the necessary STOMP frame). To add this feature, the org.springframework.messaging.simp.stomp.DefaultStompSession.DefaultSubscription class would need to be extended to track the durable subscription name so that it could be passed back in the UNSUBSCRIBE frame when unsubscribe() is called.

Since the header name string (for example "durable-subscription-name" used by ActiveMQ-Artemis) is not a standard value this would need to be specified when the original subscription is made.


Affects: 4.3.5

Referenced from: commits 60517b2

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jan 17, 2017

Rossen Stoyanchev commented

We can update StompSession.Subscription to expose the headers used for SUBSCRIBE as well as to provide an additional unsubscribe that accepts StompHeaders so you can then easily manage this. Does that make sense to you?

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jan 18, 2017

Jon Kranes commented

Yes, I think the use case is satisfied if:

  1. StompSession.Subscription saves a copy of headers used in making the subscription, and exposes a method for accessing these headers
  2. Unsubscribe() allows for optional specification of ADDITIONAL user specified headers. (I would not want to have to repeat the headers normally sent with the UNSUBSCRIBE).

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jan 18, 2017

Rossen Stoyanchev commented

Yes, precisely what I had in mind. It's how it works for the other methods that take StompHeaders. Thanks!

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jan 31, 2017

Rossen Stoyanchev commented

See commit 60517b.

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.0 M5 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants