public int getFactoryType() { return JMSFactoryType.CF.intValue(); } /**
@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); }
public EngineMessageProducer(int clientID, String queueName, Session session) { this.clientID = clientID; this.queueName = queueName; this.session = session; try { // Step 1. Directly instantiate the JMS Queue object. queue = HornetQJMSClient.createQueue(queueName); if (log.isDebugEnabled()) { log.debug("Created queue named as: " + queueName); } // Step 6. Create a JMS Message Producer producer = session.createProducer(queue); if (log.isDebugEnabled()) { log.debug("Session created: " + session); } } catch (JMSException e) { log.error(e.toString(), e); } catch (Exception e) { log.error(e.toString(), e); // TODO: Restart connection...? } }
JMSFactoryType factoryType = JMSFactoryType.valueOf(uncompletedConnectionFactory.getFactoryType()); connectionFactory = HornetQJMSClient.createConnectionFactoryWithHA(discoveryGroupConfiguration, factoryType); } else { connectionFactory = HornetQJMSClient.createConnectionFactoryWithHA(factoryType, transportConfigurations); connectionFactory = HornetQJMSClient.createConnectionFactoryWithoutHA(discoveryGroupConfiguration, factoryType); } else { connectionFactory = HornetQJMSClient.createConnectionFactoryWithoutHA(factoryType, transportConfigurations);
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { final String name = context.getCurrentAddressValue(); final ServiceName serviceName = MessagingServices.getActiveMQServiceName(context.getCurrentAddress()); final ServiceTarget serviceTarget = context.getServiceTarget(); // Do not pass the JNDI bindings to ActiveMQ but install them directly instead so that the // dependencies from the BinderServices to the JMSQueueService are not broken JMSTopicService jmsTopicService = JMSTopicService.installService(name, serviceName, serviceTarget); final ServiceName jmsTopicServiceName = JMSServices.getJmsTopicBaseServiceName(serviceName).append(name); for (String entry : CommonAttributes.DESTINATION_ENTRIES.unwrap(context, model)) { BinderServiceUtil.installBinderService(serviceTarget, entry, jmsTopicService, jmsTopicServiceName); } List<String> legacyEntries = CommonAttributes.LEGACY_ENTRIES.unwrap(context, model); if (!legacyEntries.isEmpty()) { Topic legacyTopic = HornetQJMSClient.createTopic(name); for (String legacyEntry : legacyEntries) { BinderServiceUtil.installBinderService(serviceTarget, legacyEntry, legacyTopic); } } } }
if (jmsFactoryType.equals(JMSFactoryType.CF)) else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_CF)) else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_CF)) else if (jmsFactoryType.equals(JMSFactoryType.XA_CF)) else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_XA_CF)) else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_XA_CF))
JMSFactoryType factoryType = JMSFactoryType.valueOf(uncompletedConnectionFactory.getFactoryType()); connectionFactory = HornetQJMSClient.createConnectionFactoryWithHA(discoveryGroupConfiguration, factoryType); } else { connectionFactory = HornetQJMSClient.createConnectionFactoryWithHA(factoryType, transportConfigurations); connectionFactory = HornetQJMSClient.createConnectionFactoryWithoutHA(discoveryGroupConfiguration, factoryType); } else { connectionFactory = HornetQJMSClient.createConnectionFactoryWithoutHA(factoryType, transportConfigurations);
@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); }
factoryType = JMSFactoryType.valueOf(buffer.readInt());
public int getFactoryType() { return JMSFactoryType.QUEUE_CF.intValue(); } }
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { final String name = context.getCurrentAddressValue(); final ServiceName serviceName = MessagingServices.getActiveMQServiceName(context.getCurrentAddress()); final ServiceTarget serviceTarget = context.getServiceTarget(); // Do not pass the JNDI bindings to ActiveMQ but install them directly instead so that the // dependencies from the BinderServices to the JMSQueueService are not broken JMSTopicService jmsTopicService = JMSTopicService.installService(name, serviceName, serviceTarget); final ServiceName jmsTopicServiceName = JMSServices.getJmsTopicBaseServiceName(serviceName).append(name); for (String entry : CommonAttributes.DESTINATION_ENTRIES.unwrap(context, model)) { BinderServiceUtil.installBinderService(serviceTarget, entry, jmsTopicService, jmsTopicServiceName); } List<String> legacyEntries = CommonAttributes.LEGACY_ENTRIES.unwrap(context, model); if (!legacyEntries.isEmpty()) { Topic legacyTopic = HornetQJMSClient.createTopic(name); for (String legacyEntry : legacyEntries) { BinderServiceUtil.installBinderService(serviceTarget, legacyEntry, legacyTopic); } } } }
if (jmsFactoryType.equals(JMSFactoryType.CF)) else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_CF)) else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_CF)) else if (jmsFactoryType.equals(JMSFactoryType.XA_CF)) else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_XA_CF)) else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_XA_CF))
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; }
public int getFactoryType() { return JMSFactoryType.TOPIC_CF.intValue(); } }
public int getFactoryType() { return JMSFactoryType.TOPIC_XA_CF.intValue(); } }
public int getFactoryType() { return JMSFactoryType.QUEUE_XA_CF.intValue(); }
public int getFactoryType() { return JMSFactoryType.XA_CF.intValue(); }
public int getFactoryType() { return cfConfig.getFactoryType().intValue(); }
buffer.writeInt(factoryType.intValue());