Hi,
I am aware of the local event bus. However would prefer to use the conventional EventHandler<TEventArgs> delegate to set up events as some other parts of our application has used those and we would like to ensure code consistency.
Are you able to provide any insights as to why the dependency injection was failing?
Thanks
Error messages
[10:59:10 INF] Executing endpoint '/signalr-hubs/messaging'
[10:59:11 ERR] Error when dispatching 'OnConnectedAsync' on hub.
Autofac.Core.DependencyResolutionException: An exception was thrown while activating Castle.Proxies.MessagingHubProxy -> Eduverse.WebRtc.CommunicationService.
---> Autofac.Core.DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(Microsoft.Extensions.Logging.ILogger`1[Eduverse.WebRtc.CommunicationService], Eduverse.WebRtc.IWebRtcDispatcher, Eduverse.SpeechToText.ISpeechToText, Microsoft.Extensions.Options.IOptions`1[Eduverse.WebRtc.WebRtcOptions], Eduverse.DialogueManagers.IDialogueManagersAppService)' on type 'CommunicationService'.
---> System.InvalidOperationException: Method may only be called on a Type for which Type.IsGenericParameter is true.
at System.RuntimeType.get_DeclaringMethod()
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
--- End of inner exception stack trace ---
at Autofac.Core.Activators.Reflection.BoundConstructor.Instantiate()
at Autofac.Core.Activators.Reflection.ReflectionActivator.<>c__DisplayClass14_0.<UseSingleConstructorActivation>b__0(ResolveRequestContext context, Action`1 next)
at Autofac.Core.Resolving.Middleware.DisposalTrackingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
at Autofac.Builder.RegistrationBuilder`3.<>c__DisplayClass41_0.<PropertiesAutowired>b__0(ResolveRequestContext context, Action`1 next)
at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context,
Action`1 next)
--- End of inner exception stack trace ---
at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context,
Action`1 next)
at Autofac.Builder.RegistrationBuilder`3.<>c__DisplayClass35_0.<OnPreparing>b__0(ResolveRequestContext context, Action`1 next)
at Autofac.Core.Resolving.Middleware.CoreEventMiddleware.Execute(ResolveRequestContext context, Action`1 next)
at Autofac.Core.Lifetime.LifetimeScope.CreateSharedInstance(Guid id, Func`1 creator)
at Autofac.Core.Lifetime.LifetimeScope.CreateSharedInstance(Guid primaryId, Nullable`1 qualifyingId, Func`1 creator)
at Autofac.Core.Resolving.Middleware.SharingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
at Autofac.Core.Resolving.Middleware.CircularDependencyDetectorMiddleware.Execute(ResolveRequestContext context, Action`1 next)
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, ResolveRequest& request)
at Autofac.Core.Resolving.ResolveOperation.ExecuteOperation(ResolveRequest& request)
at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance)
at Autofac.ResolutionExtensions.ResolveOptionalService(IComponentContext context, Service service, IEnumerable`1 parameters)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
at Microsoft.AspNetCore.SignalR.Internal.DefaultHubActivator`1.Create()
at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.OnConnectedAsync(HubConnectionContext connection)
at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.OnConnectedAsync(HubConnectionContext connection)
at Microsoft.AspNetCore.SignalR.HubConnectionHandler`1.RunHubAsync(HubConnectionContext connection)
[10:59:11 INF] Executed endpoint '/signalr-hubs/messaging'
Code snippets: Communication Service injected into MessagingHub
[Authorize(Roles = DefaultRoleConsts.Learner)]
[DisableConventionalRegistration]
public class MessagingHub : AbpHub
{
private readonly ILogger<MessagingHub> _logger;
private readonly ICommunicationService _communicationService;
public MessagingHub(
ILogger<MessagingHub> logger,
ICommunicationService communicationService,
IUnitOfWorkManager unitOfWorkManager
)
{
_logger = logger;
_communicationService = communicationService;
}
CommunicationService snippet
public class CommunicationService : ICommunicationService
{
private readonly ILogger<CommunicationService> _logger;
private readonly ISpeechToText _stt;
private readonly IWebRtcDispatcher _dispatcher;
private readonly IDialogueManagersAppService _dialogueManagersAppService;
public CommunicationService(ILogger<CommunicationService> logger,
IWebRtcDispatcher dispatcher,
ISpeechToText stt,
IOptions<WebRtcOptions> options,
IDialogueManagersAppService dialogueManagersAppService)
{
_logger = logger;
_dispatcher = dispatcher;
_stt = stt;
_dialogueManagersAppService = dialogueManagersAppService;
// SetupHandler();
_dialogueManagersAppService.OnChatResponseChunkReceived += (sender, evt) => {
_dispatcher.GetWebRtcPeerConnectionFromConversationId(evt.ConversationId, out var peerConnection);
if(peerConnection == null){
_logger.LogError("PeerConnection not found for conversationId: {conversationId}", evt.ConversationId);
return;
}
var message = new { type = "chatChunk", data = evt.Text };
var jsonString = JsonSerializer.Serialize(message);
peerConnection.SendData(jsonString);
};
DialogueManager Snippet
[RemoteService(IsEnabled = false)]
public class DialogueManagersAppService : EduverseAppService, IDialogueManagersAppService
{
protected IConversationLogRepository _conversationLogRepository;
protected ConversationLogManager _conversationLogManager;
protected IConversationRepository _conversationRepository;
protected ConversationManager _conversationManager;
protected IFeedbackLogRepository _feedbackLogRepository;
protected FeedbackLogManager _feedbackLogManager;
protected IScenarioRepository _scenarioRepository;
private readonly IUnitOfWorkManager _unitOfWorkManager;
protected ILlmService _llmService;
public event EventHandler<ChatResponseChunkEventArgs>? OnChatResponseChunkReceived;
public event EventHandler<ChatResponseEndedEventArgs>? OnChatResponseEnded;
Specifically, we want TenantId property to be available on OpenIdApplication table. We want to be able to map openIdapplication based on tenantId. We also need it to be visible on the Create / Update and View UI screens
thanks,
fyi managed to solve new question issue by removing
serverBuilder.SetIssuer(new Uri(configuration["AuthServer:Authority"]!));
Also, do you happen to know the change you made in this ticket: https://abp.io/qa/questions/7297/3a130461-8b69-1a8a-743f-133fccbac906
We are having the exact same issue whereby the issuer still defaults to the main domain of the backend (api.mydomain.com) instead of the subdomain (tenant.api.mydomain.com).
Hi managed to get it resolved. We realised that as part of our CI/CD pipeline, we were running dotnet publish "MyApp.sln"
During the creation of artifacts, the last project to be published is NOT the HttpApi.Host
project. Hence, appsettings.json
for HttpApi.Host
was overwritten by another project appsettings.json
.
The resolution was to only publish the needed artifact
i.e. dotnet publish "MyApp.HttpApi.Host/MyApp.HttpApi.Host.csproj"
Note: the commands are not exactly as used in our project but conveys the idea (we also added flags such as -c Release etc)
Will post the results here soon
I understand that we can change certain settings in the appsetings.json
. This applies the default settings to the host and tenant level.
"Settings": {
"Abp.Identity.User.IsUserNameUpdateEnabled": false,
"Abp.Identity.User.IsEmailUpdateEnabled": false,
"Abp.Account.IsSelfRegistrationEnabled": false
},
When testing locally using dotnet run
or using a docker container, these settings work fine. I can see that the values in the settings page are updated correctly
However they are not applied when we deploy this to ECS (ABP backend is running in an ECS Task)
I've even tried to update using environment variables. But it doesn't work either
Could you outline any possible reason for this? I've checked that those settings are not overwritten in the DB
Manage to solve with this -> https://abp.io/docs/latest/framework/fundamentals/object-extensions?_redirected=B8ABF606AA1BDF5C629883DF1061649A
Thank you, will close the ticket
Hi Team, I want to edit New Tenant Modal to add extraProperties for creation of tenant. I understand i need to copy this source code -> https://github.com/abpframework/abp/tree/dev/modules/tenant-management
However how should the folder structure look like?