FubuMvcArchive / FubuTransportation

DEPRECATED, NOW IN FUBUMVC's REPOSITORY
Other
12 stars 6 forks source link

Add a "RhinoServiceBusCompatible" recipe that can be applied to an outgoing channel #166

Closed jeremydmiller closed 10 years ago

jeremydmiller commented 10 years ago

{ public class FubuToRhinoEnvelopeModifier : IEnvelopeModifier { private readonly EnrollmentReconciliationSettings _settings;

    public FubuToRhinoEnvelopeModifier(EnrollmentReconciliationSettings settings)
    {
        _settings = settings;
    }

    public void Modify(Envelope envelope)
    {
        var isAdmin = envelope.Message is AddSubscription;
        var isStandard = envelope.Message is UpdateApplicationOrPolicyState;
        if (isAdmin || isStandard)
        {
            envelope.Headers["type"] = isAdmin ? "AdministrativeMessageMarker" : "StandardMessage";
            envelope.Headers[Envelope.SourceKey] = _settings.ServiceUri.ToString();
            envelope.ContentType = "application/rhino/xml";
        }
    }
}

}

jeremydmiller commented 10 years ago

Meh, it's not quite generalized enough to put into FT itself. Not going to happen.