Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

279
Views
How to send username on subscribe with STOMP?

I have STOMP client written on JS, which have this code:

function connect() {
    var socket = new SockJS('/our-websocket');
    stompClient = Stomp.over(socket);
    stompClient.connect({}, function (frame) {
        console.log('Connected: ' + frame);
        stompClient.subscribe('/user/topic/private-messages', function (message) {
            showMessage(JSON.parse(message.body).content);
        });
    });
}

Is any way to send username as parameter / attribute on subscribe? Now I have DefaultHandshakeHandler implementation with determineUser() method:

override fun determineUser(
    request: ServerHttpRequest,
    wsHandler: WebSocketHandler,
    attributes: MutableMap<String, Any>
): Principal? {
    return super.determineUser(request, wsHandler, attributes)
}

This method calls when JS stompClient subscribes topic. Have any idea how to read username from it, or, maybe, any most popular way exists?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!