Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stomp isn't publishing the payload #610

Open
dipliee opened this issue Nov 5, 2023 · 0 comments
Open

Stomp isn't publishing the payload #610

dipliee opened this issue Nov 5, 2023 · 0 comments

Comments

@dipliee
Copy link

dipliee commented Nov 5, 2023

Using stompJs 7.0.0
After establishing a connection with my server, the client tries to publish a payload and the server doesn't receive anything. on the client side i get a log >>> SEND destination:undefined.
Also subscribed but nothing receiving on the client side after publishing.
>>> SUBSCRIBE id:sub-0 destination:/topic/broadcast
This is my setup on the client side :

$("#subscribe").click(function () {
    client.subscribe('/topic/broadcast', function (message) {
        const msg = JSON.parse(message.body);
        alert(msg);
    });
});

$("#send").click(function () {
    var chatMessage = {
        from: 'diogo',
        content: 'fdd',
        type: 'TEXT'
    };
    client.publish({
      destination: '/app/chat.sendMessage',
      body: JSON.stringify(chatMessage),
      headers: {'content-type': 'application/json'}
    });
});

On the server side im using spring boot with rabbitmq
Controller on the server side :

@MessageMapping("/chat.sendMessage")
    @SendTo("/topic/broadcast")
    fun sendMessage(@Payload message: ChatMessage): ChatMessage{
        println(message)
        return message
  }

Im on this for a about a 1 week plus a few days, read the docs but can't reach a conclusion on this, i have the correct endpoints, the rabbitmq is running and with the STOMPJs plugin and there is no update on message or queued charts in the rabbitmq, is this a configuration missing ? Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant