public ActiveMQConnection(final ConnectionFactoryOptions options, final String username, final String password, final int connectionType, final String clientID, final int dupsOKBatchSize, final int transactionBatchSize, final boolean cacheDestinations, final boolean enable1xPrefixes, final ClientSessionFactory sessionFactory) { this.options = options; this.username = username; this.password = password; this.connectionType = connectionType; this.clientID = clientID; this.sessionFactory = sessionFactory; uid = UUIDGenerator.getInstance().generateSimpleStringUUID(); thisVersion = VersionLoader.getVersion(); this.dupsOKBatchSize = dupsOKBatchSize; this.transactionBatchSize = transactionBatchSize; this.cacheDestinations = cacheDestinations; this.enable1xPrefixes = enable1xPrefixes; creationStack = new Exception(); }
@Override public void sendSubscribeTopology(final boolean isServer) { getChannel0().send(new SubscribeClusterTopologyUpdatesMessageV2(isServer, VersionLoader.getVersion().getIncrementingVersion())); }
private final int versionID = VersionLoader.getVersion().getIncrementingVersion();
public ActiveMQConnection(final ConnectionFactoryOptions options, final String username, final String password, final int connectionType, final String clientID, final int dupsOKBatchSize, final int transactionBatchSize, final boolean cacheDestinations, final boolean enable1xPrefixes, final ClientSessionFactory sessionFactory) { this.options = options; this.username = username; this.password = password; this.connectionType = connectionType; this.clientID = clientID; this.sessionFactory = sessionFactory; uid = UUIDGenerator.getInstance().generateSimpleStringUUID(); thisVersion = VersionLoader.getVersion(); this.dupsOKBatchSize = dupsOKBatchSize; this.transactionBatchSize = transactionBatchSize; this.cacheDestinations = cacheDestinations; this.enable1xPrefixes = enable1xPrefixes; creationStack = new Exception(); }
public ActiveMQConnection(final ConnectionFactoryOptions options, final String username, final String password, final int connectionType, final String clientID, final int dupsOKBatchSize, final int transactionBatchSize, final boolean cacheDestinations, final boolean enable1xPrefixes, final ClientSessionFactory sessionFactory) { this.options = options; this.username = username; this.password = password; this.connectionType = connectionType; this.clientID = clientID; this.sessionFactory = sessionFactory; uid = UUIDGenerator.getInstance().generateSimpleStringUUID(); thisVersion = VersionLoader.getVersion(); this.dupsOKBatchSize = dupsOKBatchSize; this.transactionBatchSize = transactionBatchSize; this.cacheDestinations = cacheDestinations; this.enable1xPrefixes = enable1xPrefixes; creationStack = new Exception(); }
public ActiveMQConnection(final ConnectionFactoryOptions options, final String username, final String password, final int connectionType, final String clientID, final int dupsOKBatchSize, final int transactionBatchSize, final boolean cacheDestinations, final boolean enable1xPrefixes, final ClientSessionFactory sessionFactory) { this.options = options; this.username = username; this.password = password; this.connectionType = connectionType; this.clientID = clientID; this.sessionFactory = sessionFactory; uid = UUIDGenerator.getInstance().generateSimpleStringUUID(); thisVersion = VersionLoader.getVersion(); this.dupsOKBatchSize = dupsOKBatchSize; this.transactionBatchSize = transactionBatchSize; this.cacheDestinations = cacheDestinations; this.enable1xPrefixes = enable1xPrefixes; creationStack = new Exception(); }
public ActiveMQConnection(final ConnectionFactoryOptions options, final String username, final String password, final int connectionType, final String clientID, final int dupsOKBatchSize, final int transactionBatchSize, final boolean cacheDestinations, final boolean enable1xPrefixes, final ClientSessionFactory sessionFactory) { this.options = options; this.username = username; this.password = password; this.connectionType = connectionType; this.clientID = clientID; this.sessionFactory = sessionFactory; uid = UUIDGenerator.getInstance().generateSimpleStringUUID(); thisVersion = VersionLoader.getVersion(); this.dupsOKBatchSize = dupsOKBatchSize; this.transactionBatchSize = transactionBatchSize; this.cacheDestinations = cacheDestinations; this.enable1xPrefixes = enable1xPrefixes; creationStack = new Exception(); }
@Override public void sendSubscribeTopology(final boolean isServer) { getChannel0().send(new SubscribeClusterTopologyUpdatesMessageV2(isServer, VersionLoader.getVersion().getIncrementingVersion())); }
@Override public void sendSubscribeTopology(final boolean isServer) { getChannel0().send(new SubscribeClusterTopologyUpdatesMessageV2(isServer, VersionLoader.getVersion().getIncrementingVersion())); }
@Override public void sendSubscribeTopology(final boolean isServer) { getChannel0().send(new SubscribeClusterTopologyUpdatesMessageV2(isServer, VersionLoader.getVersion().getIncrementingVersion())); }
@Override public void sendSubscribeTopology(final boolean isServer) { getChannel0().send(new SubscribeClusterTopologyUpdatesMessageV2(isServer, VersionLoader.getVersion().getIncrementingVersion())); }
@Override public void sendSubscribeTopology(final boolean isServer) { getChannel0().send(new SubscribeClusterTopologyUpdatesMessageV2(isServer, VersionLoader.getVersion().getIncrementingVersion())); }
@Override public void sendSubscribeTopology(final boolean isServer) { getChannel0().send(new SubscribeClusterTopologyUpdatesMessageV2(isServer, VersionLoader.getVersion().getIncrementingVersion())); }
/** * Get the XAResource for the connection. * * @return The XAResource for the connection. * @throws ResourceException XA transaction not supported */ @Override public XAResource getXAResource() throws ResourceException { if (logger.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("getXAResource()"); } // // Spec says a mc must always return the same XA resource, // so we cache it. // if (xaResource == null) { ClientSessionInternal csi = (ClientSessionInternal) xaSession.getXAResource(); ActiveMQRAXAResource activeMQRAXAResource = new ActiveMQRAXAResource(this, xaSession.getXAResource()); Map<String, Object> xaResourceProperties = new HashMap<>(); xaResourceProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_JNDI_NAME, ra.getJndiName()); xaResourceProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_NODE_ID, csi.getNodeId()); xaResourceProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_PRODUCT_NAME, ActiveMQResourceAdapter.PRODUCT_NAME); xaResourceProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_PRODUCT_VERSION, VersionLoader.getVersion().getFullVersion()); xaResource = ServiceUtils.wrapXAResource(activeMQRAXAResource, xaResourceProperties); } if (logger.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("XAResource=" + xaResource); } return xaResource; }
/** * Get the XAResource for the connection. * * @return The XAResource for the connection. * @throws ResourceException XA transaction not supported */ @Override public XAResource getXAResource() throws ResourceException { if (logger.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("getXAResource()"); } // // Spec says a mc must always return the same XA resource, // so we cache it. // if (xaResource == null) { ClientSessionInternal csi = (ClientSessionInternal) xaSession.getXAResource(); ActiveMQRAXAResource activeMQRAXAResource = new ActiveMQRAXAResource(this, xaSession.getXAResource()); Map<String, Object> xaResourceProperties = new HashMap<>(); xaResourceProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_JNDI_NAME, ra.getJndiName()); xaResourceProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_NODE_ID, csi.getNodeId()); xaResourceProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_PRODUCT_NAME, ActiveMQResourceAdapter.PRODUCT_NAME); xaResourceProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_PRODUCT_VERSION, VersionLoader.getVersion().getFullVersion()); xaResource = ServiceUtils.wrapXAResource(activeMQRAXAResource, xaResourceProperties); } if (logger.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("XAResource=" + xaResource); } return xaResource; }
@Test public void testLoadVersion() throws Exception { Version version = VersionLoader.getVersion(); Properties props = new Properties(); props.load(ClassLoader.getSystemResourceAsStream(VersionLoader.DEFAULT_PROP_FILE_NAME)); Assert.assertEquals(props.get("activemq.version.versionName"), version.getVersionName()); Assert.assertEquals(Integer.parseInt(props.getProperty("activemq.version.majorVersion")), version.getMajorVersion()); Assert.assertEquals(Integer.parseInt(props.getProperty("activemq.version.minorVersion")), version.getMinorVersion()); Assert.assertEquals(Integer.parseInt(props.getProperty("activemq.version.microVersion")), version.getMicroVersion()); Assert.assertEquals(Integer.parseInt(new StringTokenizer(props.getProperty("activemq.version.incrementingVersion"), ",").nextToken()), version.getIncrementingVersion()); }
public AbstractConnectionContext(AMQPConnectionCallback connectionCallback, String containerId, int idleTimeout, int maxFrameSize, int channelMax, Executor dispatchExecutor, ScheduledExecutorService scheduledPool) { this.connectionCallback = connectionCallback; this.containerId = (containerId != null) ? containerId : UUID.randomUUID().toString(); connectionProperties.put(Symbol.valueOf("product"), "apache-activemq-artemis"); connectionProperties.put(Symbol.valueOf("version"), VersionLoader.getVersion().getFullVersion()); this.scheduledPool = scheduledPool; connectionCallback.setConnection(this); this.handler = ProtonHandler.Factory.create(dispatchExecutor); Transport transport = handler.getTransport(); transport.setEmitFlowEventOnSend(false); if (idleTimeout > 0) { transport.setIdleTimeout(idleTimeout); } transport.setChannelMax(channelMax); transport.setMaxFrameSize(maxFrameSize); handler.addEventHandler(listener); }
version = VersionLoader.getVersion();
@Override public void inspectOpenedResource(Connection connection) { Map<Symbol, Object> properties = connection.getRemoteProperties(); if (!properties.containsKey(PRODUCT)) { markAsInvalid("Broker did not send a queue product name value"); return; } if (!properties.containsKey(VERSION)) { markAsInvalid("Broker did not send a queue version value"); return; } if (!PRODUCT_NAME.equals(properties.get(PRODUCT))) { markAsInvalid("Broker did not send a the expected product name"); return; } String brokerVersion = VersionLoader.getVersion().getFullVersion(); if (!brokerVersion.equals(properties.get(VERSION))) { markAsInvalid("Broker did not send a the expected product version"); return; } } });
@Test public void testOutgoingXAResourceWrapper() throws Exception { XAQueueConnection queueConnection = qraConnectionFactory.createXAQueueConnection(); XASession s = queueConnection.createXASession(); XAResource resource = s.getXAResource(); assertTrue(resource instanceof ActiveMQXAResourceWrapper); ActiveMQXAResourceWrapperImpl xaResourceWrapper = (ActiveMQXAResourceWrapperImpl) resource; assertTrue(xaResourceWrapper.getJndiName().equals("java://jmsXA NodeId:" + server.getNodeID())); assertTrue(xaResourceWrapper.getProductVersion().equals(VersionLoader.getVersion().getFullVersion())); assertTrue(xaResourceWrapper.getProductName().equals(ActiveMQResourceAdapter.PRODUCT_NAME)); }