public Message CreateMessage(object body, InvokeMethodOptions options) { var(requestContextData, runningRequest) = RequestContextExtensions.ExportInternal(this.deepCopier); var callChainId = runningRequest switch { Message msg when msg.CallChainId != Guid.Empty => msg.CallChainId, _ => Guid.NewGuid(), }; var message = new Message { Category = Message.Categories.Application, Direction = (options & InvokeMethodOptions.OneWay) != 0 ? Message.Directions.OneWay : Message.Directions.Request, Id = CorrelationId.GetNext(), IsReadOnly = (options & InvokeMethodOptions.ReadOnly) != 0, IsUnordered = (options & InvokeMethodOptions.Unordered) != 0, IsAlwaysInterleave = (options & InvokeMethodOptions.AlwaysInterleave) != 0, BodyObject = body, RequestContextData = requestContextData, CallChainId = callChainId, }; messagingTrace.OnCreateMessage(message); return(message); }
public Message CreateMessage(InvokeMethodRequest request, InvokeMethodOptions options) { var message = new Message { Category = Message.Categories.Application, Direction = (options & InvokeMethodOptions.OneWay) != 0 ? Message.Directions.OneWay : Message.Directions.Request, Id = CorrelationId.GetNext(), IsReadOnly = (options & InvokeMethodOptions.ReadOnly) != 0, IsUnordered = (options & InvokeMethodOptions.Unordered) != 0, IsAlwaysInterleave = (options & InvokeMethodOptions.AlwaysInterleave) != 0, BodyObject = request, RequestContextData = RequestContextExtensions.Export(this.serializationManager) }; if (options.IsTransactional()) { SetTransaction(message, options); } else { // clear transaction info if not in transaction message.RequestContextData?.Remove(TransactionContext.Orleans_TransactionContext_Key); } messagingTrace.OnCreateMessage(message); return(message); }
public Message CreateMessage(object body, InvokeMethodOptions options) { var message = new Message { Category = Message.Categories.Application, Direction = (options & InvokeMethodOptions.OneWay) != 0 ? Message.Directions.OneWay : Message.Directions.Request, Id = CorrelationId.GetNext(), IsReadOnly = (options & InvokeMethodOptions.ReadOnly) != 0, IsUnordered = (options & InvokeMethodOptions.Unordered) != 0, IsAlwaysInterleave = (options & InvokeMethodOptions.AlwaysInterleave) != 0, BodyObject = body, RequestContextData = RequestContextExtensions.Export(this.deepCopier) }; messagingTrace.OnCreateMessage(message); return(message); }