Exemplo n.º 1
0
        /// <summary>
        /// Configure a ActiveMQ host with a host name and virtual host
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="hostName">The host name of the broker</param>
        /// <param name="configure">The configuration callback</param>
        public static IActiveMqHost Host(this IActiveMqBusFactoryConfigurator configurator, string hostName, Action <IActiveMqHostConfigurator> configure)
        {
            if (Uri.IsWellFormedUriString(hostName, UriKind.Absolute))
            {
                return(configurator.Host(new Uri(hostName), configure));
            }

            return(configurator.Host(new ActiveMqHostAddress(hostName, default, "/"), configure));
Exemplo n.º 2
0
        /// <summary>
        ///     Configure a ActiveMQ host using the configuration API
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="hostAddress">The URI host address of the ActiveMQ host (activemq://host:port/vhost)</param>
        /// <param name="configure"></param>
        public static IActiveMqHost Host(this IActiveMqBusFactoryConfigurator configurator, Uri hostAddress, Action <IActiveMqHostConfigurator> configure)
        {
            if (hostAddress == null)
            {
                throw new ArgumentNullException(nameof(hostAddress));
            }

            var hostConfigurator = new ActiveMqHostConfigurator(hostAddress);

            configure(hostConfigurator);

            return(configurator.Host(hostConfigurator.Settings));
        }
Exemplo n.º 3
0
 /// <summary>
 /// Configure a ActiveMQ host with a host name and virtual host
 /// </summary>
 /// <param name="configurator"></param>
 /// <param name="hostName">The host name of the broker</param>
 /// <param name="port">The port to connect to the broker</param>
 /// <param name="configure">The configuration callback</param>
 public static IActiveMqHost Host(this IActiveMqBusFactoryConfigurator configurator, string hostName, int port,
                                  Action <IActiveMqHostConfigurator> configure)
 {
     return(configurator.Host(new UriBuilder("activemq", hostName, port).Uri, configure));
 }