Esempio n. 1
0
        public void Send(string endpoint, object message)
        {
            var channelMessage = ChannelMessageFactory.CreateChannelMessage(message, serializer);
            var destination    = EndpointAddress.Parse(endpoint);

            channelMessage.AddHeader(MessageHeaders.Destination, destination.ToString());
            sendingChannel.Send(destination, channelMessage);
        }
Esempio n. 2
0
        public void Unsubscribe(string endpoint, string messageName)
        {
            var message = new UnsubscribeMessage
            {
                Endpoint    = $"{busConfig.EndpointName}@{Environment.MachineName}",
                MessageName = messageName
            };

            var destination = EndpointAddress.Parse(endpoint);

            var logMsg = messageName == string.Empty ? "All" : messageName;

            log.Info($"Unsubscribing from endpoint '{destination}'. Message '{logMsg}'");

            var channelMessage     = ChannelMessageFactory.CreateChannelMessage(message, bodySerializer);
            var msmqSendingChannel = new MsmqSendingChannel();

            msmqSendingChannel.Send(destination, channelMessage);
        }
Esempio n. 3
0
        public void Publish(object message)
        {
            var channelMessage = ChannelMessageFactory.CreateChannelMessage(message, serializer);

            publishingChannel.Publish(channelMessage);
        }