jsarafajr / spring-stomp-client Goto Github PK
View Code? Open in Web Editor NEWJava implementation of stomp client using Spring's sockets.
Java implementation of stomp client using Spring's sockets.
I have tried to pass the session id by setting the setSessionAttributes
create the headers.
StompHeaderAccessor headers = StompHeaderAccessor.create(StompCommand.SEND);
Map<String, Object> attributes = new HashMap<String, Object>();
attributes.put("SPRING.SESSION.ID", webSocketSession.getId());
headers.setSessionAttributes(attributes);
finaly produce GenericMessage below.
GenericMessage [payload=byte[281], headers={simpMessageType=MESSAGE, stompCommand=SEND, nativeHeaders={destination=[/app/application]}, simpSessionAttributes={SPRING.SESSION.ID=650c6384027749558e186429151d3834}, id=80dacd67-e4bd-390f-2717-01a38dcacf31, contentType=text/plain;charset=UTF-8, simpDestination=/app/application, timestamp=1522243488058}]
IMP: To send a message it should of type WebSocketMessage
WebSocketMessage one of subclass was TextMessage we convert the above generic message to TextMessage.
After convertion only the nativeHeaders are considered remaining were truncated.(this is the library implementation refer StompEncoder)
the above websocketsession was created by extending the TextWebSocketHandler used in the handshake with the websocketclient.
This is the final header reached to websocket server.
{simpMessageType=MESSAGE, stompCommand=SEND, nativeHeaders={destination=[/app/application], content-length=[281]}, simpSessionAttributes={}, simpHeartbeat=[J@7c33cdb6, lookupDestination=/application, simpSessionId=10e651e0ceeb4afc8c7b83ab6423a5f2, simpDestination=/app/application}
simpSessionAttributes is empty
please help..
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.