spring integration - How do I use the StompSubProtocolHandler with the int-websocket:client-container -


i have basic setup websocket stomp client. problem stompsubprotocolhandler, websocketinboundchanneladapter , websocketoutboundmessagehandler treat messages if application server.

the messages special treatment depending on whether inbound or outbound.

for example, send message through outbound-channel-adapter simpmessagetype="connect" , stompsubprotocolhandler's handlemessagetoclient [thankfully] not supposed connect message because not expect such message sent.

then connected [connect_act] message comes , handled stompsubprotcolhandler's handlemessagefromclient function. function doesn't know connected frame , instead of publishevent attempts send message outputchannel. ok except websocketinboundchanneladapter aware of simpmessagetypes , ignores message because not "message" type.

i feel there must kind of client side websocket channel adapters don't know about. feel there must kind of stompsubprotocolhandler designed client in mind well. there not lot of examples applications using int-websocket:client-container , @ loss of do.

can please me understand need handle stomp messages websocket client?

<int-websocket:client-container id="websocketclientcontainer"                                 client="websocketstompclient"                                  uri="ws://localhost:8080/stomp" />  <bean id="stompsubprotocolhandler"       class="org.springframework.web.socket.messaging.stompsubprotocolhandler"/>  <int-websocket:inbound-channel-adapter               channel="receivemessage"              container="websocketclientcontainer"              default-protocol-handler="stompsubprotocolhandler"/>  <int:channel id="receivemessage" />  <int:service-activator ref="websocketstompclient"           method="receivenotification"           input-channel="receivemessage"           output-channel="nullchannel" />  <int-event:inbound-channel-adapter        event-types="org.springframework.web.socket.messaging.abstractsubprotocolevent"       payload-expression="message"       channel="routestompevents"/>  <int:channel id="routestompevents" />  <int:router ref="stompinboundmessagetyperouter"                 method="routestompmessage"                 input-channel="routestompevents"                  default-output-channel="nullchannel"                  resolution-required="false" /> 

well, want confirm connect message <int-websocet:outbound-channel-adapter> client side works well.

we have missed handle stompcommand.connected in websocketinboundchanneladapter client side, looks should emitted sessionconnectedevent confirmation server.

another missed stomp frame stompcommand.receipt, should emitted new stompreceiptevent.

feel free raise jira issue on matter, , we'll take stomp-chat afterwards add java client well.

more smooth integration stopm client can address new int-stopm components.

update

the jira on matter: https://jira.spring.io/browse/int-3686 support stomp protocol adapters have ticket: https://jira.spring.io/browse/int-3685


Comments

Popular posts from this blog

java - Could not locate OpenAL library -

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

sorting - opencl Bitonic sort with 64 bits keys -