WrathChaos/StompClientLib

SendJSONForDict error

iOSDias opened this issue · 18 comments

        let dict: [String: Any] = [
            "text": text,
            "chatId": chatId,
            "isReply": false
        ]
        socketClient.sendJSONForDict(dict: dict as AnyObject, toDestination: sendMessagePath)

Use this method to send message in chat, server do not receive any message, but didReceiveMessageWithJSONBody method called when someone send message from android client

Basically, you cannot send any message via StompClientLib but you can receive the message from the server. Am I right?
Can you share with me an example project which I can work on it?

@WrathChaos I create test repo with test project that has identical steps and not working
https://github.com/iOSDias/SocketTest.git

@WrathChaos I am really waiting for your help, because I do not understand what happens, earlier the same code working fine with sending endpoints

@iOSDias working on it. Can you try it with 1.2.7 version of StompClientLib?

@iOSDias sorry, could you explain what you mean about "working on it"? You check on my test project? Ok, I try with 1.2.7

@iOSDias Hello again :) I've tested your test project. You were using the 1.3.0 version. I updated it to the latest(currently 1.3.4) and it works fine. Can you try it with 1.3.4?

Screenshot 2019-07-23 at 11 00 19

It works fine on me. By the way, I love your SocketManager class. Nice work :)

@WrathChaos Hello, I am using the 1.3.0 version, because on the main project I use it, but on the main I also update it to 1.3.4 and it does not work, Yes, according to screenshot it send message, because of printing data, but I mean it does not work because I do not get this sended message from server in didReceiveMessageWithJSONBody as the result that it is processed by my getMesssageList subscription

Oh, I got it. Okay, let me test it deeply then.

@WrathChaos Ok, let me know about results

@iOSDias I found the error at least the source of the problem. I need you to send me the unhandled exception message from the server. After I send the message from my sendMessage method. It should return a message about what is wrong. Can you send it to me?

@WrathChaos during testing with the server, the backendor told me that from the client to the server nothing comes up, because he does not see this in the logs

@iOSDias I tested the "sendJSONForDict" method on my test server and it works totally fine also, "stompClientJSONBody" delegate method received the message with totally fine. I guess your backend server has a problem with it.

@WrathChaos what could be the problem and how can i prove to the backendor that the problem is in the server, since the android client using another library interacts with the server normally?

You need to debug what is coming or going on the backend side. I tested it with 3 different servers which are working on multiple platforms. I could receive the message from all servers. Also, tested the deep inside code, which is working perfectly at 1.3.4.

@WrathChaos Okey, thanks

@WrathChaos Could you send me some information(url, etc) about your test server to check it on my side and show backendor the screenshots?

@iOSDias Unfortunately I could not share it because of company privacy & policy. However, you can find any simple Stomp Server example on the internet easily.