Package javax.jms

Examples of javax.jms.TopicRequestor


                    e.printStackTrace();
                }
            }
        });

        TopicRequestor requestor = new TopicRequestor((TopicSession)localSession, included);
        // allow for consumer infos to perculate arround
        Thread.sleep(2000);
        for (int i = 0; i < MESSAGE_COUNT; i++) {
            TextMessage msg = localSession.createTextMessage("test msg: " + i);
            TextMessage result = (TextMessage)requestor.request(msg);
            assertNotNull(result);
            LOG.info(result.getText());
        }
    }
View Full Code Here


                    e.printStackTrace();
                }
            }
        });

        TopicRequestor requestor = new TopicRequestor((TopicSession)localSession, included);
        // allow for consumer infos to perculate arround
        Thread.sleep(5000);
        for (int i = 0; i < MESSAGE_COUNT; i++) {
            TextMessage msg = localSession.createTextMessage("test msg: " + i);
            TextMessage result = (TextMessage)requestor.request(msg);
            assertNotNull(result);
            LOG.info(result.getText());
        }
    }
View Full Code Here

                    e.printStackTrace();
                }
            }
        });

        TopicRequestor requestor = new TopicRequestor((TopicSession)localSession, included);
        // allow for consumer infos to perculate arround
        Thread.sleep(5000);
        for (int i = 0; i < MESSAGE_COUNT; i++) {
            TextMessage msg = localSession.createTextMessage("test msg: " + i);
            TextMessage result = (TextMessage)requestor.request(msg);
            assertNotNull(result);
            LOG.info(result.getText());
        }
    }
View Full Code Here

                    e.printStackTrace();
                }
            }
        });

        TopicRequestor requestor = new TopicRequestor((TopicSession)localSession, included);
        // allow for consumer infos to perculate arround
        Thread.sleep(5000);
        for (int i = 0; i < MESSAGE_COUNT; i++) {
            TextMessage msg = localSession.createTextMessage("test msg: " + i);
            TextMessage result = (TextMessage)requestor.request(msg);
            assertNotNull(result);
            LOG.info(result.getText());
        }
    }
View Full Code Here

   
   
    public void testRequests() throws Exception{
        try {
        TopicSession s = requestorConnection.createTopicSession(false,Session.AUTO_ACKNOWLEDGE);
        TopicRequestor requestor = new TopicRequestor(s,destination);
        ConnectionAdvisor ca = new ConnectionAdvisor(requestorConnection);
        ca.start();
        //
        // A peer:// when connected will have 1 + (2 * number of connections) connections
        // As we have 2 peers - total connections == 6!!
        ca.waitForActiveConnections(6, 30000);
        for (Iterator i = ca.getConnections().iterator(); i.hasNext();){
            System.out.println(i.next());
        }
        for (int i =0; i < MESSAGE_COUNT; i++){
            Message msg = s.createTextMessage("test:" + i);
            Message receipt = requestor.request(msg);
            System.out.println("Got reply: " + receipt);
            assertNotNull("receipt is null!!",receipt);
        }
        }catch(Throwable e){
            e.printStackTrace();
View Full Code Here

                    e.printStackTrace();
                }
            }
        });

        TopicRequestor requestor = new TopicRequestor((TopicSession)localSession, included);
        // allow for consumer infos to perculate arround
        Thread.sleep(2000);
        for (int i = 0; i < MESSAGE_COUNT; i++) {
            TextMessage msg = localSession.createTextMessage("test msg: " + i);
            TextMessage result = (TextMessage)requestor.request(msg);
            assertNotNull(result);
            LOG.info(result.getText());
        }
    }
View Full Code Here

        fac = (ActiveMQConnectionFactory)context.getBean("remoteFactory");
        remoteConnection = fac.createTopicConnection();
        remoteConnection.start();
        TopicSession session = remoteConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
        requestor = new TopicRequestor(session, theTopic);
    }
View Full Code Here

TOP

Related Classes of javax.jms.TopicRequestor

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.