-
-
Notifications
You must be signed in to change notification settings - Fork 364
Getting started
mookid8000 edited this page Jun 5, 2012
·
19 revisions
This is a very basic example on how to get started.
Create a C# project - any kind of project really, and then find someplace where you can write the following magic spells:
// we have the container in a variable, but you would probably stash it in a static field somewhere
var container = new WindsorContainer();
Configure.With(new WindsorContainerAdapter(container))
.Transport(t => t.UseMsmqAndGetInputQueueNameFromAppConfig())
.DetermineDestination(d => d.FromRebusConfigurationSection())
.CreateBus().Start();
and then, before you run it, add the following XML abracadabra to your app.config/web.config:
<configSections>
<section name="rebus" type="Rebus.Configuration.RebusConfigurationSection, Rebus" />
</configSections>
<rebus inputQueue="my-app.input" errorQueue="my-app.error" workers="1">
<endpoints>
<!-- <add messages="SomeAssembly" endpoint="another-app.input"/> -->
</endpoints>
</rebus>
Then, see if you can run the program without getting slapped in the face with exceptions and whatnot. If so, try adding a handler to your container:
container.Register(Component.For<IHandleMessages<DateTime>>().ImplementedBy<PrintDateTime>());
and the handler looks like this:
public class PrintDateTime : IHandleMessages<DateTime>
{
public void Handle(DateTime currentDateTime)
{
Console.WriteLine("The time is {0}", currentDateTime);
}
}
and then make your app send the current time to itself by doing something like this:
Basic stuff
- Home
- Introduction
- Getting started
- Different bus modes
- How does rebus compare to other .net service buses?
- 3rd party extensions
- Rebus versions
Configuration
Scenarios
Areas
- Logging
- Routing
- Serialization
- Pub sub messaging
- Process managers
- Message context
- Data bus
- Correlation ids
- Container adapters
- Automatic retries and error handling
- Message dispatch
- Thread safety and instance policies
- Timeouts
- Timeout manager
- Transactions
- Delivery guarantees
- Idempotence
- Unit of work
- Workers and parallelism
- Wire level format of messages
- Handler pipeline
- Polymorphic message dispatch
- Persistence ignorance
- Saga parallelism
- Transport message forwarding
- Testing
- Outbox
- Startup/shutdown
Transports (not a full list)
Customization
- Extensibility
- Auto flowing user context extensibility example
- Back off strategy
- Message compression and encryption
- Fail fast on certain exception types
Pipelines
- Log message pipelines
- Incoming messages pipeline
- Incoming step context
- Outgoing messages pipeline
- Outgoing step context
Prominent application services