Ejemplo n.º 1
0
        public RawConsumeContext(JsonSerializer deserializer, ReceiveContext receiveContext, JToken messageToken, RawSerializerOptions options)
            : base(receiveContext)
        {
            _messageToken = messageToken ?? new JObject();

            _deserializer = deserializer;
            _options      = options;

            _messageTypes = new Dictionary <Type, ConsumeContext>();

            _headerAdapter = new RawMessageHeaderAdapter(receiveContext, options);

            _supportedTypes = _headerAdapter.SupportedMessageTypes;
        }
Ejemplo n.º 2
0
 public RawXmlMessageSerializer(RawSerializerOptions options = RawSerializerOptions.Default)
 {
     _options = options;
 }
 public RawJsonMessageSerializer(RawJsonSerializerOptions options = RawJsonSerializerOptions.Default)
 {
     _options = (RawSerializerOptions)options;
 }
Ejemplo n.º 4
0
 public RawXmlMessageDeserializer(JsonSerializer deserializer, RawSerializerOptions options = RawSerializerOptions.Default)
 {
     _deserializer = deserializer;
     _options      = options;
 }
        /// <summary>
        /// Serialize messages using the raw XML message serializer
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="options">If false, only supported messages types (read from the message headers) will be returned</param>
        public static void UseRawXmlSerializer(this IReceiveEndpointConfigurator configurator, RawSerializerOptions options)
        {
            configurator.SetMessageSerializer(() => new RawXmlMessageSerializer(options));

            configurator.AddMessageDeserializer(RawXmlMessageSerializer.RawXmlContentType,
                                                () => new RawXmlMessageDeserializer(JsonMessageSerializer.Deserializer, options));
        }
Ejemplo n.º 6
0
 public RawMessageHeaderAdapter(ReceiveContext receiveContext, RawSerializerOptions options)
 {
     _receiveContext = receiveContext;
     _options        = options;
     _headers        = receiveContext.TransportHeaders;
 }