Skip to content

Subscribe to a topic that received data too soon, not called its callback method #168

Open
@cedb777

Description

@cedb777

Hello,

I have a connection to a websocket.

// Connect to the socket server stompClient = Stomp.over(Stomp.ConnectionProvider.OKHTTP, urlSocket, httpHeader); stompClient.withClientHeartbeat(10000); stompClient.withServerHeartbeat(10000); stompClient.connect();

After that, i subscribe to topics and all is working, example :

stompClient.topic(TOPIC_REPLIES).subscribe(topicMessage -> { String result = topicMessage.getPayload(); socketDataManager.parseResultJson(result); });

But, for one topic, I have to receive data when I subscribe to it.
But the callback of the subscribe method is never called ("RESULT FOR THIS TOPIC")

stompClient.topic("/exchange/not/working/topic").subscribe(topicMessage -> { Log.i(TAG, "RESULT FOR THIS TOPIC"); });

I think that I receive the data too soon and so my client is not able to receive the data at the moment it receives it (If the topic is called later, it works fine).
Anyone has had the same issue? Is it a solution to receive the data directly when I subscribe ?

Thank you for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions