zyro23 / grails-spring-websocket

93 stars 28 forks source link

Unable to receive messages after sending an acknowledgment to external broker #38

Closed helgew closed 8 years ago

helgew commented 8 years ago

My requirements include the sending of acknowledgements once a message is received. My understanding from the documentation is that this requires an external broker. After installation and configuration of RABITMQ, clients are able to send and receive messages as long as they do not send an acknowledgement. Once an acknowledgement is sent, no further messages are received on either the client or the remote broker.The controller method is being called though when the client tries to send.

To illustrate, I have created a project at https://github.com/helgew/grails-websocket-example .

zyro23 commented 8 years ago

just sent a pr to your sample that uses a queue instead of a topic.

if you take a look at the rabbitmq console you will see that now an actual named queue is being used instead of the direct topic exchange amq.topic.

explicitly acking / nacking a message does not really make sense on a topic exchange given its publish/subscribe characteristics anyway, i guess?

update: even if i am not sure what a good use case would be for explicit ack/nack on a topic destination, i tried changing /queue/hello back to /topic/hello and even that works fine as well (ack/nack/do nothing).

hth.

zyro23 commented 8 years ago

seems to be solved according to slack feedback. root cause was putting ack: 'client' into the connection headers instead of the subscription headers of the stomp.js client where it belongs.