public async Task RawSending() { IDispatchMessages dispatcher = null; #region DispatcherRawSending var headers = new Dictionary<string, string>(); var outgoingMessage = new OutgoingMessage("MessageId", headers, new byte[] { }); var constraints = new[] { new NonDurableDelivery() }; UnicastAddressTag address = new UnicastAddressTag("Destination"); var options = new DispatchOptions(address, DispatchConsistency.Default, constraints); TransportOperation transportOperation = new TransportOperation(outgoingMessage, options); await dispatcher.Dispatch(new[] { transportOperation }, new ContextBag()); #endregion }
async Task RawSending(IDispatchMessages dispatcher) { #region DispatcherRawSending Dictionary<string, string> headers = new Dictionary<string, string>(); OutgoingMessage outgoingMessage = new OutgoingMessage("MessageId", headers, new byte[] { }); NonDurableDelivery[] constraints = { new NonDurableDelivery() }; UnicastAddressTag address = new UnicastAddressTag("Destination"); TransportOperation transportOperation = new TransportOperation(outgoingMessage, address, DispatchConsistency.Default, constraints); TransportOperations operations = new TransportOperations(transportOperation); await dispatcher.Dispatch(operations, new ContextBag()); #endregion }
public async Task RawSending() { IDispatchMessages dispatcher = null; #region DispatcherRawSending var headers = new Dictionary<string, string>(); var outgoingMessage = new OutgoingMessage("MessageId", headers, new byte[] { }); var constraints = new[] { new NonDurableDelivery() }; UnicastAddressTag address = new UnicastAddressTag("Destination"); TransportOperation transportOperation = new TransportOperation(outgoingMessage, address, DispatchConsistency.Default, constraints); UnicastTransportOperation unicastTransportOperation = new UnicastTransportOperation(outgoingMessage, "destination"); IEnumerable<MulticastTransportOperation> multicastOperations = Enumerable.Empty<MulticastTransportOperation>(); UnicastTransportOperation[] unicastOperations = {unicastTransportOperation}; TransportOperations operations = new TransportOperations(multicastOperations, unicastOperations); await dispatcher.Dispatch(operations, new ContextBag()); #endregion }