Skip to content

Instantly share code, notes, and snippets.

View andreasohlund's full-sized avatar

Andreas Öhlund andreasohlund

View GitHub Profile
namespace MsmqAsyncSpike
{
using System;
using System.Messaging;
using System.Threading;
using System.Threading.Tasks;
class Program
{
static void Main(string[] args)
using System;
using NServiceBus.Pipeline;
using NServiceBus.Pipeline.Contexts;
namespace TTBRDemo
{
using NServiceBus;
class EndpointConfig : IConfigureThisEndpoint, AsA_Server
<configuration>
<config>
<add key="DependencyVersion" value="HighestMinor" />
</config>
</configuration>
@andreasohlund
andreasohlund / MessageUpConverting.cs
Created April 10, 2014 16:48
Demonstrates how to use a pipeline override to change the message type of a received message
class MessageUpConverter : IBehavior<ReceiveLogicalMessageContext>
{
public MessageMetadataRegistry MessageMetadataRegistry { get; set; }
public void Invoke(ReceiveLogicalMessageContext context, Action next)
{
Console.Out.WriteLine("Upconverter invoked");
var meta = MessageMetadataRegistry.GetMessageDefinition(typeof (V2Message));
@andreasohlund
andreasohlund / gist:7870379
Created December 9, 2013 10:44
Issue with free text search on multi map reduce
Index:
public class MessagesViewIndex : AbstractMultiMapIndexCreationTask<MessagesView>
{
public MessagesViewIndex()
{
AddMap<AuditMessage>(messages => messages.Select(message => new
{
Id = message.Id,
MessageId = message.MessageId,
@andreasohlund
andreasohlund / gist:7385114
Created November 9, 2013 12:49
Octokit-Ex
HTTP/1.1 200 OK
Server: GitHub.com
Date: Sat, 09 Nov 2013 12:38:55 GMT
Content-Type: application/json; charset=utf-8
Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4996
X-RateLimit-Reset: 1384004333
Cache-Control: private, max-age=60, s-maxage=60
ETag: "03263a0c20f2e509008741c53e86579f"
namespace NServiceBus.Pipeline.Behaviors
{
using System;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// This one would be a plugin somehow
/// </summary>
class SagaStateAuditingBehavior : IBehavior,
buildsupport\ripple.exe create-packages -v %GitFlowVersion.NugetVersion% -d nugets -u
ReleaseNotesCompiler
In order to improve the quality for our release notes we'll generate them based on the relevant github issues.
* This is a separate tool from GFV
* The build server will compile the release notes either for each commit or daily
* Build will fail if release notes can't be generated
* All closed issues for a milestone will be included
* All issues must have one of the following tags Bug|Feature|Internal refactoring
* For now the text is taken from the name of the issue
@andreasohlund
andreasohlund / gist:6549118
Created September 13, 2013 10:40
Possible_nh_3204_fix.cs
if (ex != null)
{
Transaction.Current.Rollback(ex);
while (Transaction.Current.TransactionInformation.Status != TransactionStatus.Aborted)
{
Thread.Sleep(20);
}
}