Skip to content

paralect/Paralect.ServiceBus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ServiceBus

Usage

    var bus = ServiceBus.Run(c => c
        .SetServiceLocator(new UnityServiceLocator(unity))
        .SetInputQueue("InputQueue")
        .AddEndpoint("Paralect.ServiceBus.Test.Messages", "SomeQueue")
        .Dispatcher(d => d
            .AddHandlers(Assembly.GetExecutingAssembly())
        )
    );

Another example:

    var bus = ServiceBus.Run(c => c
        .SetServiceLocator(new StructureMapServiceLocator(container))
        .MemorySynchronousTransport()
        .SetName("Main Service Bus")
        .SetInputQueue("App.Server")
        .AddEndpoint(type => type.FullName.EndsWith("Event"), "App.Server")
        .AddEndpoint(type => type.FullName.EndsWith("Command"), "App.Server")
        .Dispatcher(d => d
            .AddHandlers(typeof(UserAR).Assembly)
            .AddHandlers(typeof(TopicAR).Assembly)
            .AddHandlers(typeof(AuthenticationService).Assembly)
            .AddHandlers(typeof(AccountDocument).Assembly)
            .AddHandlers(typeof(CreateUserCommand).Assembly)
            .AddHandlers(typeof(PermissionDocument).Assembly)
            .SetOrder(typeof(UserDocumentEventHandler), 
                      typeof(TopicDocumentEventHandler),
                      typeof(CommentDocumentEventHandler))
        )
    );

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published