Package org.apache.geronimo.jms.test.sb

Examples of org.apache.geronimo.jms.test.sb.JmsSenderRemote


        String msgsPerShipStr = System.getProperty("requests-per-shipment");

        int totalShip = (totalShipStr == null ? 10 : Integer.parseInt(totalShipStr));
        int msgsPerShip = (msgsPerShipStr == null ? 20 : Integer.parseInt(msgsPerShipStr));

        JmsSenderRemote jmsSender = (JmsSenderRemote) ctx.lookup("JmsSenderRemote");
        if (jmsSender != null) {
            System.out.println("JmsSender initialized");
            for (int i = 0; i < totalShip; ++i) {
                String messageName = (i + 1) + ".Request";

                System.out.format("Sending (%1$s) request(s) with name %2$s%n", msgsPerShip, messageName);
                jmsSender.sendMessage(messageName, 0, msgsPerShip);
                System.out.println("Requests sent");
            }
            //enable is receiveMessage is modified to detect messages on request queue
/*
            Thread.sleep(10000);
            Integer id = jmsSender.receiveMessage();
            if (id != null) {
                throw new Exception("received request message: " + id);
            }
*/
            //uncomment to actually run test
            for (int i = 0; i < totalShip * msgsPerShip; i++) {
                Integer id = jmsSender.receiveMessage();
                if (id == null) {
                    throw new Exception("did not receive message: " + i);
//                    System.out.println("Did not receive message: " + i);
//                    Thread.sleep(10000);
                }
View Full Code Here


        String msgsPerShipStr = System.getProperty("requests-per-shipment");

        int totalShip = (totalShipStr == null ? 10 : Integer.parseInt(totalShipStr));
        int msgsPerShip = (msgsPerShipStr == null ? 10 : Integer.parseInt(msgsPerShipStr));

        JmsSenderRemote jmsSender = (JmsSenderRemote) this.ctx.lookup("JmsSenderRemote");
        if (jmsSender != null) {
            System.out.println("JmsSender initialized");
            for (int i = 0; i < totalShip; ++i) {
                String messageName = (i + 1) + ".Request";

                System.out.format("Sending (%1$s) request(s) with name %2$s%n", msgsPerShip, messageName);
                jmsSender.sendMessage(messageName, 0, msgsPerShip);
                System.out.println("Requests sent");
            }
            //enable is receiveMessage is modified to detect messages on request queue
/*
            Thread.sleep(10000);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.jms.test.sb.JmsSenderRemote

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.