コード例 #1
0
ファイル: Endpoint.cs プロジェクト: IanYates/MassTransit
        public void Send <T>(ISendContext <T> context)
            where T : class
        {
            if (_disposed)
            {
                throw new ObjectDisposedException(_disposedMessage);
            }

            try
            {
                context.SetDestinationAddress(Address.Uri);
                context.SetBodyWriter(stream => _serializer.Serialize(stream, context));

                _transport.Send(context);

                context.NotifySend(_address);

                if (SpecialLoggers.Messages.IsInfoEnabled)
                {
                    SpecialLoggers.Messages.InfoFormat("SEND:{0}:{1}:{2}", Address, typeof(T).Name, context.MessageId);
                }
            }
            catch (Exception ex)
            {
                throw new SendException(typeof(T), _address.Uri, "An exception was thrown during Send", ex);
            }
        }
コード例 #2
0
        public void Send <T>(ISendContext <T> context)
            where T : class
        {
            if (_disposed)
            {
                throw new ObjectDisposedException(_disposedMessage);
            }

            try
            {
                context.SetDestinationAddress(Address.Uri);
                context.SetBodyWriter(stream => _serializer.Serialize(stream, context));

                _transport.Send(context);

                context.NotifySend(_address);
            }
            catch (Exception ex)
            {
                throw new SendException(typeof(T), _address.Uri, "An exception was thrown during Send", ex);
            }
        }