https://github.com/paralect/paralect.servicebus
https://github.com/paralect/paralect.servicebus
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/paralect/paralect.servicebus
- Owner: paralect
- Created: 2011-03-27T16:50:28.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2012-03-26T12:29:41.000Z (almost 14 years ago)
- Last Synced: 2024-11-18T19:09:03.353Z (about 1 year ago)
- Language: C#
- Homepage:
- Size: 2.5 MB
- Stars: 3
- Watchers: 17
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ServiceBus
==========
Usage
-----
```csharp
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:
```csharp
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))
)
);
```