Package org.apache.stratos.messaging.broker.connect

Examples of org.apache.stratos.messaging.broker.connect.TopicConnector


  @Override
  public void run() {
        if(log.isDebugEnabled()){
        log.debug(topicName + " topic health checker is running... " );
        }
    TopicConnector testConnector = new TopicConnector();
    while (!terminated) {
      try {
        // Health checker needs to run with the smallest possible time interval
        // to detect a connection drop. Otherwise the subscriber will not
                // get reconnected after a connection drop.
        Thread.sleep(1000);
        testConnector.init(topicName);
                // A ping event is published to detect a session timeout
                EventPublisherPool.getPublisher(Constants.PING_TOPIC).publish(new PingEvent(), false);
      } catch (Exception e) {
        // Implies connection is not established
        // sleep for 30 sec and retry
        try {
          log.error(topicName + " topic health checker is failed and will try to subscribe again in 30 sec");
          Thread.sleep(30000);
          break;
        } catch (InterruptedException ignore) {
        }
      } finally {
        try {
          testConnector.close();
        } catch (JMSException ignore) {
        }
      }

    }
View Full Code Here


   * @param aTopicName
   *            topic name of this subscriber instance.
   */
  public TopicSubscriber(String aTopicName) {
    topicName = aTopicName;
    connector = new TopicConnector();
        if(log.isDebugEnabled()) {
            log.debug(String.format("Topic subscriber connector created: [topic] %s", topicName));
        }
  }
View Full Code Here

   * @param aTopicName
   *            topic name of this publisher instance.
   */
  TopicPublisher(String aTopicName) {
    super(aTopicName);
    connector = new TopicConnector();
        if(log.isDebugEnabled()) {
            log.debug(String.format("Topic publisher connector created: [topic] %s", getName()));
        }
  }
View Full Code Here

TOP

Related Classes of org.apache.stratos.messaging.broker.connect.TopicConnector

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.