@Override protected void finalize() throws Throwable { if (!closed && finalizeCheck) { ActiveMQClientLogger.LOGGER.factoryLeftOpen(createTrace, System.identityHashCode(this)); close(); } super.finalize(); }
private void handleConnectionFailure(final Object connectionID, final ActiveMQException me, String scaleDownTargetNodeID) { try { failoverOrReconnect(connectionID, me, scaleDownTargetNodeID); } catch (ActiveMQInterruptedException e1) { // this is just a debug, since an interrupt is an expected event (in case of a shutdown) logger.debug(e1.getMessage(), e1); } catch (Throwable t) { ActiveMQClientLogger.LOGGER.unableToHandleConnectionFailure(t); //for anything else just close so clients are un blocked close(); throw t; } }
@Override protected void finalize() throws Throwable { if (!closed && finalizeCheck) { ActiveMQClientLogger.LOGGER.factoryLeftOpen(createTrace, System.identityHashCode(this)); close(); } super.finalize(); }
@Override protected void finalize() throws Throwable { if (!closed && finalizeCheck) { ActiveMQClientLogger.LOGGER.factoryLeftOpen(createTrace, System.identityHashCode(this)); close(); } super.finalize(); }
@Override protected void finalize() throws Throwable { if (!closed && finalizeCheck) { ActiveMQClientLogger.LOGGER.factoryLeftOpen(createTrace, System.identityHashCode(this)); close(); } super.finalize(); }
@Override protected void finalize() throws Throwable { if (!closed && finalizeCheck) { ActiveMQClientLogger.LOGGER.factoryLeftOpen(createTrace, System.identityHashCode(this)); close(); } super.finalize(); }
@Override protected void finalize() throws Throwable { if (!closed && finalizeCheck) { ActiveMQClientLogger.LOGGER.factoryLeftOpen(createTrace, System.identityHashCode(this)); close(); } super.finalize(); }
@Override protected void finalize() throws Throwable { if (!closed && finalizeCheck) { ActiveMQClientLogger.LOGGER.factoryLeftOpen(createTrace, System.identityHashCode(this)); close(); } super.finalize(); }
private void handleConnectionFailure(final Object connectionID, final ActiveMQException me, String scaleDownTargetNodeID) { try { failoverOrReconnect(connectionID, me, scaleDownTargetNodeID); } catch (ActiveMQInterruptedException e1) { // this is just a debug, since an interrupt is an expected event (in case of a shutdown) logger.debug(e1.getMessage(), e1); } catch (Throwable t) { ActiveMQClientLogger.LOGGER.unableToHandleConnectionFailure(t); //for anything else just close so clients are un blocked close(); throw t; } }
private void handleConnectionFailure(final Object connectionID, final ActiveMQException me, String scaleDownTargetNodeID) { try { failoverOrReconnect(connectionID, me, scaleDownTargetNodeID); } catch (ActiveMQInterruptedException e1) { // this is just a debug, since an interrupt is an expected event (in case of a shutdown) logger.debug(e1.getMessage(), e1); } catch (Throwable t) { ActiveMQClientLogger.LOGGER.unableToHandleConnectionFailure(t); //for anything else just close so clients are un blocked close(); throw t; } }
private void handleConnectionFailure(final Object connectionID, final ActiveMQException me, String scaleDownTargetNodeID) { try { failoverOrReconnect(connectionID, me, scaleDownTargetNodeID); } catch (ActiveMQInterruptedException e1) { // this is just a debug, since an interrupt is an expected event (in case of a shutdown) logger.debug(e1.getMessage(), e1); } catch (Throwable t) { ActiveMQClientLogger.LOGGER.unableToHandleConnectionFailure(t); //for anything else just close so clients are un blocked close(); throw t; } }
private void handleConnectionFailure(final Object connectionID, final ActiveMQException me, String scaleDownTargetNodeID) { try { failoverOrReconnect(connectionID, me, scaleDownTargetNodeID); } catch (ActiveMQInterruptedException e1) { // this is just a debug, since an interrupt is an expected event (in case of a shutdown) logger.debug(e1.getMessage(), e1); } catch (Throwable t) { ActiveMQClientLogger.LOGGER.unableToHandleConnectionFailure(t); //for anything else just close so clients are un blocked close(); throw t; } }
private void handleConnectionFailure(final Object connectionID, final ActiveMQException me, String scaleDownTargetNodeID) { try { failoverOrReconnect(connectionID, me, scaleDownTargetNodeID); } catch (ActiveMQInterruptedException e1) { // this is just a debug, since an interrupt is an expected event (in case of a shutdown) logger.debug(e1.getMessage(), e1); } catch (Throwable t) { ActiveMQClientLogger.LOGGER.unableToHandleConnectionFailure(t); //for anything else just close so clients are un blocked close(); throw t; } }
private void handleConnectionFailure(final Object connectionID, final ActiveMQException me, String scaleDownTargetNodeID) { try { failoverOrReconnect(connectionID, me, scaleDownTargetNodeID); } catch (ActiveMQInterruptedException e1) { // this is just a debug, since an interrupt is an expected event (in case of a shutdown) logger.debug(e1.getMessage(), e1); } catch (Throwable t) { ActiveMQClientLogger.LOGGER.unableToHandleConnectionFailure(t); //for anything else just close so clients are un blocked close(); throw t; } }
@Test public void testConnectionTimeoutConfig() throws Exception { final int timeout = 23456; TransportConfiguration transport = new TransportConfiguration(NETTY_CONNECTOR_FACTORY); transport.getParams().put(TransportConstants.NETTY_CONNECT_TIMEOUT, timeout); ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(transport); ClientSessionFactoryImpl factory = (ClientSessionFactoryImpl) locator.createSessionFactory(); NettyConnector connector = (NettyConnector) factory.getConnector(); Bootstrap bootstrap = connector.getBootStrap(); assertEquals(timeout, bootstrap.register().channel().config().getConnectTimeoutMillis()); factory.close(); locator.close(); } }
@Test public void testListConnectionsClientID() throws Exception { SimpleString queueName1 = new SimpleString("my_queue_one"); SimpleString addressName1 = new SimpleString("my_address_one"); ActiveMQServerControl serverControl = createManagementControl(); server.addAddressInfo(new AddressInfo(addressName1, RoutingType.ANYCAST)); server.createQueue(addressName1, RoutingType.ANYCAST, queueName1, null, false, false); ClientSessionFactoryImpl csf = null; // create some consumers try (ServerLocator locator = createInVMNonHALocator()) { //sleep as test compares creationTime csf = (ClientSessionFactoryImpl) createSessionFactory(locator); ClientSession session1_c1 = csf.createSession(); ClientSession session2_c1 = csf.createSession(); session1_c1.addMetaData(ClientSession.JMS_SESSION_IDENTIFIER_PROPERTY, ""); session1_c1.addMetaData(JMS_SESSION_CLIENT_ID_PROPERTY, "MYClientID"); String filterString = createJsonFilter("SESSION_COUNT", "GREATER_THAN", "1"); String connectionsAsJsonString = serverControl.listConnections(filterString, 1, 50); JsonObject connectionsAsJsonObject = JsonUtil.readJsonObject(connectionsAsJsonString); JsonArray array = (JsonArray) connectionsAsJsonObject.get("data"); Assert.assertEquals("number of connections returned from query", 1, array.size()); JsonObject jsonConnection = array.getJsonObject(0); //check all fields Assert.assertEquals("clientID", "MYClientID", jsonConnection.getString("clientID")); } finally { if (csf != null) { csf.close(); } } }