Examples of AdvisoryBroker


Examples of org.apache.activemq.advisory.AdvisoryBroker

    }

    @Test
    public void testEqualsNeeded() throws Exception {
        // setup
        AdvisoryBroker testObj = (AdvisoryBroker) brokerService.getBroker().getAdaptor(AdvisoryBroker.class);
        ActiveMQDestination destination = new ActiveMQQueue("foo");
        ConnectionInfo connectionInfo = createConnectionInfo();
        ConnectionContext connectionContext = new ConnectionContext(connectionInfo);
        connectionContext.setBroker(brokerService.getBroker());
        SessionInfo sessionInfo = createSessionInfo(connectionInfo);

        for (int j = 1; j <= 5; j++) {
            ConsumerInfo consumerInfo = createConsumerInfo(sessionInfo, j, destination);
            testObj.addConsumer(connectionContext, consumerInfo);
        }

        for (int j = 1; j <= 5; j++) {
            ConsumerInfo consumerInfo = createConsumerInfo(sessionInfo, j, destination);
            testObj.removeConsumer(connectionContext, consumerInfo);
        }

        assertEquals(0, testObj.getAdvisoryConsumers().size());
    }
View Full Code Here

Examples of org.apache.activemq.advisory.AdvisoryBroker

     * @throws IOException
     */
    protected Broker addInterceptors(Broker broker) throws Exception {
        broker = new TransactionBroker(broker, getPersistenceAdapter().createTransactionStore());
        if (isAdvisorySupport()) {
            broker = new AdvisoryBroker(broker);
        }
        broker = new CompositeDestinationBroker(broker);
        if (isPopulateJMSXUserID()) {
            broker = new UserIDBroker(broker);
        }
View Full Code Here

Examples of org.apache.activemq.advisory.AdvisoryBroker

                throw IOExceptionSupport.create("Status MBean could not be registered in JMX: "
                        + e.getMessage(), e);
            }
        }
        if (isAdvisorySupport()) {
            broker = new AdvisoryBroker(broker);
        }
        broker = new CompositeDestinationBroker(broker);
        broker = new TransactionBroker(broker, getPersistenceAdapter().createTransactionStore());
        if (isPopulateJMSXUserID()) {
            UserIDBroker userIDBroker = new UserIDBroker(broker);
View Full Code Here

Examples of org.apache.activemq.advisory.AdvisoryBroker

        }
    }

    private void fireFailedForwardAdvisory(MessageDispatch messageDispatch, Throwable error) {
        if (configuration.isAdvisoryForFailedForward()) {
            AdvisoryBroker advisoryBroker = null;
            try {
                advisoryBroker = (AdvisoryBroker) brokerService.getBroker().getAdaptor(AdvisoryBroker.class);

                if (advisoryBroker != null) {
                    ConnectionContext context = new ConnectionContext();
                    context.setSecurityContext(SecurityContext.BROKER_SECURITY_CONTEXT);
                    context.setBroker(brokerService.getBroker());

                    ActiveMQMessage advisoryMessage = new ActiveMQMessage();
                    advisoryMessage.setStringProperty("cause", error.getLocalizedMessage());
                    advisoryBroker.fireAdvisory(context, AdvisorySupport.getNetworkBridgeForwardFailureAdvisoryTopic(), messageDispatch.getMessage(), null,
                            advisoryMessage);

                }
            } catch (Exception e) {
                LOG.warn("failed to fire forward failure advisory, cause: {}", e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.