Does it make sense to create promise from StompClient SEND request?

360 views Asked by At

I want to make additional request to server after SEND message through StompClient was successfully maintained.

function sendActivity() {
        connected.promise.then(function () {
            stompClient
                .send('/app/activity',
                    {},
                    angular.toJson(/*some data*/));
        }).finally(function () {
            /*additional Rest request to Server */
        });
    }

It's currently working on my local machine but i'm not sure that operations are working synchronously as i wanted. Could you please assist with my sitiation?

1

There are 1 answers

0
Majid On

Not really. It's better to wait for ack from server for your 'app/activity' message and then do other stuffs.