Open Closed

Use SignalR for catch messages #8015


User avatar
0
in4tek.abp created

Hi, we need to import the SignalR service to manage the messages of application. The connection run succesfully, but when I send a message, the Agular client don't show it. This is the client code:

  constructor(
    public readonly alarmService: MachineAlarmService,
    public readonly machineCommonService: MachineCommonCommandService,
    public sharedService: SharedService,
  ) {
    this.connection = new signalR.HubConnectionBuilder()
    .withUrl(`https://localhost:44351/signalr-hubs/chat`, {
      accessTokenFactory: () => this.oAuthService.getAccessToken(),
    })
    .build();

  this.connection.on('BroadcastMessage', this.handleMessage);

  this.connection
    .start()
    .then(() => {
      console.log('Connection started');
    })
    .catch(err => console.error(err.toString()));
  }

  handleMessage = (message: any) => {
    this.messageList.push(message);
    console.log('deneme');
    console.log(message);
  };
  • ABP Framework version: v7.1
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

9 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    Could you share a minimal reproducible project with me? i will check it.

    My email is shiwei.liang@volosoft.com

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    in4tek.abp created

    Hi, I sent the link to download the files with wetransfer. Thank you

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    Sorry, I didn't get the email from wetransfer

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    in4tek.abp created

    Hi, try this please.

    https://we.tl/t-E---

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    I could not build the solution.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    in4tek.abp created

    Hi, sorry... try to exclude DevExpress reference; it's a thirdpart software, but isn't necessary for the test. We used it to other funcionality

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Sorry, I'm confused.

    You defined a method on the angular side but never called it from the back end.

    You can check this https://medium.com/@gabrielbastosdeveloper/real-time-application-development-with-signalr-and-angular-74c7d869afaf

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    in4tek.abp created

    HI, we solved it, thanks for the support!

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    good : )

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.