I have an issue with my chat app which using spring boot as backend and javaScript as front end, STOMP over webSocket (socketJS)

I try to send a message from user which subscribe on a specific chat using STOMP
and save the message to my database but it fail without give me any idication of error to solve it but after many tries I have been found that the message send not back to me to save it in my db. as shown blow

WebSocketConfig class

@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {

    @Override
    public void registerStompEndpoints(StompEndpointRegistry registry) {
        registry.addEndpoint("/ws").setAllowedOriginPatterns("*").withSockJS();
    }

    @Override
    public void configureMessageBroker(MessageBrokerRegistry registry) {
        registry.setApplicationDestinationPrefixes("/app")
                .enableSimpleBroker("/topic");
    }

}

websockt.js connectToChat function

function connectToChat(userId) {
    console.log("connecting to chat...")
    let socket = new SockJS(url + '/ws');
    // let socket=new WebSocket("wss://localhost:8080/ws")
    stompClient = Stomp.over(socket);
    stompClient.connect({"X-Authorization":"Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJVQmppQkZXYmM4NnpBaER0M1QtTUJ6cnl3R3FnYkF5QlFxYjRjN0w3VHpNIn0.eyJleHAiOjE2MzE1ODc4NzksImlhdCI6MTYzMDM3ODI3OSwianRpIjoiODAyZGQyYzAtNjlhYi00Yjk2LTllZjgtODA5YWY3MWJmNmFmIiwiaXNzIjoiaHR0cHM6Ly9rZXljbG9hay1kZXYuZ2l0c29sdXRpb25zLmlkL2F1dGgvcmVhbG1zL2dpdCIsImF1ZCI6Wy"}, function (frame) {
        console.log("connected to: " + frame);


        stompClient.subscribe("/topic/messages/"+userId, function (response) {
            let data = JSON.parse(response.body);
            // console.log("selectedUserOrGrup = "+selectedUserOrGrup)
            // console.log("data.fromLogin = "+data.fromLogin)
            if (selectedUserOrGrup == data.userId) {
                console.log("selectedUserOrGrup === data.fromLogin")

                let messageTemplateHTML = "";
                messageTemplateHTML = messageTemplateHTML + '<div id="child_message" class="d-flex justify-content-end mb-4">'+
                    '<div id="child_message" class="msg_cotainer_send">'+data.message+
                    '</div>'+
                    '</div>';
                $('#formMessageBody').append(messageTemplateHTML);
                console.log("append success")
            } else {
                // console.log("data.group_id "+data.group_id)
                newMessages.set(data.userId, data.message);
                $('#userNameAppender_' + data.userId).append('<span id="newMessage_' + data.userId + '" style="color: red">+1</span>');

                console.log("kebuat")
                let messageTemplateHTML = "";
                messageTemplateHTML = messageTemplateHTML + '<div id="child_message" class="d-flex justify-content-end mb-4">'+
                    '<div class="msg_cotainer_send">'+data.message+
                    '</div>'+
                    '</div>';
                $('#formMessageBody').append(messageTemplateHTML);
                console.log("append success")
            }
        },{});


        $.get(url + "/chats/user/"+userId, function (response) {
            let chats = response;
            for (let i = 0; i < chats.length; i++) {
                // console.log(groups[i]['name'])
                stompClient.subscribe("/topic/messages/chat/" + chats[i]["id"], function (response) {
                    let data = JSON.parse(response.body);
                    console.log("selectedUserOrGrup = "+selectedUserOrGrup)
                    console.log("data.group_id = "+data.chatId)
                    console.log("------------------------------------ : masuk get message group")
                    if (selectedUserOrGrup == data.chatId) {
                        console.log("selectedUserOrGrup === data.fromLogin")

                        let messageTemplateHTML = "";
                        messageTemplateHTML = messageTemplateHTML + '<div id="child_message" class="d-flex justify-content-end mb-4">'+
                            '<div id="child_message" class="msg_cotainer_send">'+data.message+
                            '</div>'+
                            '</div>';
                        $('#formMessageBody').append(messageTemplateHTML);
                        console.log("append success")
                    } else {
                        newMessages.set(data.chatId, data.message);
                        $('#userGroupAppender_' + data.chatId).append('<span id="newMessage_' + data.groupId + '" style="color: red">+1</span>');

                        console.log("kebuat")
                        let messageTemplateHTML = "";
                        messageTemplateHTML = messageTemplateHTML + '<div id="child_message" class="d-flex justify-content-end mb-4">'+
                            '<div class="msg_cotainer_send">'+data.message+
                            '</div>'+
                            '</div>';
                        console.log("append success")
                    }
                })
            }
        });
    },onError);
}

on original project when send message the console print this
enter image description here

But on my project when I send message the console only print >>> Send only as show so why?
enter image description here

Finally Hope you help me to solve this issue if you can
Thanks

I try to send message from user to chat which subscribed to it, so save it in my db and send it to all users in the same chat.