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


        ActiveMQTopic pubTopic = new ActiveMQTopic("demo.org.servicemix.source");
        System.out.println("Connecting to JMS server.");
        TopicConnection connection = factory.createTopicConnection();
        TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
        connection.start();
        TopicRequestor requestor = new TopicRequestor(session, pubTopic);
        System.out.println("Sending request.");
        String payload = "";
        BufferedReader reader = new BufferedReader(new FileReader("message.soap"));
        String str = null;
        while ((str = reader.readLine()) != null) {
            payload += str;
        }
        Message out = session.createTextMessage(payload);
        Message in = requestor.request(out);
        if (in == null) {
            System.out.println("Response timed out.");
        }
        else {
            System.out.println("Response was: " + in);
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

        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

                    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

       
        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

                    e.printStackTrace();
                }
            }
        });
       
        TopicRequestor requestor=new TopicRequestor((TopicSession) localSession,included);
        Thread.sleep(2000);//alow for consumer infos to perculate arround
        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

        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.