1

I am using Spring 4 websocket with RabbitMQ and STOMP. My broker xml is :

<websocket:message-broker application-destination-prefix="/app">
    <websocket:stomp-endpoint path="/ws">
      <websocket:sockjs/>
    </websocket:stomp-endpoint>
     <websocket:stomp-broker-relay prefix="/topic"
           relay-host="${websocket.relay.host}" relay-port="61613" client-login="XXXX" client-passcode="XXXX" system-login="XXXX" system-passcode="XXXX"
           heartbeat-send-interval="20000" heartbeat-receive-interval="20000"/>
     <!-- <websocket:simple-broker prefix="/topic"/> -->

     <websocket:client-inbound-channel>
<websocket:executor core-pool-size="50" max-pool-size="100" queue-capacity="100" keep-alive-seconds="60"/>
</websocket:client-inbound-channel>
<websocket:client-outbound-channel>
<websocket:executor core-pool-size="50" max-pool-size="100" queue-capacity="100" keep-alive-seconds="60"/>
</websocket:client-outbound-channel>
<websocket:broker-channel>
<websocket:executor core-pool-size="50" max-pool-size="100" queue-capacity="100" keep-alive-seconds="60"/>
</websocket:broker-channel>

  </websocket:message-broker>

Messages are getting lost on client intermittently. I have used SimpMessagingTemplate to forward message to broker.

I have also configured size for text as :

<beans:bean class="org.springframework.web.socket.server.standard.ServletServerContainerFactoryBean ">
        <beans:property name="maxTextMessageBufferSize" value="8192000"/>
        <beans:property name="maxBinaryMessageBufferSize" value="8192000"/>
    </beans:bean>

I am not able to understand whther messages are getting lost from Server to Broker or broker to browser.

Any Help will be appreciated.

Vineet Kasat
  • 994
  • 7
  • 14
  • Did you try to debug your application? – Maksym Nov 18 '14 at 11:36
  • Actually Its PROD , so I cant put it on remote debug, but there are logs which suggest that application tried to push the results using simpmessaging template. – Vineet Kasat Nov 18 '14 at 11:48
  • @Vineet I am trying to use RabbitMQ on my localhost, but having hard time with it, can you give me any pointers regarding that – Pankaj Nimgade Nov 18 '14 at 14:10
  • 1
    @PankajNimgade Sure. Please share your problem – Vineet Kasat Nov 19 '14 at 07:06
  • @Vineet Thanks for your response, I got that code working in android, by the way can you tell me how can I run a java code on server – Pankaj Nimgade Nov 19 '14 at 07:10
  • 1
    @PankajNimgade you can run Java code by building an executable jar file or you can build a war and deploy in a container like Tomcat. – Vineet Kasat Nov 21 '14 at 09:37
  • @VineetKasat , I have just done that. I am running a jar file in my localhost with factory.host("localhost"), everything runs fine, but in my java code I get "127.0.0.1 (port 5672): connect failed: ECONNREFUSED (Connection refused)" and this is happening in my android code – Pankaj Nimgade Nov 21 '14 at 09:46

1 Answers1

0

If your client or server message size is using the standard 8Kb (8192 bytes) you can increase the size by following this:

Java SockJS Spring client and message size Java SockJS Spring client and message size

atom88
  • 1,449
  • 3
  • 22
  • 32