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

RxStomp - Not receiving any responses from watch subscription #553

Open
Ph4nt0mx4 opened this issue Aug 1, 2024 · 0 comments
Open

RxStomp - Not receiving any responses from watch subscription #553

Ph4nt0mx4 opened this issue Aug 1, 2024 · 0 comments

Comments

@Ph4nt0mx4
Copy link

Ph4nt0mx4 commented Aug 1, 2024

Hello!

I have an unusual problem with my WebSocket connection. I have created a WebSocket configuration and connection using RxStomp. While the connection itself works, and my backend recognizes that I'm connected, I am not receiving any messages from the backend despite being subscribed with .watch.

Here is my config

import { RxStompConfig } from '@stomp/rx-stomp';
import { environment } from '../../environments/environment';
import SockJS from 'sockjs-client';

export const rxStompConfig: RxStompConfig = {
  webSocketFactory: () => {
    return new SockJS(`${environment.ws}`);
  },

  heartbeatIncoming: 0,
  heartbeatOutgoing: 20000,
  reconnectDelay: 200,
  logRawCommunication: true,

  debug: (msg: string): void => {
    console.log('rxStomp console:', new Date(), msg);
  },
};

Here is the RxStomp service factory:

import { RxStompService } from './rx-stomp.service';
import { rxStompConfig } from './rx-stomp.config';

export function rxStompServiceFactory() {
  const rxStomp = new RxStompService();
  rxStomp.configure(rxStompConfig);
  rxStomp.activate();
  return rxStomp;
}

And in the component where I want to receive messages, I have the following code:

this.rxStompService.watch({ destination: `/destinedPath/${id}` }).subscribe(
  msg => {
    console.log('rxStompService msg body: ', msg.body);
    console.log('rxStompService msg: ', msg);
  },
  err => {
    console.log(err);
  }
);

As mentioned, the network and console indicate that the connection is valid, yet I do not receive any messages. Can anyone please help me?

@Ph4nt0mx4 Ph4nt0mx4 changed the title RxStomp not receiving any responses from watch subscription RxStomp - Not receiving any responses from watch subscription Aug 1, 2024
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