CodeSharp.EventSourcing.MsmqUtilities.GetFullPathWithoutPrefix C# (CSharp) Метод

GetFullPathWithoutPrefix() публичный статический Метод

Returns the full path without Format or direct os from an address.
public static GetFullPathWithoutPrefix ( Address address ) : string
address Address
Результат string
        public static string GetFullPathWithoutPrefix(Address address)
        {
            return address.Machine + PRIVATE + address.Queue;
        }

Same methods

MsmqUtilities::GetFullPathWithoutPrefix ( string value ) : string

Usage Example

Пример #1
0
        void IMessageTransport.Init(Address address)
        {
            if (address == null)
            {
                throw new ArgumentNullException("address");
            }

            var machine = address.Machine;

            if (machine.ToLower() != Environment.MachineName.ToLower())
            {
                throw new InvalidOperationException(
                          string.Format("Input queue [{0}] must be on the same machine as this process [{1}].",
                                        address, Environment.MachineName.ToLower()));
            }

            var fullPath = MsmqUtilities.GetFullPathWithoutPrefix(address);

            if (MessageQueue.Exists(fullPath))
            {
                _messageQueue = new MessageQueue(fullPath);
            }
            else
            {
                _messageQueue = MessageQueue.Create(fullPath);
            }

            var mpf = new MessagePropertyFilter();

            mpf.SetAll();
            _messageQueue.MessageReadPropertyFilter = mpf;

            if (PurgeOnStartup)
            {
                _messageQueue.Purge();
            }
        }