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

287
Views
¿Cómo enviar un nombre de usuario al suscribirse con STOMP?

Tengo un cliente STOMP escrito en JS, que tiene este código:

 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); }); }); }

¿Hay alguna forma de enviar el nombre de usuario como parámetro/atributo al suscribirse? Ahora tengo la implementación DefaultHandshakeHandler con el método determineUser() :

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

Este método llama cuando JS stompClient se suscribe al tema. ¿Tiene alguna idea de cómo leer el nombre de usuario de él o, tal vez, existe alguna forma más popular?

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!