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

Rebus Integration throw exception with default UseInMemoryTransport config #21266

Closed
1 task done
nguyenminhtien1411 opened this issue Nov 5, 2024 · 0 comments
Closed
1 task done
Assignees
Labels

Comments

@nguyenminhtien1411
Copy link

nguyenminhtien1411 commented Nov 5, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Description

I configured the Event Bus Rebus by following the document but got exceptions when starting host service.

Volo.Abp.AbpInitializationException: An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module Volo.Abp.EventBus.Rebus.AbpEventBusRebusModule, Volo.Abp.EventBus.Rebus, Version=8.3.2.0, Culture=neutral, PublicKeyToken=null: An exception was thrown while activating Volo.Abp.EventBus.Rebus.RebusDistributedEventBus -> λ:Rebus.Bus.IBus.. See the inner exception for details.

---> Autofac.Core.DependencyResolutionException: An exception was thrown while activating Volo.Abp.EventBus.Rebus.RebusDistributedEventBus -> λ:Rebus.Bus.IBus.

 ---> System.InvalidOperationException: Error when trying to resolve default bus instance! No current message context was found (i.e. we're not currently handling a message), so the default bus was requested from the service provider (via DefaultBusInstance). If you'd like to use IBus outside of message handlers, please remember to mark one of the bus registrations as being the default bus instance by setting isDefaultBus:true in one of the calls to AddRebus.
 
 ---> Rebus.Exceptions.RebusConfigurationException: No transport has been configured! You need to call .Transport(t => t.Use***) in order to select which kind of queueing system you want to use to transport messages. If you want something lightweight (possibly for testing?) you can use .Transport(t => t.UseInMemoryTransport(...))
 
at Rebus.Config.RebusConfigurer.VerifyRequirements()
at Rebus.Config.RebusConfigurer.Start()

Reproduction Steps

Try to config the Rebus by following the document

Expected behavior

Host service should start normally.

Actual behavior

The host service is shut down when got a Rebus exception.

Regression?

No response

Known Workarounds

Need to override the default Rebus config. The default config is here.

 PreConfigure<AbpRebusEventBusOptions>(options =>
        {
            options.InputQueueName = "eventbus";
            options.Configurer = configure =>
            {
                // Workaround: do not need this line
                // configure.Subscriptions(s => s.StoreInMemory());
                configure.Transport(p =>
                {
                    // registerSubscriptionStorage is true as default when using UseInMemoryTransport
                    p.UseInMemoryTransport(new InMemNetwork(), "eventbus");
                });
            };
        });

Version

8.1.1

User Interface

Common (Default)

Database Provider

EF Core (Default)

Tiered or separate authentication server

Tiered

Operation System

macOS

Other information

UseInMemoryTransport screenshot
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants