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

Allow SockJsUrlInfo to be overridden in SockJsClient #25888

Closed
OverDrone opened this issue Oct 9, 2020 · 2 comments
Closed

Allow SockJsUrlInfo to be overridden in SockJsClient #25888

OverDrone opened this issue Oct 9, 2020 · 2 comments
Assignees
Labels
in: messaging Issues in messaging modules (jms, messaging) type: enhancement A general enhancement
Milestone

Comments

@OverDrone
Copy link

OverDrone commented Oct 9, 2020

Trying to open sockjs connection using spring SockJsClient. My sockjs server is in production environment and uses serverId mapping. SockJsClient does not allow serverId and implicitly generates some random value (SockJsUrlInfo.getServerId). Allow some customization to pass serverId explicitly. I can't even extend SockJsClient because it does not contain any methods or constructors to override.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 9, 2020
@rstoyanchev rstoyanchev added the in: messaging Issues in messaging modules (jms, messaging) label Nov 10, 2021
@snicoll snicoll changed the title SockJsClient does not allow to set serverId Allow SockJsUrlInfo to be overridden in SockJsClient Sep 27, 2023
@snicoll
Copy link
Member

snicoll commented Sep 27, 2023

Thanks for the suggestion. It looks like that offering a protected method in SockJsClient that allows to create your own SockJsUrlInfo based on the url could be a good way out.

@snicoll snicoll added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 27, 2023
@snicoll snicoll added this to the 6.x Backlog milestone Sep 27, 2023
@OverDrone
Copy link
Author

OverDrone commented Sep 27, 2023

Yes, something like that.

  1. SockJsClient protected method: SockJsUrlInfo buildUrlInfo(URI url) which should be called from SockJsClient.execute instead of new SockJsUrlInfo(URI url)
  2. Add constructor SockJsUrlInfo(URI url, String serverId)
    and a little optimization: assign serverId in constructor SockJsUrlInfo(URI url) instead of lazy calculating it in getServerId because this method will be called anyway.

I can create PR if you like.

@jhoeller jhoeller modified the milestones: 6.x Backlog, 6.1.3 Dec 28, 2023
@jhoeller jhoeller self-assigned this Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: messaging Issues in messaging modules (jms, messaging) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

5 participants