/// <summary>
        /// Gets a sender for the bridge.
        /// </summary>
        /// <param name="properties">The service bus extended properties.</param>
        /// <returns>
        /// Returns the sender agent.
        /// </returns>
        public override ISender GetSender(AzureServiceBusExtendedProperties properties)
        {
            var sender = new AzureServiceBusQueueSender();

            sender.Connection = Connection;
            sender.EntityName = properties.EntityName;
            return(sender);
        }
        /// <summary>
        /// This method returns a new sender.
        /// </summary>
        /// <returns>The queue sender.</returns>
        public override ISender GetSender()
        {
            var sender = new AzureServiceBusQueueSender();

            sender.Connection = Connection;

            return(sender);
        }
Example #3
0
        /// <summary>
        /// Attaches the azure service bus queue sender.
        /// </summary>
        /// <typeparam name="C"></typeparam>
        /// <param name="cpipe">The cpipe.</param>
        /// <param name="connectionName">Name of the connection.</param>
        /// <param name="priorityPartitions">The priority partitions.</param>
        /// <param name="serviceBusConnection">The service bus connection.</param>
        /// <param name="onCreate">The on create.</param>
        /// <returns></returns>
        public static C AttachAzureServiceBusQueueSender <C>(this C cpipe
                                                             , string connectionName = null
                                                             , IEnumerable <SenderPartitionConfig> priorityPartitions = null
                                                             , string serviceBusConnection = null
                                                             , Action <AzureServiceBusQueueSender> onCreate = null)
            where C : IPipelineChannelOutgoing <IPipeline>
        {
            var     component = new AzureServiceBusQueueSender();
            Channel channel   = cpipe.ToChannel(ChannelDirection.Outgoing);

            component.ConfigureAzureMessaging(
                channel.Id
                , priorityPartitions ?? channel.Partitions.Cast <SenderPartitionConfig>()
                , null
                , connectionName ?? channel.Id
                , serviceBusConnection ?? cpipe.Pipeline.Configuration.ServiceBusConnection()
                );

            onCreate?.Invoke(component);

            cpipe.AttachSender(component, setFromChannelProperties: false);

            return(cpipe);
        }