Hi, I'm working on a SignalR project and I prefer not to use a distributed event bus. I've looked at ABP samples where one uses a distributed event bus and the other only relies on the web layer. Is it feasible to implement SignalR in a distributed architecture without using an event bus?
-
ABP Framework version: v8.1.3
-
UI Type: MVC
-
Database System: EF Core (Oracle)
-
Tiered (for MVC) or Auth Server Separated (for Angular): yes tiered
16 Answer(s)
-
0
Hi,
Yes, you can use SignalR for two-way communication.
-
0
https://volosoft.com/blog/RealTime-Messaging-Distributed-Architecture-Abp-SingalR-RabbitMQ
For example, I couldn't manage this without distributed event bus.
-
0
This example combines distributed events and SignalR.
You can use SignalR directly
-
0
Do you have any example basic project ?
-
0
-
0
Hi, I prepare a basic abp mvc project.
this is github link: https://github.com/Ibrahimsrgz/BasicSignalRApp.gitas you know in mvc we dont have access token provider and in this example i dont want to check access provider. so i changed api.host.module a bit.
unfortuanaly i am getting
-
0
HI,
we have an MVC example, too.
https://github.com/abpframework/abp-samples/tree/master/SignalRTieredDemothis is github link: https://github.com/Ibrahimsrgz/BasicSignalRApp.git
please private the repo, it's includes your lien
AbpLicenseCode
-
0
I know this MVC example. The thing is i need hub in the application layer. in this example it is in web layer.
-
0
You can try
/signalr-hubs/chat
-
0
I also try it and it gives same error
-
1
add me to the repo, i will check it
my github username is realLiangshiwei
-
0
Have you had a chance to review it?
-
0
You add the
ChatHub
in theHttpAPI.Host
project, the client(web) needs to connect to theHttpAPI.Host
You used the wrong urlSee my commit: https://github.com/Ibrahimsrgz/BasicSignalRApp/compare/fix?expand=1
-
0
Thanks a lot for your response and help. It works now when its allowed for anonymous
in security part, i change hub.cs allowanonymous to Authorize and i am getting
I pushed my repo.
-
0
you need to pass the access_token
for example:
public class IndexModel : IndexModelBase { public string Token { get; set; } public IndexModel(IChatsAppService chatsAppService) : base(chatsAppService) { } public override async Task OnGetAsync() { Token = await HttpContext.GetTokenAsync("access_token"); } }
@section scripts { <script> var token = '@Model.Token'; </script> <abp-script src="/Pages/Chats/index.js" /> <abp-script type="typeof(SignalRBrowserScriptContributor)" /> @*//<suite-custom-code-block-2>*@ @*//</suite-custom-code-block-2>*@ }
var connection = new signalR.HubConnectionBuilder().withUrl("https://localhost:44367/signalr-hubs/chat?access_token="+token).build();
-
0
Thank you, I get it.