Package javax.jms

Examples of javax.jms.MessageListener


      // and started
      if (endpointReference.isAsyncInvocation()) {
      // Create the JMS listener
        FactoryExtensionPoint modelFactories = extensions.getExtensionPoint(FactoryExtensionPoint.class);
            MessageFactory messageFactory = modelFactories.getFactory(MessageFactory.class);
            MessageListener listener;
      try {
        listener = new JMSAsyncResponseInvoker(endpointReference, messageFactory, jmsResourceFactory);
      } catch (NamingException e) {
        throw new JMSBindingException("Unable to create JMSResponseInvoker", e);
      } // end try
View Full Code Here


    public void start()
    {
        try
        {
            final MessageConsumer consumer = _session.createConsumer(_controllerQueue);
            consumer.setMessageListener(new MessageListener()
            {
                @Override
                public void onMessage(final Message message)
                {
                    try
View Full Code Here

        {
            synchronousRun();
        }
        else
        {
            _jmsDelegate.registerListener(_command.getParticipantName(), new MessageListener(){

                @Override
                public void onMessage(Message message)
                {
                    processAsynchMessage(message);
View Full Code Here

    {
        try
        {
            _instructionQueue = _controllerSession.createTemporaryQueue();
            final MessageConsumer instructionConsumer = _controllerSession.createConsumer(_instructionQueue);
            instructionConsumer.setMessageListener(new MessageListener()
            {
                @Override
                public void onMessage(final Message message)
                {
                    client.processInstruction(JmsMessageAdaptor.messageToCommand(message));
View Full Code Here

    {
        final CountDownLatch count= new CountDownLatch(20);
        final Exception exceptions[] = new Exception[20];
        final AtomicBoolean failed = new AtomicBoolean(false);

        _consumer.setMessageListener(new MessageListener()
        {

            public void onMessage(Message message)
            {
View Full Code Here

        final long sendCount = 1500;
        final CountDownLatch receivedOneCondition = new CountDownLatch(1);
        final CountDownLatch waitCondition = new CountDownLatch(1);
       
        MessageConsumer consumer = session.createConsumer(destination);
        consumer.setMessageListener(new MessageListener() {

            public void onMessage(Message message) {
                try {
                    LOG.info("Got my message: " + message);
                    receivedOneCondition.countDown();
View Full Code Here

        final long sendCount = 1500;
        final CountDownLatch receivedOneCondition = new CountDownLatch(1);
        final CountDownLatch waitCondition = new CountDownLatch(1);
        final AtomicLong received = new AtomicLong();
        MessageConsumer consumer = session.createConsumer(destination);
        consumer.setMessageListener(new MessageListener() {

            public void onMessage(Message message) {
                try {
                    LOG.info("Got my message: " + message);
                    receivedOneCondition.countDown();
View Full Code Here

        consumerConnection = (ActiveMQConnection) createConnection();
        consumerConnection.setClientID("cliID");
        consumerConnection.start();
        consumerSession = consumerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);

        MessageListener listener = new MessageListener() {
            public void onMessage(Message message) {
                latch.countDown();
                try {
                    consumerSession.recover();
                } catch (Exception ignored) {
View Full Code Here

    private void openDlqConsumer(final CountDownLatch received) throws Exception {

        dlqConnection = (ActiveMQConnection) createConnection();
        Session dlqSession = dlqConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        MessageConsumer dlqConsumer = dlqSession.createConsumer(new ActiveMQQueue("ActiveMQ.DLQ"));
        dlqConsumer.setMessageListener(new MessageListener() {
            public void onMessage(Message message) {
                if (received.getCount() > 0 && received.getCount() % 200 == 0) {
                    LOG.info("remaining on DLQ: " + received.getCount());
                }
                received.countDown();
View Full Code Here

        // Create the eventual Consumer to receive the scheduled message
        MessageConsumer consumer = session.createConsumer(destination);

        final CountDownLatch latch = new CountDownLatch(COUNT);
        consumer.setMessageListener(new MessageListener() {
            public void onMessage(Message message) {
                latch.countDown();
            }
        });

        // Create the "Browser"
        MessageConsumer browser = session.createConsumer(browseDest);
        final CountDownLatch browsedLatch = new CountDownLatch(COUNT);
        browser.setMessageListener(new MessageListener() {
            public void onMessage(Message message) {
              browsedLatch.countDown();
              LOG.debug("Scheduled Message Browser got Message: " + message);
            }
        });
View Full Code Here

TOP

Related Classes of javax.jms.MessageListener

Copyright © 2018 www.massapicom. 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.