@Override public ConnectionFactory createConnectionFactory(URI serverUri) { HashMap<String, Object> props = new HashMap<>(); props.put("host", UriUtils.extractHostFromUri(serverUri)); Integer port = UriUtils.extractPortFromUri(serverUri); if (port != null) { props.put("port", port); } TransportConfiguration transportConfiguration = new TransportConfiguration(NettyConnectorFactory.class.getName(), props); return HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, transportConfiguration); }
@Override public ConnectionFactory createConnectionFactory(URI serverUri) { HashMap<String, Object> props = new HashMap<>(); props.put("host", UriUtils.extractHostFromUri(serverUri)); Integer port = UriUtils.extractPortFromUri(serverUri); if (port != null) { props.put("port", port); } TransportConfiguration transportConfiguration = new TransportConfiguration(NettyConnectorFactory.class.getName(), props); return HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, transportConfiguration); }
.createConnectionFactoryWithoutHA(JMSFactoryType.CF, transportConfiguration);
cf = (ConnectionFactory) HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, transportConfiguration); ((HornetQConnectionFactory)cf).setUseGlobalPools(false);
protected ConnectionFactory createRemoteConnectionFactory(final Options<CreateContextOption> options) { //TODO: possibly cache the remote cf's? Map<String, Object> transportOpts = new HashMap<>(); transportOpts.put("host", options.getString(CreateContextOption.HOST)); transportOpts.put("port", options.getInt(CreateContextOption.PORT)); if (REMOTE_TYPE_WILDFLY.equals(options.getString(CreateContextOption.REMOTE_TYPE))) { transportOpts.put("http-upgrade-enabled", true); } TransportConfiguration config = new TransportConfiguration("org.hornetq.core.remoting.impl.netty.NettyConnectorFactory", transportOpts); HornetQConnectionFactory hornetQcf = HornetQJMSClient .createConnectionFactoryWithoutHA(options.has(CreateContextOption.XA) ? JMSFactoryType.XA_CF : JMSFactoryType.CF, config); hornetQcf.setReconnectAttempts(options.getInt(CreateContextOption.RECONNECT_ATTEMPTS)); hornetQcf.setRetryInterval(options.getLong(CreateContextOption.RECONNECT_RETRY_INTERVAL)); hornetQcf.setRetryIntervalMultiplier(options.getDouble(CreateContextOption.RECONNECT_RETRY_INTERVAL_MULTIPLIER)); hornetQcf.setMaxRetryInterval(options.getLong(CreateContextOption.RECONNECT_MAX_RETRY_INTERVAL)); // We have to cast for HornetQ 2.3 - the factory object that is returned is both a HornetQConnectionFactory // and a javax.jms.ConnectionFactory, but HornetQConnectionFactory doesn't implement j.j.ConnectionFactory. // With HornetQ 2.4, this cast is redundant. return (ConnectionFactory)hornetQcf; }
cf = HornetQJMSClient.createConnectionFactoryWithoutHA(groupConfig, cfConfig.getFactoryType()); cf = HornetQJMSClient.createConnectionFactoryWithoutHA(cfConfig.getFactoryType(), configs);
connectionFactory = HornetQJMSClient.createConnectionFactoryWithoutHA(discoveryGroupConfiguration, factoryType); } else { connectionFactory = HornetQJMSClient.createConnectionFactoryWithoutHA(factoryType, transportConfigurations);
connectionFactory = HornetQJMSClient.createConnectionFactoryWithoutHA(discoveryGroupConfiguration, factoryType); } else { connectionFactory = HornetQJMSClient.createConnectionFactoryWithoutHA(factoryType, transportConfigurations);
incompleteCF = HornetQJMSClient.createConnectionFactoryWithHA(factoryType); } else { incompleteCF = HornetQJMSClient.createConnectionFactoryWithoutHA(factoryType);
incompleteCF = HornetQJMSClient.createConnectionFactoryWithHA(factoryType); } else { incompleteCF = HornetQJMSClient.createConnectionFactoryWithoutHA(factoryType);