/// <summary>
        /// Serialize message using the .NET binary formatter (also adds support for the binary deserializer)
        /// </summary>
        /// <param name="configurator"></param>
        public static void UseBinarySerializer(this IBusFactoryConfigurator configurator)
        {
            configurator.AddBusFactorySpecification(new SetMessageSerializerBusFactorySpecification <BinaryMessageSerializer>());

            configurator.SupportBinaryMessageDeserializer();
        }
 /// <summary>
 /// Add support for the binary message deserializer to the bus. This serializer is not supported
 /// by default.
 /// </summary>
 /// <param name="configurator"></param>
 /// <returns></returns>
 public static void SupportBinaryMessageDeserializer(this IBusFactoryConfigurator configurator)
 {
     configurator.AddBusFactorySpecification(new SupportMessageDeserializerBusFactorySpecification(BinaryMessageSerializer.BinaryContentType,
                                                                                                   () => new BinaryMessageDeserializer()));
 }
 /// <summary>
 /// Connect an observer to the bus, to observe creation, start, stop, fault events.
 /// </summary>
 /// <param name="configurator"></param>
 /// <param name="observer"></param>
 public static void BusObserver(IBusFactoryConfigurator configurator, IBusObserver observer)
 {
     configurator.AddBusFactorySpecification(new BusObserverSpecification(() => observer));
 }
 /// <summary>
 /// Connect an observer to the bus, to observe creation, start, stop, fault events.
 /// </summary>
 /// <param name="configurator"></param>
 /// <param name="observerFactory">Factory to create the bus observer</param>
 public static void BusObserver <T>(IBusFactoryConfigurator configurator, Func <T> observerFactory)
     where T : IBusObserver
 {
     configurator.AddBusFactorySpecification(new BusObserverSpecification(() => observerFactory()));
 }
 /// <summary>
 /// Add support for the binary message deserializer to the bus. This serializer is not supported
 /// by default.
 /// </summary>
 /// <param name="configurator"></param>
 /// <returns></returns>
 public static void SupportProtocolBuffersMessageDeserializer(this IBusFactoryConfigurator configurator)
 {
     configurator.AddBusFactorySpecification(new SupportMessageDeserializerBusFactorySpecification(
                                                 ProtocolBuffersMessageSerializer.ProtocolBuffersContentType, () => new ProtocolBuffersMessageDeserializer()));
 }
        /// <summary>
        /// Serialize messages using the BSON message serializer
        /// </summary>
        /// <param name="configurator"></param>
        public static void UseProtocolBuffersSerializer(this IBusFactoryConfigurator configurator)
        {
            configurator.AddBusFactorySpecification(new SetMessageSerializerBusFactorySpecification <ProtocolBuffersMessageSerializer>());

            SupportProtocolBuffersMessageDeserializer(configurator);
        }
Esempio n. 7
0
 /// <summary>
 /// Serialize messages using the XML message serializer
 /// </summary>
 /// <param name="configurator"></param>
 public static void UseXmlSerializer(this IBusFactoryConfigurator configurator)
 {
     configurator.AddBusFactorySpecification(new SetMessageSerializerBusFactorySpecification <XmlMessageSerializer>());
 }
Esempio n. 8
0
 public static void UseEncryptedSerializer(this IBusFactoryConfigurator configurator, ICryptoStreamProvider streamProvider)
 {
     configurator.AddBusFactorySpecification(new EncryptedMessageSerializerBusFactorySpecification(streamProvider));
 }
Esempio n. 9
0
 public static void UseChangeMessageTypeSerializer(this IBusFactoryConfigurator configurator)
 {
     configurator.AddBusFactorySpecification(new SetMessageSerializerBusFactorySpecification <ChooseSerializer>());
 }