Package javax.jms

Examples of javax.jms.QueueReceiver.receiveNoWait()


            Message msg = s_send.createObjectMessage(new Integer(i++));
            msg.setStringProperty("myprop", "aaa");
            qsender.send(msg);
            s_send.commit();
            //consume message 1
            msg = qr_bbb.receiveNoWait();
            Assert.assertNull(msg);
            s_rec.commit();
            msg = qr_aaa.receiveNoWait();
            Assert.assertNotNull(msg);
            Assert.assertEquals("myprop", "aaa", msg.getStringProperty("myprop"));
View Full Code Here


            s_send.commit();
            //consume message 2
            msg = qr_aaa.receiveNoWait();
            Assert.assertNull(msg);
            s_rec.commit();
            msg = qr_bbb.receiveNoWait();
            Assert.assertNotNull(msg);
            Assert.assertEquals("myprop", "bbb", msg.getStringProperty("myprop"));
            s_rec.commit();
           
            //send message 3
View Full Code Here

            qsender.send(msg);
            s_send.commit();
            //consume message 3
            msg = qr_aaa.receiveNoWait();
            Assert.assertNull(msg);
            msg = qr_bbb.receiveNoWait();
            Assert.assertNull(msg);
            s_rec.commit();
            msg = qr_plain.receiveNoWait();
            Assert.assertNotNull(msg);
            Assert.assertEquals("myprop", "ccc", msg.getStringProperty("myprop"));
View Full Code Here

            s_send.commit();
            //consume message 4
            msg = qr_aaa.receiveNoWait();
            Assert.assertNull(msg);
            s_rec.commit();
            msg = qr_bbb.receiveNoWait();
            Assert.assertNull(msg);
            s_rec.commit();
            msg = qr_plain.receiveNoWait();
            Assert.assertNotNull(msg);
            Assert.assertNull("myprop", msg.getStringProperty("myprop"));
View Full Code Here

            msg = s_send.createObjectMessage(new Integer(i++));
            msg.setStringProperty("myprop", "aaa");
            qsender.send(msg);
            s_send.commit();
            //consume message 5
            msg = qr_bbb.receiveNoWait();
            Assert.assertNull(msg);
            s_rec.commit();
            msg = qr_aaa.receiveNoWait();
            Assert.assertNotNull(msg);
            Assert.assertEquals("myprop", "aaa", msg.getStringProperty("myprop"));
View Full Code Here

            s_send.commit();
            //consume message 6
            msg = qr_aaa.receiveNoWait();
            Assert.assertNull(msg);
            s_rec.commit();
            msg = qr_bbb.receiveNoWait();
            Assert.assertNull(msg);
            s_rec.commit();
            msg = qr_plain.receiveNoWait();
            Assert.assertNotNull(msg);
            Assert.assertEquals("myprop", "ccc", msg.getStringProperty("myprop"));
View Full Code Here

            /* Commit the sending session */
            s_send.commit();
            /* Wait 3 seconds, give the provider a bit of time ... */
            Thread.sleep(3000);
            /* Receive the message */
            Message message = qr.receiveNoWait();
            /* Commit the session to clear the queue */
            s_rec.commit();
            //map message?
            Assert.assertTrue(message instanceof MapMessage);
            msg = (MapMessage)message;
View Full Code Here

            qs = qc.createQueueSession (true, 0);
            QueueReceiver rec = qs.createReceiver
                (channelInQueue(), "processKey = '"
                 + ((Long)ctx.getPrimaryKey()).toString() + "'"
                 + " AND channelName = '" + channel + "'");
            Message msg = rec.receiveNoWait();
            Map result = null;
            if (msg != null && (msg instanceof ObjectMessage)) {
                result = (Map)((ObjectMessage)msg).getObject();
            }
            rec.close ();
View Full Code Here

            // Now clean up in queue
            qc = queueConnectionFactory().createQueueConnection();
            qs = qc.createQueueSession (true, 0);
            QueueReceiver rec = qs.createReceiver
                (channelInQueue(), "processKey = '" + processKey + "'");
            while (rec.receiveNoWait() != null) {
            }
            rec.close ();
        } catch (JMSException e) {
            throw new EJBException (e);
        } catch (RemoteException e) {
View Full Code Here

            // Now clean up in queue
            qc = queueConnectionFactory().createQueueConnection();
            qs = qc.createQueueSession (true, 0);
            QueueReceiver rec = qs.createReceiver
                (channelInQueue(), "processKey = '" + processKey + "'");
            while (rec.receiveNoWait() != null) {
            }
            rec.close ();
        } catch (JMSException e) {
            throw new EJBException (e);
        } catch (ResourceNotAvailableException 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.