Return an AMQEndpoint instance configured with the given AMQP uri.

        @see: https://www.rabbitmq.com/uri-spec.html
555075
def from_uri(cls, reactor, uri):
        
        uri = URI.fromBytes(uri.encode(), defaultPort=5672)
        kwargs = {}
        host = uri.host.decode()
        if "@" in host:
            auth, host = uri.netloc.decode().split("@")
            username, password = auth.split(":")
            kwargs.update({"username": username, "password": password})

        vhost = uri.path.decode()
        if len(vhost) > 1:
            vhost = vhost[1:]  # Strip leading "/"
        kwargs["vhost"] = vhost

        params = parse_qs(uri.query)
        kwargs.update({name.decode(): value[0].decode() for name, value in params.items()})

        if "heartbeat" in kwargs:
            kwargs["heartbeat"] = int(kwargs["heartbeat"])
        return cls(reactor, host, uri.port, **kwargs)
344188
public URI toURI() throws URISyntaxException {
        return new URI(_scheme, null, _host, _port, _path, _query == null ? null : UrlEncoded.decodeString(_query), _fragment);
    }
589713
public static function createConnectionUsingPHPAMQPExtension(AMQPServerConfigurationInterface $config)
    {
        if (!static::canUsePHPAMQPExtension()) {
            throw new RuntimeException('amqp extension is not installed - run pecl install amqp');
        }

        $amqp = new \AMQPConnection([
            'host'            => $config->getHost(),
            'login'           => $config->getUsername(),
            'password'        => $config->getPassword(),
            'vhost'           => $config->getVHost(),
            'port'            => $config->getPort(),
            'connect_timeout' => $config->getConnectionTimeout()
        ]);

        if (!$amqp->connect()) {
            throw new RuntimeException('Could not connect to AMQP server');
        }

        register_shutdown_function(function() use ($amqp){
            try {
                $amqp->disconnect();
            } catch(Exception $ex) {

            }
        });

        return $amqp;
    }
1227574
private URI createRequestURI(String path,String queryParams) throws URISyntaxException {
        return new URI(j4pServerUrl.getScheme(),
                                  j4pServerUrl.getUserInfo(),
                                  j4pServerUrl.getHost(),
                                  j4pServerUrl.getPort(),
                                  path,
                                  queryParams,null);
    }
939402
public HttpMessage uri(final String requestUri) {
        setHeader(DynamicEndpointUriResolver.ENDPOINT_URI_HEADER_NAME, requestUri);
        setHeader(HttpMessageHeaders.HTTP_REQUEST_URI, requestUri);
        return this;
    }
913849
def parse(uri)
      # Legacy parsing of URI configuration; does not follow usual
      # AMQP vhost encoding but used regular URL path
      uri = ::URI.parse(uri)

      config = {}
      config[:user]  ||= uri.user     if uri.user
      config[:pass]  ||= uri.password if uri.password
      config[:host]  ||= uri.host     if uri.host
      config[:port]  ||= uri.port     if uri.port
      config[:vhost] ||= uri.path     unless uri.path.empty?
      config[:ssl]   ||= uri.scheme.casecmp('amqps').zero?

      config
    end
1216850
public Set<String> endpointUris() {
        try {
            // we must use reflection for now until Camel supports the getEndpoints() method
            // https://issues.apache.org/jira/browse/CAMEL-3644
            // ...
            // the above is no longer valid since Camel 2.7.0
            List<CamelEndpointFactoryBean> endpoints = contextElement.getEndpoints();
            List<String> uris = new LinkedList<String>();
            if (endpoints != null) {
                for (CamelEndpointFactoryBean cefb : endpoints) {
                    uris.add(cefb.getUri());
                }
            }

            // lets detect any drools endpoints...
            List<Node> sessions = nodesByNamespace(doc, droolsNamespace.getURI(), "ksession");
            if (sessions != null) {
                for (Node session : sessions) {
                    if (session instanceof Element) {
                        Element e = (Element) session;
                        String node = e.getAttributeValue("node");
                        String sid = e.getAttributeValue("id");
                        if (node != null && node.length() > 0 && sid != null && sid.length() > 0) {
                            String du = "drools:" + node + "/" + sid;
                            boolean exists = false;
                            for (String uri : uris) {
                                if (uri.startsWith(du)) {
                                    exists = true;
                                }
                            }
                            if (!exists) {
                                uris.add(du);
                            }
                        }
                    }
                }
            }
            return new TreeSet<String>(uris);
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
            return new HashSet<String>();
        }
    }
579131
@Bean
    AMQPComponent amqp(@Value("${AMQP_SERVICE_HOST:localhost}") String amqpBrokerUrl,
            @Value("${AMQP_SERVICE_PORT:5672}") int amqpBrokerPort) throws MalformedURLException {
        LOG.debug("About to create AMQP component {}:{}", amqpBrokerUrl, amqpBrokerPort);
        return amqp10Component("amqp://" + amqpBrokerUrl + ":" + amqpBrokerPort);
    }
953215
public function getCropEndpoint(
        $endpoint,
        $parameters = array(),
        $absolute = UrlGeneratorInterface::ABSOLUTE_PATH
    ) {
        $parameters = array_merge($parameters, array('endpoint' => $endpoint));

        return $this->router->generate($this->routeName, $parameters, $absolute);
    }
361345
public static CamundaBpmProducer createProducer(final CamundaBpmEndpoint endpoint, final ParsedUri uri,
            final Map<String, Object> parameters) throws IllegalArgumentException {

        switch (uri.getType()) {
        case StartProcess:
            return new StartProcessProducer(endpoint, parameters);
        case SendSignal:
        case SendMessage:
            return new MessageProducer(endpoint, parameters);
        default:
            throw new IllegalArgumentException("Cannot create a producer for URI '" + uri + "' - new ProducerType '"
                    + uri.getType() + "' not yet supported?");
        }

    }
782568
def establish_rabbitmq_connection(rabbitmq_uri):
    
    userid, password, host, port, virtual_host, ssl = translate_rabbitmq_url(rabbitmq_uri)

    connection = Connection(userid=userid,
                            password=password,
                            host=host,
                            port=port,
                            virtual_host=virtual_host,
                            ssl=False)

    return connection
206040
@Override
	public WebsocketSender uri(String uri) {
		return new WebsocketFinalizer(cachedConfiguration.bootstrap(b -> HttpClientConfiguration.uri(b, uri)));
	}
1330744
@Provides
	@Singleton
	@Named(GuiceProperties.LOCAL_REST_SERVICES_ENDPOINT)
	public URI getRestServicesEndpoint(@Named(GuiceProperties.STATIC_ENDPOINT_CONFIG_NAME) URI webappUri,
	                                   @Named(GuiceProperties.REST_SERVICES_PREFIX) String restPrefix,
	                                   ServletContext context)
	{
		if (restPrefix.equals(""))
		{
			// resteasy mapped to /
			return webappUri;
		}
		else
		{
			// Strip the leading / from the restpath
			while (restPrefix.startsWith("/"))
				restPrefix = restPrefix.substring(1);

			final String webappPath = webappUri.toString();

			if (webappPath.endsWith("/"))
				return URI.create(webappPath + restPrefix);
			else
				return URI.create(webappPath + "/" + restPrefix);
		}
	}
948600
protected List<String> getEndpointUris() throws AdapterException {
        List<String> urlmap = new ArrayList<String>();
        try {
            String map = getAttributeValue(ENDPOINT_URI);
            List<String[]> urlmaparray;
            if (map==null)
                urlmaparray = new ArrayList<String[]>();
                else
                    urlmaparray = StringHelper.parseTable(map, ',', ';', 1);

            for (String[] entry : urlmaparray)
                urlmap.add(getValueSmart(entry[0], ""));
        }
        catch (Exception ex) {
            throw new AdapterException(-1, ex.getMessage(), ex);
        }
        return urlmap;
    }
151683
protected AmqpTemplate createAmqpTemplate(String queueName) throws RabbitmqCommunicateException
    {
        List<String> processList = getProcessList(queueName);

        // ConnectionFactoryにフェイルオーバする順序で接続先RabbitMQプロセス一覧を設定。
        ConnectionFactory connectionFactory = getCachingConnectionFactory(queueName, processList);

        // AmqpTemplate（RabbitTemplate）にConnectionFactoryとキュー名を設定。
        RabbitTemplate template = getRabbitTemplate(queueName, connectionFactory);
        return template;
    }
493471
public UriComponentsBuilder uri(URI uri) {
		Assert.notNull(uri, "'uri' must not be null");
		this.scheme = uri.getScheme();
		if (uri.isOpaque()) {
			this.ssp = uri.getRawSchemeSpecificPart();
			resetHierarchicalComponents();
		}
		else {
			if (uri.getRawUserInfo() != null) {
				this.userInfo = uri.getRawUserInfo();
			}
			if (uri.getHost() != null) {
				this.host = uri.getHost();
			}
			if (uri.getPort() != -1) {
				this.port = String.valueOf(uri.getPort());
			}
			if (StringUtils.hasLength(uri.getRawPath())) {
				this.pathBuilder = new CompositePathComponentBuilder(uri.getRawPath());
			}
			if (StringUtils.hasLength(uri.getRawQuery())) {
				this.queryParams.clear();
				query(uri.getRawQuery());
			}
			resetSchemeSpecificPart();
		}
		if (uri.getRawFragment() != null) {
			this.fragment = uri.getRawFragment();
		}
		return this;
	}
480614
def parse_uri(uri, endpoint_uri):
    
    temp_parse = urlparse(uri)
    return _Route(
        urljoin(endpoint_uri, temp_parse.path),
        parse_qs(temp_parse.query)
    )