alexeyzimarev / MassTransit.EventStoreIntegration

EventStore persistence for MassTransit
Apache License 2.0
49 stars 14 forks source link

Allow customized serializer settings #6

Open kooshan opened 4 years ago

kooshan commented 4 years ago

I get this exception, which could be ignored if I could set Json serializer settings:

invalid expiration '-68745': {value_negative,-68745}) (Self referencing loop detected for property 'Warehouse' with type 'REST.NWMS.Warehouse'. Path 'Warehouses.Value[0].SupervisorOrg[0]'.)

 ---> MassTransit.RabbitMqTransport.MessageNotConfirmedException: rabbitmq://localhost/import-microservice-nwms-service-warehouse_delay => The message was not confirmed: PRECONDITION_FAILED - invalid expiration '-68745': {value_negative,-68745}

   at async Task MassTransit.RabbitMqTransport.Contexts.RabbitMqModelContext.MassTransit.RabbitMqTransport.ModelContext.BasicPublishAsync(string exchange, string routingKey, bool mandatory, IBasicProperties basicProperties, byte[] body, bool awaitAck)
   at async Task MassTransit.RabbitMqTransport.Transport.RabbitMqSendTransport+SendPipe<T>.Send(ModelContext modelContext)
   at async Task MassTransit.RabbitMqTransport.Transport.RabbitMqSendTransport+SendPipe<T>.Send(ModelContext modelContext)
   at async Task GreenPipes.Agents.PipeContextSupervisor<TContext>.GreenPipes.IPipeContextSource<TContext>.Send(?)
   at async Task GreenPipes.Agents.PipeContextSupervisor<TContext>.GreenPipes.IPipeContextSource<TContext>.Send(?)
   at async Task GreenPipes.Agents.PipeContextSupervisor<TContext>.GreenPipes.IPipeContextSource<TContext>.Send(?)
   at async Task<ScheduledMessage<T>> MassTransit.RabbitMqTransport.Scheduling.DelayedExchangeScheduleMessageProvider.ScheduleSend<T>(Uri destinationAddress, DateTime scheduledTime, Task<T> message, IPipe<SendContext<T>> pipe, CancellationToken cancellationToken)
   at async Task MassTransit.Pipeline.Filters.RedeliveryRetryFilter<TContext, TMessage>.Send(TContext context, IPipe<TContext> next)

   --- End of inner exception stack trace ---

 ---> (Inner Exception #1) Newtonsoft.Json.JsonSerializationException: Self referencing loop detected for property 'Warehouse' with type 'IME.CustomerManagement.Models.Infrastructures.REST.NWMS.Warehouse'. Path 'Warehouses.Value[0].SupervisorOrg[0]'.
   at bool Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CheckForCircularReference(JsonWriter writer, object value, JsonProperty property, JsonContract contract, JsonContainerContract containerContract, JsonProperty containerProperty)
   at bool Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, out JsonContract memberContract, out object memberValue)
   at void Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
   at void Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)
   at void Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)

   at void Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)
   at void Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
   at void Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)
   at void Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
   at void Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)

   at void Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
   at void Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)
   at void Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
   at void Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)
   at void Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, object value, Type objectType)
   at void Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, object value, Type objectType)
   at void Newtonsoft.Json.JsonSerializer.Serialize(TextWriter textWriter, object value)
   at byte[] MassTransit.EventStoreIntegration.Audit.EventStoreMessageAudit.Serialise(object event)
   at Task MassTransit.EventStoreIntegration.Audit.EventStoreMessageAudit.StoreMessage<T>(T message, MessageAuditMetadata metadata)
   at Task MassTransit.Audit.Observers.AuditSendObserver.MassTransit.ISendObserver.PostSend<T>(SendContext<T> context)
   at Task MassTransit.Pipeline.Observables.SendObservable.PostSend<T>(SendContext<T> context)+(ISendObserver x) => { }
   at Task GreenPipes.Util.Connectable<T>.ForEachAsync(Func<T, Task> callback)